/*
 * roadgenius-publication.css — standalone editorial styling for PRISM-published
 * article bodies on the RoadGenius WordPress site. M22 publication polish.
 *
 * ───────────────────────────────────────────────────────────────────────────
 * HOW TO USE
 *   Either enqueue this file from the active WP theme/plugin, OR paste it whole
 *   into Appearance → Customize → Additional CSS. It is fully standalone: no
 *   build step, no preprocessor, no @import / network font loads. The theme
 *   already ships Roboto (300/400/500) + Kaushan Script; this sheet uses Roboto
 *   plus a system serif stack for display headings (see TYPOGRAPHY below).
 *
 * HOOKS — ELEMENT SELECTORS UNDER ONE WRAPPER, + LINK-SECTION MARKERS
 *   PRISM exports the article body as a self-contained HTML fragment with every
 *   `class` attribute and (almost) every `data-*` attribute stripped from the
 *   inner nodes. The primary stable hook is the wrapper PRISM adds last — one
 *   element carrying TWO classes:
 *       <div class="prism-publication prism-publication--rg"> … </div>
 *   So most rules below are scoped under `.prism-publication` and target the bare
 *   semantic elements that survive the strip (header, h2-h4, p, ul, table,
 *   figure, nav, a, footer …).
 *   ONE EXCEPTION (see the LINK SECTIONS block at the end): the public
 *   reader-render `data-link-section-*` markers (list/cards/card/compact/pill/
 *   inline/… — the variant containers + their parts) are deliberately kept
 *   through the strip, because those variants render as generic <ul>/<div>/<p>
 *   that bare-element selectors cannot tell apart. The allowlist lives in
 *   publishers/shared/publication-document/self-contain.ts; internal
 *   editor/inspector/preview/clause hooks are NOT kept. Do not "simplify" that
 *   strip back to dropping all data-* — it would un-style the link sections here.
 *
 * BRAND SLUG
 *   The live RoadGenius wrapper modifier is `--rg` (a slug of the IMMUTABLE
 *   PRISM Site key, stable across Site-name edits). Brand-accent rules target
 *   `.prism-publication--rg`. A `.prism-publication--roadgenius` alias is kept
 *   alongside it (harmless) in case an older export is still in flight.
 *
 * ROOT-INDEPENDENT SIZING — NO `rem` FOR FONT-SIZE
 *   The host theme sets `html { font-size: 62.5% }`, i.e. `1rem = 10px`. Sizing
 *   text in small `rem` therefore renders tiny (e.g. `0.9rem` = 9px). To stay
 *   immune to the host root we set ONE absolute base — `font-size: 19px` on
 *   `.prism-publication` — and size every descendant in `em` (relative to that
 *   19px base) or in `px`. Never use `rem` for font-size in this file. Spacing
 *   uses `em` (scales with the base) or `px`.
 *     Resulting sizes (≈): body 19px · h2 30px · h3 23px · h4 19px ·
 *     TOC links 16.6px · dates 15px · captions 16px · footnotes 16px.
 *
 * SPECIFICITY / COEXISTENCE
 *   Designed to load alongside theme CSS. Every selector is anchored at
 *   `.prism-publication` (often two levels deep) so it reliably beats bare-
 *   element theme rules, usually without `!important`. Exception: the TABLES
 *   section carries deliberate armor (doubled class + `!important`) against
 *   the theme's own `!important` table rules — see the HOST ARMOR comment
 *   there before "simplifying" any of it away. Elsewhere, if a stubborn
 *   62.5%-era theme rule still wins on a property, add `!important` only to
 *   that single declaration.
 * ───────────────────────────────────────────────────────────────────────────
 */

/* ========================================================================== */
/*  CONTAINER + READING RHYTHM                                                */
/* ========================================================================== */
/* The export nests content in stripped <main> > <div> wrappers; neutralize
 * them so the reading measure lives on the wrapper itself. */
.prism-publication main,
.prism-publication main > div {
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
}

