/* -----------------------------------------------------------------------------
   Self-hosted faces. Both families are named in --font-serif/--font-sans below;
   without these @font-face rules the page silently falls back to Georgia and
   system-ui. Paths are relative so FREEZER_RELATIVE_URLS keeps working when the
   frozen site is served from a subdirectory.

   Charter is free; Lato is OFL. Concourse (what sturdy-static uses for sans) is
   MB Type commercial and can't ship on a public URL — Lato stands in for it.
   sturdy-static also pairs each face with a unicode-range subset; skipped here,
   the ~150 KB it saves is noise next to a 4.5 MB index.html.
------------------------------------------------------------------------------- */

@font-face { font-family:"Bitstream Charter"; font-style:normal; font-weight:400; font-display:swap;
  src:url("fonts/charter/charter_regular-v01.woff2") format("woff2"); }
@font-face { font-family:"Bitstream Charter"; font-style:normal; font-weight:700; font-display:swap;
  src:url("fonts/charter/charter_bold-v01.woff2") format("woff2"); }
@font-face { font-family:"Bitstream Charter"; font-style:italic; font-weight:400; font-display:swap;
  src:url("fonts/charter/charter_italic-v01.woff2") format("woff2"); }
@font-face { font-family:"Bitstream Charter"; font-style:italic; font-weight:700; font-display:swap;
  src:url("fonts/charter/charter_bold_italic-v01.woff2") format("woff2"); }

/* only the weights this stylesheet asks for: 300/400/600/800 */
@font-face { font-family:"Lato Latin"; font-style:normal; font-weight:300; font-display:swap;
  src:url("fonts/lato-latin/LatoLatin-Light.woff2") format("woff2"); }
@font-face { font-family:"Lato Latin"; font-style:normal; font-weight:400; font-display:swap;
  src:url("fonts/lato-latin/LatoLatin-Regular.woff2") format("woff2"); }
@font-face { font-family:"Lato Latin"; font-style:normal; font-weight:600; font-display:swap;
  src:url("fonts/lato-latin/LatoLatin-Semibold.woff2") format("woff2"); }
@font-face { font-family:"Lato Latin"; font-style:normal; font-weight:800; font-display:swap;
  src:url("fonts/lato-latin/LatoLatin-Black.woff2") format("woff2"); }

:root {
  --font-serif: "Bitstream Charter", Georgia, "Times New Roman", Times, serif;
  --font-sans:  "Lato Latin", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:  ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --font-weight-light: 300; --font-weight-regular: 400; --font-weight-medium: 500;
  --font-weight-heavy: 600; --font-weight-bold: 700; --font-weight-black: 800;

  --all-caps-space: .08em; --all-caps-word-space: .12em;
  --line-height-serif: 1.55; --line-height-sans: 1.35;

  --font-size-huge: 28pt; --font-size-large: 15pt; --font-size-normal: 13pt;
  --font-size-small: 11.5pt; --font-size-smaller: 10pt; --font-size-tiny: 9pt;

  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem;
  --space-4: 1rem; --space-5: 1.5rem; --space-6: 2rem; --space-7: 3rem; --space-8: 4rem;

  /* --maxw is the whole report's measure. Nothing inside re-clamps, so the
     excerpt text lands at ~85ch by nesting alone. Tune the page here. */
  --maxw: 56rem; --readw: 68ch;
  --border-radius: 10px; --border-radius-large: 14px;
  --hover-transition: .2s ease-in-out;

  --bg: #fdfbf7;
  --surface: #f8efde;
  --light-surface: #faf4e8;
  --text: #29353d;
  --muted-text: #6d899c;
  --border: #f4e6cd;
  --border-strong: #edd6ab;
  --neutral-border: #b6c4cd;

  --accent: #2e604b;
  --accent-hover: #214535;
  --accent-contrast: #fff;
  --highlight: #5aaf8a;
  --link: #285340;

  --pos: #148f6a; --neu: #64748b; --warn: #b26e2d; --neg: #b5382f;

  --shadow-0: 0 1px 2px rgba(0,0,0,.06);
  --shadow-1: 4px 8px 24px rgba(0,0,0,.10);
  --shadow-2: 8px 16px 32px rgba(0,0,0,.12);

  color-scheme: light;
}

