/* ==========================================================================
   Threadapalooza (js/views/event.js). A front (head, then a short "Most
   liked" set), one row of controls, an index of the sections and the
   sections themselves. On a wide screen the index stays in the left margin
   and threads run two to a line; on a narrow one the index is a single line
   that scrolls sideways under the site header. Uses the tokens and the seg,
   select, idx, meta-row, pub-line, avatar, btn and empty rules of styles.css.

   "Contents" is the book: parts, chapters and one line for each essay. The
   other three groupings list threads as rows with a summary.
   ========================================================================== */

.ev-page {
  max-width: calc(1208px + var(--gutter) * 2);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.ev-front, .ev-controls, .ev-list, .ev-foot { min-width: 0; container: ev / inline-size; }

.ev-head { margin-bottom: 0; padding-bottom: 22px; }
.ev-page[data-group="contents"] .ev-head { border-bottom: 0; padding-bottom: 4px; }
.ev-head__id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ev-head__mark {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: var(--r);
  object-fit: cover;
  box-shadow: var(--shadow-1);
}
.ev-head__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 18px;
  min-width: 0;
}
.ev-foot {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.ev-foot__note {
  max-width: 68ch;
  color: var(--ink-3);
  font-size: var(--fs-sm);
  line-height: 1.6;
  text-wrap: pretty;
}
.ev-foot__note a {
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.ev-foot__note a:hover { color: var(--ink); }
.ev-head__how {
  margin-top: 10px;
  max-width: 68ch;
  color: var(--ink-3);
  font-size: var(--fs-sm);
  line-height: 1.6;
  text-wrap: pretty;
}
/* How the threads were found: shut until asked for. */
.ev-how { margin-top: 10px; }
.ev-how__summary {
  width: fit-content;
  padding: 4px 2px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}
.ev-how__summary:hover { color: var(--ink); }
.ev-how__summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ev-how .ev-head__how { margin-top: 4px; }

/* --------------------------------------------------------------------------
   Most liked: six plain entries. One line that scrolls sideways on a phone,
   two or three to a line where there is room. Contents leaves it out: the
   book is the page there, and its stars do this job.
   -------------------------------------------------------------------------- */
.ev-page[data-group="contents"] .ev-liked { display: none; }
.ev-liked { padding: 22px 0 26px; border-bottom: 1px solid var(--line); }
.ev-liked__head { margin-bottom: 12px; }
.ev-liked__heading {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.012em;
}
.ev-liked__list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(76%, 280px);
  column-gap: 24px;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.ev-liked__list::-webkit-scrollbar { display: none; }
.ev-liked__item {
  position: relative;
  min-width: 0;
  padding: 12px 0 10px;
  border-top: 1px solid var(--line);
  scroll-snap-align: start;
}
.ev-liked__title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ev-liked__link { color: var(--ink); text-decoration: none; transition: color 120ms; }
.ev-liked__link::after { content: ""; position: absolute; inset: 0; }
.ev-liked__item:hover .ev-liked__link { color: var(--pub-ink); }
.ev-liked__link:focus-visible { outline: none; }
.ev-liked__item:has(.ev-liked__link:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
.ev-liked__by {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 6px;
  color: var(--ink-3);
  font-size: var(--fs-xs);
  line-height: 20px;
}
.ev-liked__name { color: var(--ink-2); font-weight: 600; }

@container ev (min-width: 560px) {
  .ev-liked__list {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 40px;
    margin-inline: 0;
    padding-inline: 0;
    overflow: visible;
  }
}
@container ev (min-width: 860px) {
  .ev-liked__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------
   Controls. The view switcher and "Starred only" sit under the lede in
   .ev-head__controls. This row holds the three filters and their status
   for the non-book views, and stays hidden in Contents unless filtering.
   -------------------------------------------------------------------------- */
.ev-controls { padding-top: 14px; }
.ev-controls[hidden] { display: none; }
.ev-controls__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  min-width: 0;
}
.ev-filters-btn { margin-left: auto; min-height: 32px; padding-inline: 4px; }
.ev-filters-btn[aria-expanded="true"] { color: var(--ink); }
.ev-filters-btn__n {
  min-width: 1.5em;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--paper-3);
  color: var(--ink-2);
  font-size: var(--fs-micro);
  line-height: 1.2;
  text-align: center;
}

.ev-filters { display: none; }
.ev-controls[data-open="true"] .ev-filters {
  display: grid;
  flex: 1 0 100%;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 6px 0 4px;
}
.ev-filters label { display: block; min-width: 0; }
.ev-filters__label {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-3);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.ev-filters .select {
  height: 34px;
  border-color: var(--line);
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
/* A filter that is off its usual value. */
.ev-filters .select[data-on="true"] { border-color: var(--ink-3); color: var(--ink); font-weight: 600; }
.ev-status { color: var(--ink-3); font-size: var(--fs-sm); line-height: 1.4; }
.ev-star-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-3);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms, border-color 140ms, color 140ms;
}
.ev-star-toggle:hover { border-color: var(--line-2); background: var(--paper-2); color: var(--ink); }
.ev-star-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ev-star-toggle .ev-star { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linejoin: round; }
.ev-star-toggle[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); font-weight: 600; }
.ev-star-toggle[aria-pressed="true"]:hover { border-color: var(--ink-2); background: var(--ink-2); color: var(--paper); }
.ev-star-toggle[aria-pressed="true"] .ev-star { fill: currentColor; }
.ev-star { flex: none; width: 12px; height: 12px; fill: currentColor; }

