/*
 * Unlayered brand CSS for the reading views (UX review, 2026-11-14, group C; inc/reading.php enqueues it on posts, the
 * blog and its topics, search results and the 404). Only what a layered rule cannot win: WordPress's flow-layout
 * margins (`:root :where(.is-layout-flow) > *`, unlayered) and the dark grounds' button ring, whose selector outranks
 * any sensible one. Everything else stays in the chrome parts (parts/article/column.css, parts/bloglist/cards.css).
 */

/* C7: a step's title sits on its own text, 8px above it — WordPress's flow layout zeroed the title's bottom margin and
   the post-end sheet the paragraph's top one (0px between them). */
.read .article__body .wp-block-details--open > .wp-block-details__title {
  margin-block-end: var(--wp--preset--spacing--10, 0.5rem);
}

/* C12: the search field's button keeps its own focus mark — a white ring inside the ink pill (the pill around it
   carries the ring on the ground) — on the 404 band too, where the dark grounds' rule drew a yellow ring on the white
   field (1.6:1). */
form.notfound__search[role='search'] button:focus-visible {
  outline: 2px solid var(--wp--preset--color--card, #fff);
  outline-offset: -5px;
}
/* The field's clear button in ink-muted, not the browser's blue. */
form.notfound__search[role='search'] input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  inline-size: 1rem;
  block-size: 1rem;
  margin-inline: 0.25rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%235F6166' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 4l8 8M12 4l-8 8'/%3E%3C/svg%3E") center / 0.75rem no-repeat;
  cursor: pointer;
}

/* ---------------------------------------------------------------------------------------------------------------
 * Design pass (14 Nov 2026). Unlayered for the same reasons as above: core's block CSS (table cells, quotes) and the
 * rail's own rules (assets/css/unlayered/post-form.css, enqueued before this file) are unlayered.
 * ------------------------------------------------------------------------------------------------------------- */

/* The rail (90rem+) is sticky 7rem from the top, but a long contents list (a city guide: 20 sections, 1,250px) ran
   past the screen's foot — its last sections out of reach until the article ended, the marked one lost below the fold.
   The list now scrolls inside the screen (assets/js/reading.js keeps the marked section in view). The track is drawn
   by the links themselves, so the scrolling box does not clip the yellow mark (it sat 2px outside the list). */
@media (width >= 90rem) {
  .read .read__body > .toc .toc__list {
    /* Not a one-column multicol box (`columns: 1`): capped in height, that flowed the rest into a hidden second column. */
    columns: auto;
    max-block-size: calc(100dvh - 7rem - 3.75rem - var(--wp--preset--spacing--50, 1.5rem));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-inline-start: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--wp--preset--color--hairline-tint, #CFCFCB) transparent;
  }
  .read .read__body > .toc .toc__list a {
    margin-inline-start: 0;
    border-inline-start-color: var(--wp--preset--color--hairline, #DDDDD9);
  }
  .read .read__body > .toc .toc__list a[aria-current='true'] {
    border-inline-start-color: var(--wp--preset--color--mark, #F2C230);
  }
  .read .read__body > .toc .toc__list a:focus-visible {
    outline-offset: -2px;
  }
}

/* A comparison's cells keep the article's own inset (12px × 16px): core's unlayered `.wp-block-table td { padding:
   .5em }` set the text 9px from the table's edge. Only where the table is drawn as a table — a phone's stacked rows keep
   their label : value spacing. */
@container (width >= 46rem) {
  .read .read__body .wp-block-table :is(th, td) {
    padding: var(--wp--preset--spacing--30, 0.75rem) var(--wp--preset--spacing--40, 1rem);
  }
}
@container (37.5rem <= width < 46rem) {
  .read .read__body .wp-block-table table:not(:has(tr > :nth-child(4))) :is(th, td) {
    padding: var(--wp--preset--spacing--30, 0.75rem) var(--wp--preset--spacing--40, 1rem);
  }
}

/* Production's three quoted statistics (core quotes) are the same thing as its 281 `umv-stat` blocks: the statement
   on a sign plate with the lane dash, in Newsreader (parts/article/column.css `.umv-stat`) — not WordPress's grey bar. */
.read .read__body > blockquote.wp-block-quote {
  position: relative;
  margin-block: var(--wp--preset--spacing--60, 2rem);
  padding: calc(0.5rem + var(--wp--preset--spacing--50, 1.5rem));
  border: 0;
  border-radius: var(--wp--custom--radius--lg, 18px);
  background: var(--wp--preset--color--card, #fff);
  box-shadow: var(--wp--custom--shadow--card);
}
.read .read__body > blockquote.wp-block-quote::before {
  content: "";
  position: absolute;
  inset: 0.5rem;
  border: 2px solid var(--wp--preset--color--ink);
  border-radius: var(--wp--custom--radius--md, 12px);
  pointer-events: none;
}
.read .read__body > blockquote.wp-block-quote > p {
  margin: 0;
  color: var(--wp--preset--color--ink);
  font-family: var(--wp--preset--font-family--heading);
  font-size: var(--wp--preset--font-size--title, 1.5rem);
  font-style: normal;
  line-height: var(--wp--custom--line-height--title, 1.15);
  text-wrap: pretty;
}
.read .read__body > blockquote.wp-block-quote > p:first-child::before {
  content: "";
  display: block;
  inline-size: var(--wp--custom--lane--dash, 2.5rem);
  block-size: var(--wp--custom--lane--dash-weight, 3px);
  margin-block-end: var(--wp--preset--spacing--30, 0.75rem);
  background: var(--wp--preset--color--mark, #F2C230);
}

/* The 404's and an empty search's way-out links on a phone: two by two, each pill half the row (four pills wrapped
   3 + 1 and left "Blog" alone under the others). The rows' own look is blocks/link-grid/variants/cards.css. */
@media (width < 30rem) {
  :root :is(main .notfound.notfound--cards, .journal__routes) .linkrow__links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    inline-size: min(100%, 22rem);
    margin-inline: auto;
  }
  :root :is(main .notfound.notfound--cards, .journal__routes) .linkrow__links > li {
    display: flex;
  }
  :root :is(main .notfound.notfound--cards, .journal__routes) .linkrow__link {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* A two-column comparison drawn as a table on a phone (parts/article/column.css): the cells' inset, a step tighter. */
@container (width < 37.5rem) {
  .read .read__body .wp-block-table table:not(:has(tr > :nth-child(3))) :is(th, td) {
    padding: var(--wp--preset--spacing--20, 0.75rem) var(--wp--preset--spacing--20, 0.75rem);
    vertical-align: top;
  }
}