/* -----------------------------------------------------------------------------
   Dark theme. Colors only — every rule below reads through these variables, so
   nothing else needs a dark branch. The .sentence highlight is a color-mix
   against --bg and re-derives itself for free.
------------------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181b;
    --surface: #1c2226;
    --light-surface: #232b30;
    --text: #dfe6e9;
    --muted-text: #93a7b3;
    --border: #2a3339;
    --border-strong: #3a464d;
    --neutral-border: #46545c;

    --accent: #6fbf98;
    --accent-hover: #8fd3b0;
    --accent-contrast: #10201a;
    --highlight: #5aaf8a;
    --link: #86cfab;

    /* lifted off the light values, which go muddy against a dark ground */
    --pos: #3fbf8f; --neu: #94a3b8; --warn: #d99a4e; --neg: #e0655a;

    --shadow-0: 0 1px 2px rgba(0,0,0,.5);
    --shadow-1: 4px 8px 24px rgba(0,0,0,.45);
    --shadow-2: 8px 16px 32px rgba(0,0,0,.55);

    color-scheme: dark;
  }

  /* subpixel rendering fattens light-on-dark text; Charter needs the grayscale path */
  body { -webkit-font-smoothing: antialiased; }
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-serif);
  font-size: var(--font-size-normal); line-height: var(--line-height-serif);
  text-rendering: optimizeLegibility; -webkit-font-smoothing: subpixel-antialiased;
}
a { color: var(--link); }

.spaced-all-caps {
  text-transform: uppercase; letter-spacing: var(--all-caps-space);
  word-spacing: var(--all-caps-word-space); font-weight: var(--font-weight-bold);
}

.report { max-width: var(--maxw); margin: 0 auto; padding: var(--space-6) var(--space-5); }
.topics { display: flex; flex-direction: column; gap: var(--space-4); }

.card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--border-radius-large); box-shadow: var(--shadow-1);
  padding: var(--space-5);
}

/* Title block is centered — kicker, question, dateline — but the prose below it
   is not: the paragraph and the takeaway center as *blocks* and set flush left
   inside, so nothing longer than a line has to be read off a ragged center. */
.report__header { margin-bottom: var(--space-6); text-align: center; }
.report__kicker { font-size: var(--font-size-tiny); color: var(--muted-text); margin-bottom: var(--space-2); }
.report__title { font-family: var(--font-sans); font-weight: var(--font-weight-light); font-size: var(--font-size-huge); margin: 0 0 var(--space-3); }
.report__subtitle {
  max-width: var(--readw); margin: 0 auto var(--space-5);
  font-family: var(--font-sans); font-size: var(--font-size-smaller);
  letter-spacing: var(--all-caps-space); text-transform: uppercase;
  color: var(--muted-text);
}

.topic-card { padding: 0; overflow: hidden; border-left: 4px solid var(--accent); }

.topic-card__summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  cursor: pointer; list-style: none; user-select: none;
  transition: background var(--hover-transition);
}
.topic-card__summary::-webkit-details-marker { display: none; }
.topic-card__summary:hover { background: var(--light-surface); }
.topic-card__summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.topic-card__heading { display: flex; flex-direction: column; gap: var(--space-1); }
.topic-card__label { font-family: var(--font-sans); font-weight: var(--font-weight-heavy); font-size: var(--font-size-large); margin: 0; }

.topic-card__count { margin-left: auto; display: flex; align-items: baseline; gap: var(--space-2); font-family: var(--font-sans); }
.topic-card__count-value { font-weight: var(--font-weight-black); font-size: var(--font-size-large); color: var(--accent); }
.topic-card__count-label { font-size: var(--font-size-tiny); color: var(--muted-text); }

.topic-card__toggle {
  flex: none; width: 0; height: 0;
  border-left: 7px solid var(--muted-text);
  border-top: 5px solid transparent; border-bottom: 5px solid transparent;
  transition: transform var(--hover-transition); transform: translateY(2px);
}
.topic-card[open] .topic-card__toggle { transform: rotate(90deg) translateX(2px); }

.topic-card__body {
  padding: var(--space-4) var(--space-5) var(--space-5);
  border-top: 1.5px solid var(--border);
}

.excerpts__title { font-size: var(--font-size-tiny); color: var(--muted-text); margin: 0 0 var(--space-3); }
.excerpts__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }

/* No max-width anywhere in here on purpose: --maxw on .report is the single knob
   that sets the measure, and every box nests inside it. Clamping the excerpt or
   its text as well would leave a bordered edge floating away from the prose. */
.excerpt {
  padding: var(--space-4) var(--space-5); border-radius: var(--border-radius);
  background: var(--bg); border: 1.5px solid var(--border);
  font-size: var(--font-size-normal);
}
/* Excerpts are the reading surface, so they get full body size — the Lato/Charter
   family contrast against the card chrome carries the hierarchy instead. */