@container ev (min-width: 440px) {
  .ev-controls[data-open="true"] .ev-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Room for the three selects on one quiet line beside any active status text. */
@container ev (min-width: 640px) {
  .ev-controls__row { flex-wrap: nowrap; justify-content: space-between; }
  .ev-filters-btn { display: none; }
  .ev-filters, .ev-controls[data-open="true"] .ev-filters { display: flex; flex: 0 1 auto; margin-left: auto; justify-content: flex-end; gap: 8px; min-width: 0; padding: 0; }
  .ev-filters label { flex: 0 1 auto; }
  .ev-filters .select { width: 100%; max-width: 200px; height: 32px; }
  .ev-filters__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* The book has its own scope: no filters in Contents, and no button for them. */
.ev-controls[data-group="contents"] .ev-filters,
.ev-controls[data-group="contents"][data-open="true"] .ev-filters,
.ev-controls[data-group="contents"] .ev-filters-btn { display: none; }

/* --------------------------------------------------------------------------
   Index: the sections of the list, each with its count. .idx in styles.css
   draws it as words in the margin, or as one scrolling line under 1024px.
   -------------------------------------------------------------------------- */
.ev-index .idx__n { color: var(--ink-3); }
.ev-index .idx__btn[aria-current="true"] { color: var(--ink); font-weight: 600; }
.ev-index:empty { display: none; }
/* The book's outline: a part with its numeral, and its chapters under it where there is a margin
   to list them in. */
.ev-idx__num { display: inline-block; margin-right: 6px; color: var(--ink-3); font-weight: 500; }
.ev-idx__chapters { display: none; }
.ev-index .idx__btn[aria-current="true"] .ev-idx__num { color: inherit; }

@media (max-width: 1023px) {
  .ev-page { --ev-index-target: 36px; }
  .ev-index {
    position: sticky;
    top: var(--header-h);
    z-index: var(--z-sticky);
    margin: 10px calc(var(--gutter) * -1) 0;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }
  .ev-index::after {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    width: var(--gutter);
    background: linear-gradient(to right, transparent, var(--paper));
    pointer-events: none;
  }
  .ev-index .idx__list {
    gap: 14px;
    margin: 0;
    padding: 0 var(--gutter);
    scroll-padding-inline: var(--gutter);
    overscroll-behavior-x: contain;
  }
  .ev-index .idx__btn {
    min-height: var(--ev-index-target);
    max-width: min(18rem, calc(100vw - var(--gutter) * 2));
    padding: 0 2px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-weight: 500;
  }
  .ev-index .idx__btn > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .ev-index .idx__btn:focus-visible { outline-offset: -2px; }
  .ev-index .idx__btn[aria-current="true"] { border-bottom-color: var(--ink); font-weight: 500; }
  .ev-idx__num { margin-right: 4px; }
  .ev-group__title, .ev-anchor { scroll-margin-top: calc(var(--ev-index-target) + 1px); }
}

@media (min-width: 1024px) {
  .ev-page { grid-template-columns: 200px minmax(0, 1fr); column-gap: 56px; align-items: start; }
  .ev-front, .ev-controls, .ev-list, .ev-foot { grid-column: 2; }
  .ev-index {
    grid-column: 1;
    grid-row: 1 / span 4;
    position: sticky;
    top: calc(var(--header-h) + 20px);
    max-height: calc(100dvh - var(--header-h) - 40px);
    overflow-y: auto;
    margin-inline: -8px;
    padding: 14px 8px 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
  }
  .ev-idx__group { margin-bottom: 4px; }
  .ev-index .ev-idx__part { padding: 5px 0 2px; color: var(--ink-2); font-weight: 600; }
  .ev-idx__num { min-width: 28px; margin-right: 0; }
  .ev-idx__chapters { display: block; padding-left: 28px; }
  .ev-index .ev-idx__chap { padding: 2px 0; font-size: var(--fs-xs); line-height: 1.3; }
}

/* --------------------------------------------------------------------------
   Contents: a part is a hard rule, its numeral and its name; a chapter is a
   number in the margin and a title; an essay is one line where it fits,
   with its star in the same margin, then dots across to its reading time.
   One column at a book's measure, read straight down.
   -------------------------------------------------------------------------- */
.ev-toc { --toc-margin: 24px; max-width: 46rem; }
.ev-part { padding-top: 44px; }
.ev-part:first-child { padding-top: 26px; }
.ev-part__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--ink);
}
.ev-part__title {
  min-width: 0;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.018em;
  text-wrap: balance;
}
.ev-part__n {
  margin-right: 8px;
  color: var(--ink-3);
  font-size: 0.6em;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
}
.ev-chapters { padding-top: 24px; }
.ev-chap { padding-bottom: 26px; }
.ev-chap__title {
  display: grid;
  grid-template-columns: var(--toc-margin) minmax(0, 1fr);
  align-items: baseline;
  padding-bottom: 5px;
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.006em;
}
.ev-chap__n { color: var(--ink-3); font-family: var(--sans); font-size: var(--fs-sm); font-weight: 500; letter-spacing: 0; }
.ev-part__title:focus-visible, .ev-chap__title:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: var(--r-sm); }