.prism-publication {
  /* Absolute base — the linchpin of root-independence (see header). */
  font-size: 19px;
  font-family: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial,
    sans-serif;
  line-height: 1.72;
  color: #1c1d20;
  /* Reading measure ~680px, centered, with comfortable mobile gutters. */
  max-width: 680px;
  margin-inline: auto;
  padding-inline: 20px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Body copy: confident rhythm. */
.prism-publication p {
  margin: 0 0 1.15em;
  font-size: 1em; /* ≈ 19px */
  line-height: 1.72;
}

.prism-publication p:last-child {
  margin-bottom: 0;
}

/* Inline emphasis stays legible against the serif/sans mix. */
.prism-publication strong,
.prism-publication b {
  font-weight: 600;
}

/* ========================================================================== */
/*  TYPOGRAPHY — DISPLAY HEADINGS                                              */
/* ========================================================================== */
/* A system serif gives the body a magazine/feature voice without a font load;
 * Roboto carries the running text. Headings use the serif stack. */
.prism-publication h1,
.prism-publication h2,
.prism-publication h3,
.prism-publication h4,
.prism-publication h5,
.prism-publication h6 {
  font-family: Georgia, 'Times New Roman', 'Iowan Old Style', serif;
  color: #111315;
  text-wrap: balance; /* progressive — ignored where unsupported */
}

/* Graceful: a stray <h1> may still appear (normally the WP theme renders the
 * title as h1.entry-title OUTSIDE this wrapper). Style it sensibly if present. */
.prism-publication h1 {
  margin: 0 0 0.5em;
  font-size: 2.3em; /* ≈ 44px */
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.prism-publication h2 {
  margin: 1.9em 0 0.55em;
  font-size: 1.58em; /* ≈ 30px */
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.005em;
}

.prism-publication h3 {
  margin: 1.6em 0 0.45em;
  font-size: 1.2em; /* ≈ 23px */
  font-weight: 700;
  line-height: 1.3;
}

.prism-publication h4 {
  margin: 1.4em 0 0.4em;
  font-size: 1em; /* ≈ 19px */
  font-weight: 700;
  line-height: 1.4;
}

.prism-publication h5,
.prism-publication h6 {
  margin: 1.2em 0 0.4em;
  font-size: 0.82em; /* ≈ 16px */
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4a4d52;
}

/* First heading/section after the title block shouldn't carry a big top gap. */
.prism-publication header + section h2,
.prism-publication header + nav + section h2 {
  margin-top: 0.4em;
}

/* ========================================================================== */
/*  HEADER — PUBLISHED / UPDATED DATE LINE                                     */
/* ========================================================================== */
/* The wrapper has no <h1> (the theme owns the title). The header holds only the
 * compact "Published … · Updated …" line. */
.prism-publication header {
  margin: 0 0 2em;
}

.prism-publication header p {
  margin: 0;
  font-family: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial,
    sans-serif;
  font-size: 0.79em; /* ≈ 15px */
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.5;
  color: #6b6f76;
}

/* Lead/intro section sits just under the meta line. The first section's opening
 * paragraph reads slightly larger — a tasteful editorial standfirst. */
.prism-publication header + section > div > p:first-child {
  font-size: 1.12em; /* ≈ 21px */
  line-height: 1.62;
  color: #2a2c30;
}

/* ========================================================================== */
/*  LISTS                                                                      */
/* ========================================================================== */
.prism-publication ul,
.prism-publication ol {
  margin: 0 0 1.15em;
  padding-left: 1.3em;
}

.prism-publication li {
  margin: 0 0 0.4em;
  line-height: 1.6;
}

.prism-publication li > ul,
.prism-publication li > ol {
  margin: 0.4em 0 0.4em;
}

.prism-publication ul {
  list-style: disc;
}

.prism-publication ol {
  list-style: decimal;
}

/* ========================================================================== */
/*  BLOCKQUOTES                                                                */
/* ========================================================================== */
.prism-publication blockquote {
  margin: 1.6em 0;
  padding: 0.2em 0 0.2em 1.1em;
  border-left: 3px solid #e8590c;
  font-style: italic;
  color: #34373c;
}

.prism-publication blockquote p:last-child {
  margin-bottom: 0;
}

/* ========================================================================== */
/*  TABLE OF CONTENTS — <nav aria-label="On this page">                        */
/* ========================================================================== */
/* A quiet bordered card with a brand left-rule. The TOC is now NESTED by
 * heading level, so we style ul / ul ul / ul ul ul indentation. The top margin
 * gives the card clear breathing room from the standfirst paragraph above it. */
.prism-publication nav {
  margin: 2em 0 2.4em;
  padding: 1.1em 1.35em 1.2em;
  border: 1px solid #e6e3dd;
  border-left: 3px solid #e8590c;
  border-radius: 10px;
  background: #faf8f5;
}

.prism-publication nav h2 {
  font-family: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial,
    sans-serif;
  margin: 0 0 0.6em;
  font-size: 0.74em; /* ≈ 14px */
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #8a6a52;
}

.prism-publication nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.prism-publication nav li {
  margin: 0;
  line-height: 1.4;
}

.prism-publication nav a {
  display: block;
  padding: 0.42em 0; /* ≥ ~33px row at this size; mobile bump below */
  font-size: 0.88em; /* ≈ 16.6px */
  line-height: 1.4;
  color: #2f3136;
  text-decoration: none;
  border-radius: 4px;
}

/* Nested entries indent under their parent (style each depth). */
.prism-publication nav ul ul {
  margin: 0;
  padding-left: 1.1em;
  border-left: 1px solid #ece8e1;
}

.prism-publication nav ul ul a {
  font-size: 0.84em; /* ≈ 16px */
  color: #54575c;
}

.prism-publication nav ul ul ul {
  padding-left: 0.95em;
}

.prism-publication nav ul ul ul a {
  font-size: 0.82em;
  color: #6b6f76;
}

.prism-publication nav a:hover {
  color: #c2410c;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prism-publication nav a:focus-visible {
  outline: 2px solid #e8590c;
  outline-offset: 2px;
}

/* Floating-variant TOC degrades to a native <details> disclosure once its
 * fixed-position CSS is stripped — give it a sane inline card treatment. */
.prism-publication details {
  margin: 0 0 2.4em;
  padding: 0.7em 1.1em;
  border: 1px solid #e6e3dd;
  border-radius: 10px;
  background: #faf8f5;
}

.prism-publication summary {
  cursor: pointer;
  font-weight: 600;
  color: #2f3136;
}

/* ========================================================================== */
/*  TABLES                                                                     */
/* ========================================================================== */
/* HOST ARMOR — the camperchamp/roadgenius WP theme styles every table on a
 * page via `main.page table th/td` (grey th, centered cells, and
 * `border`/`padding` marked !important). The doubled `.prism-publication`
 * class out-specifies those (two classes beat one), and !important appears
 * below exactly where the theme uses it — drop either and the theme wins. */
.prism-publication.prism-publication table {
  width: 100%;
  margin: 1.7em 0;
  border-collapse: collapse;
  font-size: 0.92em; /* ≈ 17.5px */
  line-height: 1.5;
}

.prism-publication caption {
  margin-bottom: 0.6em;
  text-align: left;
  font-size: 0.85em;
  font-style: italic;
  color: #6b6f76;
}

/* No text-align here or on tbody th below: the base cell rule owns the `left`
 * default at (0,2,1) so the data-align attr rules can still out-cascade it.
 * Likewise the header wash/ink live on the THEAD element (cells stay
 * transparent, the wash shows through) so the (0,2,1) data-highlight tones
 * keep painting header cells over it — a doubled thead-th background would
 * bury them. */
.prism-publication.prism-publication thead {
  background: #f4f1ec;
  color: #15171a;
}

.prism-publication.prism-publication thead th {
  font-weight: 700;
  border-bottom: 2px solid #d9d4cb !important;
}

.prism-publication.prism-publication th,
.prism-publication.prism-publication td {
  padding: 0.62em 0.85em !important;
  border: 0 !important;
  border-bottom: 1px solid #ebe7e0 !important;
  text-align: left;
  background: transparent;
  vertical-align: top;
}

/* Manual footer rows export as a bare <td colspan> (classes are stripped);
 * the host theme centers [colspan] cells at (0,2,3), so re-assert at (0,3,1).
 * Superheader bands are <th> and keep their own centering rule below. */
.prism-publication.prism-publication td[colspan] {
  text-align: left;
  vertical-align: top;
}

/* D7 — first-column row headers (<th scope="row">) read as data cells, not a
 * second header column: kill the UA bold + center (and the host theme's). */
.prism-publication.prism-publication tbody th {
  font-weight: inherit;
}

/* Superheader bands export as a <th scope="colgroup"> row; center them like
 * the in-app band. */
.prism-publication thead th[scope='colgroup'] {
  text-align: center;
}

/* D8 — the table display contract (self-contain allowlists exactly these
 * data-attrs: data-striped / data-borders on <table>, data-align /
 * data-highlight on cells). Zebra follows the editor's Striped toggle instead
 * of being forced on. */
.prism-publication table[data-striped='true'] tbody tr:nth-child(even) {
  background: #faf8f5;
}

.prism-publication table[data-borders='grid'] th,
.prism-publication table[data-borders='grid'] td {
  border: 1px solid #ebe7e0 !important;
}

.prism-publication table[data-borders='minimal'] tbody th,
.prism-publication table[data-borders='minimal'] tbody td {
  border-bottom: none !important;
}

.prism-publication td[data-align='center'],
.prism-publication th[data-align='center'] {
  text-align: center;
}

.prism-publication td[data-align='right'],
.prism-publication th[data-align='right'] {
  text-align: right;
}

/* Highlight tones match the in-app tokens (globals.css). */
.prism-publication td[data-highlight='emphasis'],
.prism-publication th[data-highlight='emphasis'] {
  background: #fff8eb;
  color: #5a3203;
}

.prism-publication td[data-highlight='muted'],
.prism-publication th[data-highlight='muted'] {
  background: #f4f1ea;
  color: #8f8773;
}

.prism-publication tbody tr:hover {
  background: #f4efe8;
}

/* Narrow screens: allow a WIDE table to scroll horizontally only when it
 * actually overflows — text still wraps inside cells (no global nowrap). */
@media (max-width: 640px) {
  .prism-publication table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Headers may wrap to two lines on phones; that's fine and preferable to
   * forcing the whole table off-screen. */
}

/* ========================================================================== */
/*  FIGURES · IMAGES · CAPTIONS                                                */
/* ========================================================================== */
.prism-publication img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  border-radius: 6px;
}

.prism-publication figure {
  margin: 2.2em 0;
  text-align: center;
}

.prism-publication figcaption {
  margin-top: 0.7em;
  font-size: 0.82em; /* ≈ 15.6px */
  font-style: italic;
  line-height: 1.5;
  color: #6b6f76;
  text-align: center;
}

/* If a caption carries a source line as <cite> or <small>, keep it quieter. */
.prism-publication figcaption cite,
.prism-publication figcaption small,
.prism-publication small {
  font-size: 0.92em;
  font-style: normal;
  color: #8a8e95;
}

/* ========================================================================== */
/*  LINKS                                                                      */
/* ========================================================================== */
/* Body links use an accessible darker orange (AA on white); the bright brand
 * orange is reserved for accents/hover/rules. */
.prism-publication a {
  color: #c2410c;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(194, 65, 12, 0.45);
}

.prism-publication a:hover {
  color: #e8590c;
  text-decoration-color: currentColor;
}

.prism-publication a:focus-visible {
  outline: 2px solid #e8590c;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ========================================================================== */
/*  CHART DOWNLOAD CHIP — a[download]                                          */
/* ========================================================================== */
/* The chart "Download" link keeps its `download` attribute through the strip,
 * so it can be styled as a small pill button. */
.prism-publication a[download] {
  display: inline-block;
  margin-top: 0.6em;
  padding: 0.4em 0.95em;
  font-family: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial,
    sans-serif;
  font-size: 0.8em; /* ≈ 15px */
  font-weight: 500;
  line-height: 1.4;
  color: #4a4d52;
  background: #f4f1ec;
  border: 1px solid #ddd8cf;
  border-radius: 999px;
  text-decoration: none;
}

.prism-publication a[download]:hover {
  color: #ffffff;
  background: #e8590c;
  border-color: #e8590c;
}

.prism-publication a[download]:focus-visible {
  outline: 2px solid #e8590c;
  outline-offset: 2px;
}

/* ========================================================================== */
/*  FOOTNOTES / REFERENCES — <footer>                                          */
/* ========================================================================== */
.prism-publication footer {
  margin-top: 3em;
  padding-top: 1.3em;
  border-top: 1px solid #e2ddd4;
  font-size: 0.85em; /* ≈ 16px */
  line-height: 1.6;
  color: #54575c;
}

.prism-publication footer p {
  margin: 0 0 0.7em;
  font-size: 1em;
}

.prism-publication footer ol,
.prism-publication footer ul {
  margin: 0;
  padding-left: 1.4em;
}

.prism-publication footer li {
  margin: 0 0 0.5em;
}

.prism-publication footer a {
  color: #c2410c;
  word-break: break-word;
}

/* ========================================================================== */
/*  HORIZONTAL RULE                                                            */
/* ========================================================================== */
.prism-publication hr {
  margin: 2.4em 0;
  border: 0;
  border-top: 1px solid #e2ddd4;
}

/* ========================================================================== */
/*  CODE (defensive — articles occasionally carry inline code/snippets)        */
/* ========================================================================== */
.prism-publication code,
.prism-publication pre {
  font-family: ui-monospace, 'SF Mono', 'Roboto Mono', Menlo, Consolas, monospace;
  font-size: 0.88em;
}

.prism-publication code {
  padding: 0.12em 0.35em;
  background: #f4f1ec;
  border-radius: 4px;
}

.prism-publication pre {
  margin: 1.5em 0;
  padding: 1em 1.15em;
  overflow-x: auto;
  background: #f4f1ec;
  border-radius: 8px;
  line-height: 1.55;
}

.prism-publication pre code {
  padding: 0;
  background: none;
}

/* ========================================================================== */
/*  BRAND ACCENTS — RoadGenius (slug `--rg`)                                   */
/* ========================================================================== */
/* The live brand modifier is `--rg`. The `--roadgenius` alias is kept harmless
 * for any older export still carrying the long slug. The base rules above
 * already use the brand palette, so these mainly assert it under both slugs and
 * give the wrapper a faint editorial top accent. */
.prism-publication--rg,
.prism-publication--roadgenius {
  /* hook retained for future per-brand overrides */
}

.prism-publication--rg a,
.prism-publication--roadgenius a {
  color: #c2410c;
}

.prism-publication--rg a:hover,
.prism-publication--roadgenius a:hover {
  color: #e8590c;
}

.prism-publication--rg nav,
.prism-publication--roadgenius nav {
  border-left-color: #e8590c;
}

.prism-publication--rg a[download]:hover,
.prism-publication--roadgenius a[download]:hover {
  background: #e8590c;
  border-color: #e8590c;
}

/* ========================================================================== */
/*  MOBILE REFINEMENTS (≤ 375px)                                              */
/* ========================================================================== */
@media (max-width: 480px) {
  .prism-publication {
    font-size: 18px; /* slightly tighter base on small phones */
    padding-inline: 16px;
  }

  .prism-publication h2 {
    font-size: 1.45em; /* ≈ 26px */
  }

  .prism-publication h3 {
    font-size: 1.15em;
  }

  .prism-publication header + section > div > p:first-child {
    font-size: 1.06em;
  }

  /* Roomier tap rows for the TOC on touch (≥ ~44px effective). */
  .prism-publication nav a {
    padding: 0.55em 0;
  }
}

/* ========================================================================== */
/*  LINK SECTIONS — curated internal-link blocks                               */
/* ========================================================================== */
/* Link-section variants render as generic <ul>/<div>/<p>; the self-contain
 * strip keeps only their `data-link-section-*` markers (every other class/data-*
 * is removed), so the host styles them through those attributes. The app surface
 * (editor canvas + reader) is themed by Tailwind on the same elements; these
 * rules give the stripped WP export the equivalent slicker presentation. */

/* List — a tight, unbulleted stack of links. */
.prism-publication [data-link-section-list] {
  list-style: none;
  margin: 1.5em 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}
.prism-publication [data-link-section-list-entry] {
  margin: 0;
  padding: 0;
  line-height: 1.45;
}
.prism-publication [data-link-section-list-entry]::before {
  content: none; /* defeat any prose-list bullet styling */
}

/* Cards — a quiet bordered grid; thumbnail + title + excerpt. */
.prism-publication [data-link-section-cards] {
  display: grid;
  gap: 0.85em;
  margin: 1.8em 0;
}
@media (min-width: 480px) {
  .prism-publication [data-link-section-cards] {
    grid-template-columns: 1fr 1fr;
  }
}
.prism-publication [data-link-section-card] {
  display: flex;
  gap: 0.85em;
  padding: 0.95em 1.05em;
  border: 1px solid #e6e3dd;
  border-radius: 10px;
  background: #faf8f5;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.prism-publication a[data-link-section-card]:hover {
  border-color: #e8590c;
  background: #ffffff;
}
.prism-publication [data-link-section-card-thumbnail] {
  display: block;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 8px;
  background: #ece8e1;
}
.prism-publication [data-link-section-card-thumbnail] img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  object-fit: cover;
}
.prism-publication [data-link-section-card-title] {
  display: block;
  font-family: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial,
    sans-serif;
  font-weight: 600;
  line-height: 1.3;
  color: #1c1d20;
}
.prism-publication a[data-link-section-card]:hover [data-link-section-card-title] {
  color: #c2410c;
}
.prism-publication [data-link-section-card-excerpt] {
  display: block;
  margin-top: 0.3em;
  font-size: 0.85em;
  line-height: 1.45;
  color: #6b6f76;
}

/* Compact — wrapping pills. */
.prism-publication [data-link-section-compact] {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin: 1.5em 0;
}
.prism-publication [data-link-section-compact-pill] {
  display: inline-flex;
  align-items: center;
  padding: 0.3em 0.85em;
  font-family: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial,
    sans-serif;
  font-size: 0.85em;
  line-height: 1.3;
  color: #2f3136;
  background: #f4f1ec;
  border: 1px solid #ddd8cf;
  border-radius: 999px;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.prism-publication a[data-link-section-compact-pill]:hover {
  color: #c2410c;
  background: #ffffff;
  border-color: #e8590c;
}

/* Inline — a sentence of links separated by a faint middot. */
.prism-publication [data-link-section-inline] {
  margin: 1.3em 0;
  font-size: 0.95em;
  line-height: 1.6;
}
.prism-publication [data-link-section-inline-sep] {
  padding: 0 0.15em;
  color: #b8b2a8;
}

/* Anchor modes (MM.5) — main-only / addon-only / double / double-reverse:
 * the list scaffolding of the plain list, with the addon link quieter and a
 * faint middot between a double row's two links. */
.prism-publication [data-link-section-anchor-mode] {
  list-style: none;
  margin: 1.5em 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}
.prism-publication [data-link-section-anchor-mode-entry] {
  margin: 0;
  padding: 0;
  line-height: 1.45;
}
.prism-publication [data-link-section-anchor-mode-entry]::before {
  content: none; /* defeat any prose-list bullet styling */
}
.prism-publication a[data-link-section-secondary-link] {
  color: #6b6f76;
  text-decoration-color: #c9c4bb;
}
.prism-publication a[data-link-section-secondary-link]:hover {
  color: #c2410c;
}
.prism-publication [data-link-section-anchor-sep] {
  padding: 0 0.3em;
  color: #b8b2a8;
}

/* M30.5 — evidence-card table contract (attrs survive self-contain). */
.prism-publication td[data-highlight='positive'], .prism-publication th[data-highlight='positive'] { background-color: #e5f3ea; color: #0b6e3a; }
.prism-publication td[data-highlight='negative'], .prism-publication th[data-highlight='negative'] { background-color: #f9e7e7; color: #9f1d23; }
.prism-publication td[data-highlight='warning'], .prism-publication th[data-highlight='warning'] { background-color: #fff4dc; color: #7a4d00; }
.prism-publication table[data-header-style='brand'] thead th { background-color: #1f2933; color: #ffffff; }
.prism-publication tr[data-row-accent='subject'] td:not([data-highlight]), .prism-publication tr[data-row-accent='subject'] th:not([data-highlight]) { background-color: #fff8eb; } .prism-publication tr[data-row-accent='subject'] td, .prism-publication tr[data-row-accent='subject'] th { font-weight: 600; }
.prism-publication tr[data-row-accent='latest'] td:not([data-highlight]), .prism-publication tr[data-row-accent='latest'] th:not([data-highlight]) { background-color: #eef4fb; }
/* !important: must out-rank the base cells' `border: 0 !important` armor. */
.prism-publication tr[data-aggregations-row] td { border-top: 2px solid #d5d0c4 !important; background-color: #f7f5f0; font-weight: 600; }
.prism-publication span[data-badge] { display: inline-block; padding: 1px 8px; border-radius: 100px; font-size: 0.85em; font-weight: 600; background-color: #eceae4; }
.prism-publication span[data-badge='positive'] { background-color: #e5f3ea; color: #0b6e3a; }
.prism-publication span[data-badge='negative'] { background-color: #f9e7e7; color: #9f1d23; }
.prism-publication span[data-badge='warning'] { background-color: #fff4dc; color: #7a4d00; }
.prism-publication span[data-badge='emphasis'] { background-color: #fff8eb; color: #5a3203; }
.prism-publication span[data-badge='muted'] { background-color: #f4f1ea; color: #8f8773; }
.prism-publication span[data-cell-marker] { color: #0b6e3a; }
.prism-publication span[data-cell-sub] { display: block; font-size: 0.82em; color: #6d6a61; }
.prism-publication caption[data-table-caption] { font-weight: 600; text-align: left; margin-bottom: 8px; caption-side: top; }
.prism-publication p[data-table-marker-legend] { font-size: 12px; color: #6d6a61; margin: 6px 0 0; }
.prism-publication p[data-table-source] { font-size: 12px; color: #8a8578; margin: 8px 0 0; }
.prism-publication table td, .prism-publication table th { font-variant-numeric: tabular-nums; }

/* ═══════════════════════════════════════════════════════════════════════════
 * STATISTICS TEMPLATE LAYER (2026-07) — editorial redesign for statistics
 * pages. DOUBLE-GATED: the `--statistics` wrapper modifier (template kind,
 * emitted by the exporter) AND the `.prism-statistics-page` body class, which
 * the mu-plugin adds ONLY on CC/RG statistics pages — so the artifact itself
 * enforces the brand scope: a checkrate/buildstreet host that installs this
 * bundle stays untouched (their statistics pages get no body class).
 * Brand accents: RG defaults, `.prism-brand-cc` body class overrides.
 * Spec: prism-docs mockups/statistics-template/index.html (known deviations:
 * table headers are full-size ink, not the mockup's 12px uppercase eyebrow —
 * owner call 2026-07; TOC items 16px/15px). Fonts arrive via the mu-plugin
 * 'prism-publication-fonts' enqueue; stacks below degrade to Georgia /
 * system sans.
 * PARITY: every value in this layer is mirrored 1:1 in
 * src/app/(render)/editorial-statistics.css — change BOTH in the same commit
 * (guarded by publishers/wordpress/__tests__/statistics-css-parity.test.ts).
 * ═════════════════════════════════════════════════════════════════════════ */

.prism-statistics-page .prism-publication--statistics {
  /* neutral tokens (both brands — neutrals do the trust work) */
  --stat-ink: #1b2129;
  --stat-muted: #5a6472;
  --stat-hairline: #dce1e7;
  --stat-wash: #f4f6f8;
  --stat-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --stat-sans: 'Source Sans 3', -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* accent lane defaults (RG); CC overrides below */
  --stat-accent-text: #c2500f;
  --stat-accent-rail: #e8631c;
  --stat-brand-ink: #16324f;
  font-family: var(--stat-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--stat-ink);
}
.prism-brand-cc .prism-publication--statistics {
  --stat-accent-text: #5b4bc4;
  --stat-accent-rail: #6c5ce7;
  --stat-brand-ink: #2e2960;
}

/* craft layer */
.prism-statistics-page .prism-publication--statistics h1,
.prism-statistics-page .prism-publication--statistics h2,
.prism-statistics-page .prism-publication--statistics h3 { text-wrap: balance; }
.prism-statistics-page .prism-publication--statistics p,
.prism-statistics-page .prism-publication--statistics li { text-wrap: pretty; }
.prism-statistics-page .prism-publication--statistics ::selection { background: rgba(232, 99, 28, 0.2); }
.prism-brand-cc .prism-publication--statistics ::selection { background: rgba(108, 92, 231, 0.2); }
.prism-statistics-page .prism-publication--statistics a:focus-visible { outline: 2px solid var(--stat-accent-rail); outline-offset: 2px; }

/* one serif voice: the title is the THEME's <h1 class="entry-title">, outside
 * the wrapper — reached via the mu-plugin's body classes (statistics + brand) */
.prism-statistics-page h1.entry-title {
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  font-weight: 700; line-height: 1.15; letter-spacing: -0.01em;
  text-wrap: balance;
}
.prism-statistics-page.prism-brand-rg h1.entry-title { color: #16324f; }
.prism-statistics-page.prism-brand-cc h1.entry-title { color: #2e2960; }
.prism-statistics-page .prism-publication--statistics h2 {
  font-family: var(--stat-serif); font-weight: 600; font-size: 29px;
  line-height: 1.25; letter-spacing: -0.005em; color: var(--stat-ink);
  margin: 56px 0 0;
}
.prism-statistics-page .prism-publication--statistics h3 { font-family: var(--stat-serif); font-weight: 600; color: var(--stat-ink); }

/* the answer line — question and answer share the serif voice; the rail means
 * exactly one thing on these pages: "this sentence is the answer" */
.prism-statistics-page .prism-publication--statistics p[data-stat-answer] {
  margin: 18px 0 0; padding-left: 18px;
  border-left: 3px solid var(--stat-accent-rail);
  font-family: var(--stat-serif); font-size: 21px; line-height: 1.5;
}
.prism-statistics-page .prism-publication--statistics p[data-stat-answer] strong { font-weight: 700; }

/* the rail means ONE thing on these pages: quotes go back to a quiet hairline */
.prism-statistics-page .prism-publication--statistics blockquote {
  border-left-color: var(--stat-hairline);
}

/* body voice */
.prism-statistics-page .prism-publication--statistics p { margin: 16px 0 0; }
.prism-statistics-page .prism-publication--statistics ul { margin: 16px 0 0; padding-left: 22px; }
.prism-statistics-page .prism-publication--statistics li { margin: 9px 0 0; padding-left: 4px; }
.prism-statistics-page .prism-publication--statistics li::marker { color: var(--stat-muted); }
.prism-statistics-page .prism-publication--statistics a { color: var(--stat-accent-text); text-decoration-color: var(--stat-hairline); text-underline-offset: 3px; }
.prism-statistics-page .prism-publication--statistics a:hover { text-decoration-color: var(--stat-accent-text); }
.prism-statistics-page .prism-publication--statistics sup a { font-weight: 600; font-size: 12px; }

/* TOC: ruled block between two hairlines — the wash box + accent rail of the
 * base layer retire on statistics pages (the rail belongs to answers) */
.prism-statistics-page .prism-publication--statistics nav {
  background: none; border: 0;
  border-top: 1px solid var(--stat-hairline);
  border-bottom: 1px solid var(--stat-hairline);
  border-radius: 0; padding: 18px 0 20px; margin-top: 36px;
}
.prism-statistics-page .prism-publication--statistics nav h2 {
  font-family: var(--stat-sans); font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--stat-muted);
  margin: 0;
}
.prism-statistics-page .prism-publication--statistics nav ul { columns: 2; column-gap: 32px; margin: 12px 0 0; padding: 0; list-style: none; }
.prism-statistics-page .prism-publication--statistics nav li { break-inside: avoid; padding: 5px 0; margin: 0; font-size: 16px; line-height: 1.4; }
.prism-statistics-page .prism-publication--statistics nav ul ul { columns: 1; margin: 0; padding-left: 16px; }
.prism-statistics-page .prism-publication--statistics nav ul ul li { font-size: 15px; color: var(--stat-muted); padding: 3px 0 0; }
/* anchor sizes must be EXPLICIT: the base layer sizes nav anchors in em
 * (0.88em / 0.84em), which silently shrank these items to ~13.6px / ~11.8px
 * when only the li carried the statistics size */
.prism-statistics-page .prism-publication--statistics nav a { color: var(--stat-ink); text-decoration: none; font-size: 16px; }
.prism-statistics-page .prism-publication--statistics nav ul ul a { color: var(--stat-muted); font-size: 15px; }
.prism-statistics-page .prism-publication--statistics nav a:hover { color: var(--stat-accent-text); }
@media (max-width: 640px) {
  .prism-statistics-page .prism-publication--statistics nav ul { columns: 1; }
}

/* figures: quiet captions with a hairline top rule (the source-line look) */
.prism-statistics-page .prism-publication--statistics figure { margin: 36px 0; }
.prism-statistics-page .prism-publication--statistics figcaption {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--stat-hairline);
  font-size: 13.5px; font-style: normal; color: var(--stat-muted); text-align: left;
}

/* tables: data-forward — full-size ink headers on the wash (owner call
 * 2026-07: the mockup's 12px uppercase-muted header read washed-out on real
 * tables), semibold row-header labels anchoring each row, cool zebra + hover
 * in the wash tone family. 600 not 500 for row headers: the enqueued Source
 * Sans 3 faces are 400/600/700, so 500 would silently fall back to 400.
 * ORDER-DEPENDENT: these tie the armored base table rules at (0,2,x) and win
 * only by coming LATER in this file — keep the statistics layer below TABLES. */
.prism-statistics-page .prism-publication--statistics table { font-size: 15.5px; }
.prism-statistics-page .prism-publication--statistics thead th {
  font-family: var(--stat-sans); font-weight: 600; color: var(--stat-ink);
  background: var(--stat-wash); border-bottom: 1px solid var(--stat-hairline) !important;
  padding: 9px 14px !important;
}
.prism-statistics-page .prism-publication--statistics td, .prism-statistics-page .prism-publication--statistics th { padding: 10px 14px !important; border-color: var(--stat-hairline) !important; }
.prism-statistics-page .prism-publication--statistics tbody th { color: var(--stat-ink); font-weight: 600; }
.prism-statistics-page .prism-publication--statistics table[data-striped='true'] tbody tr:nth-child(even) { background: color-mix(in srgb, var(--stat-wash) 55%, transparent); }
.prism-statistics-page .prism-publication--statistics tbody tr:hover { background: color-mix(in srgb, var(--stat-wash) 55%, transparent); }

/* Sources — one continuous list; NATIVE markers are the numbers (aria-label
 * survives the export strip, so it is the stable hook) */
.prism-statistics-page .prism-publication--statistics section[aria-label='Sources'] {
  margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--stat-hairline);
}
.prism-statistics-page .prism-publication--statistics section[aria-label='Sources'] h2 {
  font-size: 24px; margin: 0; text-transform: none; letter-spacing: -0.005em;
}
.prism-statistics-page .prism-publication--statistics section[aria-label='Sources'] ol {
  margin: 18px 0 0; padding-left: 40px; list-style: decimal;
  font-variant-numeric: tabular-nums;
}
.prism-statistics-page .prism-publication--statistics section[aria-label='Sources'] li {
  padding: 7px 0 7px 4px; margin: 0; font-size: 15.5px; line-height: 1.5;
  scroll-margin-top: 24px;
}
.prism-statistics-page .prism-publication--statistics section[aria-label='Sources'] li::marker {
  font-family: var(--stat-sans); font-size: 14px; font-weight: 600;
  color: var(--stat-accent-text);
}
.prism-statistics-page .prism-publication--statistics section[aria-label='Sources'] li > a:first-child {
  color: var(--stat-ink); font-weight: 500; text-decoration: underline;
  text-decoration-color: var(--stat-hairline); text-underline-offset: 3px;
}
.prism-statistics-page .prism-publication--statistics section[aria-label='Sources'] li > a:first-child:hover {
  color: var(--stat-accent-text); text-decoration-color: var(--stat-accent-text);
}
.prism-statistics-page .prism-publication--statistics section[aria-label='Sources'] li span { color: var(--stat-muted); }
.prism-statistics-page .prism-publication--statistics section[aria-label='Sources'] li a[href^='#'] {
  font-size: 13px; color: var(--stat-muted); white-space: nowrap; text-decoration: none;
}
.prism-statistics-page .prism-publication--statistics section[aria-label='Sources'] li a[href^='#']:hover { color: var(--stat-accent-text); }
/* following a citation gently lights the landed entry */
.prism-statistics-page .prism-publication--statistics section[aria-label='Sources'] li:target {
  background: rgba(232, 99, 28, 0.09); border-radius: 4px;
}
.prism-brand-cc .prism-publication--statistics section[aria-label='Sources'] li:target {
  background: rgba(108, 92, 231, 0.09);
}

/* print: journalists PDF these pages */
@media print {
  .prism-statistics-page .prism-publication--statistics a { color: inherit; }
  .prism-statistics-page .prism-publication--statistics section[aria-label='Sources'] a[href^='#'] { display: none; }
  .prism-statistics-page .prism-publication--statistics section[aria-label='Sources'] a[href^='http']::after {
    content: ' (' attr(href) ')'; font-size: 90%; color: #555;
  }
}