.excerpt__text { max-width: none; }
.excerpt__text p { margin: 0; text-indent: 0; }
.excerpt__text p + p { margin-top: var(--space-3); }
.excerpt__meta {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2); border-bottom: 1px solid var(--border);
}
/* The subject is the excerpt's headline — it's what makes a wall of quoted
   comments skimmable, so it gets weight and --text rather than --muted-text. */
.excerpt__subject {
  font-family: var(--font-sans); font-weight: var(--font-weight-heavy);
  font-size: var(--font-size-large); line-height: 1.25;
  color: var(--text); margin: 0 0 var(--space-1);
}
.excerpt__sub {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-3);
  font-family: var(--font-sans); font-size: var(--font-size-smaller);
  color: var(--muted-text);
}
.excerpt__link {
  margin-left: auto; color: var(--link); text-decoration: none;
  font-weight: var(--font-weight-medium);
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 1px var(--space-3); background: var(--light-surface);
  transition: background var(--hover-transition), color var(--hover-transition);
}
.excerpt__link:hover { color: var(--accent-contrast); background: var(--accent); border-color: var(--accent); }
.excerpt__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* An excerpt list runs long enough that the topic's header scrolls away; this
   is the way back to it without hunting for the scrollbar. A plain in-page
   #topic-N link, so it works with no JS and is middle-clickable; smooth is a
   scroll-behavior on <html>, not a scrollIntoView call. Sits after the page
   link, so both sit flush right whether or not the link is there. */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.excerpt__up {
  margin-left: auto; text-decoration: none;
  font-family: var(--font-sans); font-size: var(--font-size-smaller);
  line-height: 1; color: var(--muted-text);
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 2px var(--space-2); background: var(--light-surface);
  transition: background var(--hover-transition), color var(--hover-transition);
}
.excerpt__link + .excerpt__up { margin-left: 0; }
.excerpt__up:hover { color: var(--accent-contrast); background: var(--accent); border-color: var(--accent); }
.excerpt__up:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.gap { margin: var(--space-3) 0; }
.gap__toggle {
  cursor: pointer; list-style: none; display: inline-block;
  font-family: var(--font-sans); font-size: var(--font-size-tiny);
  color: var(--muted-text); background: var(--light-surface);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 1px var(--space-2);
}
.gap__toggle::-webkit-details-marker { display: none; }
.gap__toggle:hover { color: var(--link); border-color: var(--border-strong); }
.gap[open] .gap__toggle { margin-bottom: var(--space-3); }
.gap p { margin: 0 0 var(--space-3); color: var(--muted-text); }
.gap p:last-child { margin-bottom: 0; }

.more { margin-top: var(--space-3); }
.more__toggle {
  cursor: pointer; list-style: none; display: inline-block;
  font-family: var(--font-sans); font-size: var(--font-size-smaller);
  color: var(--link); border-bottom: 1px dotted var(--link);
}
.more__toggle::-webkit-details-marker { display: none; }
.more__toggle:hover { color: var(--accent-hover); }
.more[open] .more__toggle { margin-bottom: var(--space-3); }
.more[open] .more__toggle::after { content: " (hide)"; color: var(--muted-text); }

.sentence[data-matched="true"] {
  background: color-mix(in srgb, var(--warn) 18%, var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--warn) 30%, transparent);
  border-radius: 3px; padding: 0 2px;
}

/* -----------------------------------------------------------------------------
   Stance (metric_field). Two poles plus a neutral, used by the bar on each
   topic card and by the sunburst's inner ring (mirrored in config.metric.colors).
------------------------------------------------------------------------------- */

:root {
  --stance-1: #a8443c;   /* open to cars */
  --stance-0: #3f6f9f;   /* keep car-free */
  --stance--1: var(--neutral-border);
}

@media (prefers-color-scheme: dark) {
  :root { --stance-1: #d2726a; --stance-0: #6f9fc9; }
}

/* Its own row at the foot of the summary, so the split is readable on a closed
   card — the point is not having to open the topic to see it. */
.stance__bar {
  flex: 0 0 100%; display: flex; height: 6px; border-radius: 3px;
  overflow: hidden; background: var(--border);
}
.stance__fill[data-stance="1"]  { background: var(--stance-1); }
.stance__fill[data-stance="0"]  { background: var(--stance-0); }
.stance__fill[data-stance="-1"] { background: var(--stance--1); }

.stance { margin-bottom: var(--space-5); }

/* Segmented control: exactly one selection, "All" being the unfiltered state. */
.stance__seg {
  display: inline-flex; border: 1px solid var(--border-strong);
  border-radius: 999px; padding: 2px; background: var(--bg);
}
.stance__opt {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-sans); font-size: var(--font-size-tiny);
  color: var(--muted-text); background: none; border: 0; border-radius: 999px;
  padding: var(--space-1) var(--space-3); cursor: pointer; white-space: nowrap;
  transition: background var(--hover-transition), color var(--hover-transition);
}
.stance__opt:hover { color: var(--text); }
.stance__opt[aria-checked="true"] {
  background: var(--light-surface); color: var(--text); box-shadow: var(--shadow-0);
}
.stance__n { font-weight: var(--font-weight-black); color: inherit; }