.ev-toc__item {
  position: relative;
  display: grid;
  grid-template-columns: var(--toc-margin) minmax(0, auto) minmax(20px, 1fr) auto;
  align-items: baseline;
  padding: 5px 0;
}
.ev-toc__star { grid-column: 1; color: var(--ink-2); }
.ev-toc__text { grid-column: 2; min-width: 0; line-height: 1.4; }
.ev-toc__dots { grid-column: 3; margin-inline: 10px; border-bottom: 1px dotted var(--line-2); transform: translateY(-3px); }
.ev-toc__link {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 120ms;
}
.ev-toc__link::after { content: ""; position: absolute; inset: 0; }
.ev-toc__item:hover .ev-toc__link { color: var(--pub-ink); }
.ev-toc__link:focus-visible { outline: none; }
.ev-toc__item:has(.ev-toc__link:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; border-radius: var(--r-sm); }
.ev-toc__link .icon { width: 12px; height: 12px; margin-left: 4px; color: var(--ink-3); vertical-align: -1px; }
/* Above the line's stretched link, so resting on a name brings up the author's card. */
.ev-toc__by { position: relative; z-index: 1; margin-left: 6px; color: var(--ink-3); font-size: var(--fs-sm); }
.ev-toc__len { grid-column: 4; color: var(--ink-3); font-size: var(--fs-xs); white-space: nowrap; }
/* --------------------------------------------------------------------------
   Sections: a hard rule, the name and the count, then the threads
   -------------------------------------------------------------------------- */
.ev-sections {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 44px 40px;
  align-items: start;
  padding-top: 26px;
}
.ev-group { min-width: 0; }
.ev-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 12px;
  border-top: 1px solid var(--ink);
}
.ev-group__title {
  min-width: 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.012em;
  overflow-wrap: anywhere;
}
.ev-group__n { color: var(--ink-3); font-size: var(--fs-sm); white-space: nowrap; }
/* A section for one author: the name is the head. */
.ev-group__by { margin-bottom: 0; gap: 10px; font-size: 1.0625rem; }
.ev-group__by .pub-line__pub { gap: 10px; font-weight: 700; }
.ev-group__by .pub-line__author { font-family: var(--sans); font-size: var(--fs-sm); font-weight: 400; letter-spacing: 0; }
.ev-group__head:has(.ev-group__by) { align-items: center; padding-block: 8px 10px; }
.ev-group__more { margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); }

.ev-rows { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 40px; }

/* Two to a line where the column is wide enough: threads within a topic or a year, or, by
   author, the authors themselves. event.js asks the same question to decide how many threads
   make three lines, so the two queries must stay the same. */