.stance__swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.stance__swatch[data-stance="1"]  { background: var(--stance-1); }
.stance__swatch[data-stance="0"]  { background: var(--stance-0); }
.stance__swatch[data-stance="-1"] { background: var(--stance--1); }

.excerpt[hidden], .more[hidden] { display: none; }

.overview { margin: var(--space-5) 0 0; padding: 0; }
.overview__chart { width: 100%; min-height: 460px; }
/* A figure note, not a label: it has to carry the reading of the chart on its
   own, so it gets the serif measure and real leading rather than caption-sized
   sans. The lede is the hearing's question; the stance words are keyed to the
   same colors as the inner ring.

   It sits ABOVE the chart (source order in report.html) — with the question now
   the page's <h1>, this paragraph reads as the header's lede and the figure
   follows it, so it's flush left with the title rather than centered on the
   chart's axis. */
.overview__caption {
  max-width: var(--readw); margin: 0 auto var(--space-5);
  text-align: left; text-wrap: pretty;
  font-family: var(--font-serif); font-size: var(--font-size-small);
  line-height: var(--line-height-serif); color: var(--muted-text);
}
.overview__key { font-weight: var(--font-weight-bold); }
.overview__key[data-stance="1"]  { color: var(--stance-1); }
.overview__key[data-stance="0"]  { color: var(--stance-0); }
.overview__key[data-stance="-1"] { color: var(--stance--1); }
/* The invitation, not a footnote — it's the one line that tells a reader the
   chart is a thing to touch. Borrowed from p.takeaway in the Sturdy Stats blog
   (static/css/writeup.css): 120% size, tinted panel, accent rule down the left,
   narrow measure, centered in its own air. Tokens here, hardcoded colors there. */
.overview__explore {
  display: block; max-width: 34rem; margin: var(--space-5) auto 0;
  padding: var(--space-4); background: var(--light-surface);
  border-left: 5px solid var(--accent); border-radius: var(--border-radius);
  font-family: var(--font-serif); font-size: 120%;
  line-height: var(--line-height-serif); color: var(--text);
}
/* Prose links, lifted from sturdy-static's css/links.css: a highlight that
   wipes in left-to-right on hover instead of an underline. Same gradient trick
   and the same --link token, so this report reads as part of that family. The
   pill-shaped links (.excerpt__link, .excerpt__up) keep their own treatment. */
.overview__explore a, .report__subtitle a {
  position: relative; color: var(--link); text-decoration: none;
  border-radius: var(--space-1); padding: 0 .12em;
  transition: var(--hover-transition);
  background-image: linear-gradient(transparent 60%, color-mix(in srgb, var(--link) 25%, transparent) 0);
  background-size: 0% 100%; background-repeat: no-repeat;
}
.overview__explore a:hover, .overview__explore a:focus-visible,
.report__subtitle a:hover, .report__subtitle a:focus-visible {
  background-size: 100% 100%; outline: 0;
}
.overview__explore a:focus-visible, .report__subtitle a:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--link) 35%, transparent);
}

/* The card a sunburst wedge sent you to, so the jump has a visible landing. */
.topic-card.is-target { box-shadow: 0 0 0 2px var(--border-strong); }

/* Per-comment stance: a filled pill, plus the same color on the excerpt's edge.
   The pill names the stance so color is never the only channel. */
.pill {
  display: inline-flex; align-items: center;
  padding: 1px var(--space-3) 2px; border-radius: 999px;
  font-family: var(--font-sans); font-size: var(--font-size-tiny);
  font-weight: var(--font-weight-heavy); letter-spacing: .01em;
  color: #fff; white-space: nowrap;
}
.pill[data-stance="1"]  { background: var(--stance-1); }
.pill[data-stance="0"]  { background: var(--stance-0); }
.pill[data-stance="-1"] { background: var(--stance--1); }
.excerpt[data-stance="1"]  { border-left: 3px solid var(--stance-1); }
.excerpt[data-stance="0"]  { border-left: 3px solid var(--stance-0); }
.excerpt[data-stance="-1"] { border-left: 3px solid var(--stance--1); }