@media (min-width: 768px) and (max-width: 1023px), (min-width: 1040px) {
  .ev-list:not([data-group="author"]) .ev-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ev-list[data-group="author"] .ev-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------
   Rows: who, the title in up to two lines, the summary in three, one line
   of facts
   -------------------------------------------------------------------------- */
.ev-row {
  position: relative;
  min-width: 0;
  padding: 14px 0 16px;
  border-top: 1px solid var(--line);
}
.ev-row .pub-line { margin-bottom: 5px; }
.ev-row__title {
  max-width: 66ch;
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.006em;
  text-wrap: balance;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ev-row__link { color: var(--ink); text-decoration: none; transition: color 120ms; }
.ev-row__link::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.ev-row:hover .ev-row__link { color: var(--pub-ink); }
.ev-row__link:focus-visible { outline: none; }
.ev-row:has(.ev-row__link:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: var(--r-sm); }
.ev-row__sum {
  margin-top: 5px;
  max-width: 66ch;
  font-family: var(--serif);
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ev-row__meta { margin-top: 10px; gap: 4px 12px; }

.ev-tag {
  padding: 1px 7px;
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--ink-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.35;
}
.ev-tag--not { box-shadow: none; background: var(--paper-3); color: var(--ink-2); }
/* Above the row's stretched link, so resting on a tag shows why the thread was read that way. */
.ev-tag[title] { position: relative; z-index: 1; cursor: help; }

.ev-row__star {
  display: inline;
  margin-left: 0.34em;
  color: var(--ink-3);
  white-space: nowrap;
}
.ev-row__star .ev-star {
  display: inline;
  width: 0.72em;
  height: 0.72em;
  vertical-align: 0.06em;
}

.ev-row__essay {
  position: relative;
  z-index: 1;
  color: var(--pub-ink);
  font-weight: 600;
  text-decoration: none;
}
.ev-row__essay:hover { text-decoration: underline; text-underline-offset: 0.2em; }

.ev-list > .ev-empty { margin-top: 26px; }
.page > .ev-empty { margin-top: 24px; }
.ev-empty .btn { margin-top: 10px; }

/* --------------------------------------------------------------------------
   The two ways in from other screens: the last row of the publications
   directory (text in line with the names above it) and the block on the home page
   -------------------------------------------------------------------------- */
.dir-row--more .dir-row__main { padding-left: 64px; }
.ev-entry { padding-top: 10px; }

@media (pointer: coarse) {
  .ev-groupby .seg__btn { min-height: 44px; }
  .ev-filters-btn { min-height: 44px; }
  .ev-filters .select { height: 44px; }
  .ev-how__summary { padding-block: 12px; }
  .ev-group__more .btn { min-height: 44px; }
  .ev-star-toggle { min-height: 44px; }
  .ev-toc__item { min-height: 44px; align-content: center; padding-block: 7px; }
}

@media (min-width: 1024px) and (pointer: coarse) {
  .ev-index .idx__btn { min-height: 44px; }
}

/* The status line says something only when a filter is on. Empty, it takes no room. */
.ev-status:empty { display: none; }

/* --------------------------------------------------------------------------
   Contents, set as a book. One display face (IM Fell English, a 17th-century book type) for
   the page and part titles; Literata for everything read. The entries sit back so the
   chapter leads: regular weight titles, the author in italic, figures that line up.
   Literata as served has no old-style figures or small capitals, so "PART I" is spaced
   capitals and the time column uses tabular figures.
   -------------------------------------------------------------------------- */
.ev-page { --display: "IM Fell English", "Iowan Old Style", "Palatino Linotype", Georgia, serif; }
.ev-page .page-head__title { font-family: var(--display); font-weight: 400; letter-spacing: -0.01em; }
.ev-part__head { align-items: flex-end; }
.ev-part__title { font-family: var(--display); font-weight: 400; font-size: clamp(1.875rem, 1.5rem + 1.4vw, 2.5rem); line-height: 1.1; letter-spacing: -0.005em; }
.ev-part__n {
  display: block;
  margin: 0 0 6px;
  color: var(--ink-3);
  font-family: var(--serif);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.ev-chap__title { font-weight: 650; }
.ev-chap__n { font-family: var(--serif); font-size: 0.9375rem; font-weight: 400; font-variant-numeric: tabular-nums; }
.ev-toc__link { font-weight: 400; }
.ev-toc__by { margin-left: 8px; color: var(--ink-2); font-family: var(--serif); font-style: italic; font-size: 0.9375rem; }
.ev-toc__len { font-family: var(--serif); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.ev-idx__num { font-family: var(--serif); }

@media (max-width: 600px) {
  .ev-page, .page:has(> .ev-head) { padding-top: 16px; }
  .ev-head { padding-bottom: 14px; }
  .ev-page[data-group="contents"] .ev-head { padding-bottom: 0; }
  .ev-head__id { gap: 9px; }
  .ev-head__mark { width: 32px; height: 32px; }
  .ev-head .page-head__title { min-width: 0; font-size: clamp(1.625rem, 1rem + 3.5vw, 2rem); }
  .ev-head .page-head__lede { margin-top: 8px; font-size: 1.0625rem; line-height: 1.45; }

  .ev-head__controls { gap: 6px; margin-top: 12px; }
  .ev-groupby { gap: 1px; padding: 1px; }
  .ev-groupby .seg__btn { min-height: 36px; padding-inline: clamp(6px, 1.6vw, 10px); }
  .ev-star-toggle { min-height: 40px; gap: 5px; padding-inline: clamp(8px, 2vw, 12px); }

  .ev-liked { padding-block: 14px 12px; }
  .ev-liked__head { margin-bottom: 7px; }
  .ev-liked__list {
    grid-auto-columns: min(73%, 264px);
    column-gap: 16px;
    padding-block: 3px 4px;
    overscroll-behavior-x: contain;
    mask-image: linear-gradient(to right, #000 calc(100% - var(--gutter)), transparent);
  }
  .ev-liked__item { padding-block: 9px 4px; }
  .ev-liked__by { line-height: 1.45; overflow-wrap: anywhere; }

  .ev-controls { padding-top: 4px; }
  .ev-controls[data-group="contents"] { padding-top: 8px; }
  .ev-controls__row { gap: 4px 10px; }
  .ev-status { flex: 1; min-width: 0; }
  .ev-filters-btn { min-height: 38px; padding-inline: 6px; }
  .ev-filters-btn::after {
    content: "";
    width: 6px;
    height: 6px;
    margin-inline: 2px;
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    transform: translateY(-2px) rotate(45deg);
  }
  .ev-filters-btn[aria-expanded="true"]::after { transform: translateY(1px) rotate(225deg); }
  .ev-controls[data-open="true"] .ev-filters { grid-template-columns: minmax(0, 1fr); gap: 6px; padding-block: 0 4px; }
  .ev-filters label { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); align-items: center; gap: 8px; }
  .ev-filters__label { margin-bottom: 0; }
  .ev-filters .select { height: 38px; font-size: var(--fs-body); }

  .ev-sections { padding-top: 16px; row-gap: 28px; }
  .ev-group__by .pub-line__author { display: none; } /* the name needs the line */
  .ev-row { padding-block: 12px; }
  .ev-row__title { -webkit-line-clamp: 3; line-clamp: 3; text-wrap: pretty; }
  .ev-row__meta { gap: 4px 10px; margin-top: 7px; }
  .ev-row__meta > * { white-space: normal; overflow-wrap: anywhere; }

  .ev-part { padding-top: 30px; }
  .ev-part:first-child { padding-top: 14px; }
  .ev-part__head { gap: 8px; padding-top: 10px; }
  .ev-part__title { font-size: clamp(1.625rem, 1.25rem + 2vw, 1.875rem); overflow-wrap: anywhere; }
  .ev-part__n { margin-bottom: 4px; }
  .ev-chapters { padding-top: 16px; }
  .ev-chap { padding-bottom: 18px; }
  .ev-chap__title { overflow-wrap: anywhere; }
  .ev-foot { margin-top: 36px; padding-top: 16px; }
}

/* On a narrow measure the title gets the full line, with the author and time below. */
@container ev (max-width: 560px) {
  .ev-toc { --toc-margin: 20px; }
  .ev-toc__item {
    grid-template-columns: var(--toc-margin) minmax(0, 1fr) auto;
    row-gap: 2px;
    padding-block: 6px 8px;
  }
  .ev-toc__text { display: contents; }
  .ev-toc__star { grid-row: 1; align-self: start; margin-top: 5px; }
  .ev-toc__link { grid-area: 1 / 2 / 2 / -1; line-height: 1.35; }
  .ev-toc__link .icon { display: inline-block; }
  .ev-toc__by {
    grid-area: 2 / 2;
    margin: 0 8px 0 0;
    color: var(--ink-3);
    font-size: 0.875rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
  .ev-toc__dots { display: none; }
  .ev-toc__len { grid-area: 2 / 3; }
}

@media (hover: none) {
  .ev-toc__by, .ev-row .ev-tag[title] { pointer-events: none; }
}
