/* The public site (spec §6): system fonts, a readable measure, dark mode. The episode page is the product. */
:root {
  --bg: #fcfbf8; --fg: #1c1b19; --muted: #6a655d; --line: #e6e1d7; --panel: #f3efe6;
  --accent: #9b2c3f; --accent-fg: #fff; --mark: #fbecc4;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: ui-serif, "Iowan Old Style", Charter, "Palatino Linotype", Georgia, serif;
  --measure: 40rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141312; --fg: #ece7df; --muted: #a29b90; --line: #2f2c28; --panel: #1f1d1a;
          --accent: #f08da0; --accent-fg: #141312; --mark: #4a3b14; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 18px/1.6 var(--serif); }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4, h5, p, li { text-wrap: pretty; }
h1, h2, h3, h4, h5, .masthead, .when, .subscribe, .sources, .at, .ref, civicfm-player, .colophon, .chapters, .who, small {
  font-family: var(--sans); }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); line-height: 1.15; letter-spacing: -0.01em; margin: 0.25rem 0 0.75rem; }
h2 { font-size: 1.25rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 2rem 0 0.25rem; }
h4 { font-size: 1rem; margin: 1.5rem 0 0.25rem; }
small, .quiet { color: var(--muted); }

/* The network: its bar across the top of every page, and its wordmark (§6) */
.network-bar { background: var(--panel); border-bottom: 1px solid var(--line); font: 500 0.9rem var(--sans); }
.network-bar div { display: flex; justify-content: space-between; align-items: center; min-height: 3rem;
                   max-width: calc(var(--measure) + 2.5rem); margin: 0 auto; padding: 0.5rem 1.25rem; }
.network-bar a { color: var(--muted); text-decoration: none; }
.network-bar a:hover { color: var(--fg); }
.network-bar a.wordmark { color: var(--fg); font-size: 1.15rem; }
.network-bar nav { display: flex; gap: 1rem; }
.wordmark { font-family: var(--sans); font-weight: 800; letter-spacing: -0.02em; }
.wordmark b { color: var(--accent); font-weight: inherit; }
.listen { font: 600 0.95rem var(--sans); margin-top: 0.4rem !important; }
.listen a { text-decoration: none; }

.masthead { display: flex; justify-content: space-between; align-items: center; gap: 1rem;
            max-width: calc(var(--measure) + 2.5rem); margin: 0 auto; padding: 1rem 1.25rem; font-size: 0.95rem; }
.masthead .show { display: flex; align-items: center; gap: 0.6rem; font-weight: 650; color: var(--fg); text-decoration: none; }
.masthead img { border-radius: 0.4rem; }
.masthead nav { display: flex; gap: 1.25rem; margin-left: auto; }
.masthead nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.masthead nav a:hover, .masthead .show:hover { color: var(--accent); }
main { max-width: calc(var(--measure) + 2.5rem); margin: 0 auto; padding: 0 1.25rem 4rem; }
.colophon { color: var(--muted); font-size: 0.85rem;
            max-width: calc(var(--measure) + 2.5rem); margin: 0 auto; padding: 0 1.25rem 3rem; }
.colophon p { border-top: 1px solid var(--line); margin: 0; padding-top: 1rem; }
.colophon a { color: inherit; }

/* Home */
.intro { padding: 2rem 0 1rem; }
.intro .title { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1rem; }
.intro .title img, .show-card img { flex: none; border-radius: 0.6rem; box-shadow: 0 1px 3px rgb(0 0 0 / 0.15); }
.intro .title h1 { margin-top: 0; }
.show-card { display: flex; align-items: flex-start; gap: 1rem; }
.show-card img { display: block; margin-top: 0.25rem; }
.show-card > div { min-width: 0; }
.tagline { font-family: var(--sans); font-weight: 600; color: var(--accent); margin: 0; }
.lede { font-size: 1.15rem; }
.subscribe { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.subscribe a { display: inline-block; padding: 0.35rem 0.9rem; border-radius: 2rem; border: 1px solid var(--accent);
               text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: background 0.15s, color 0.15s; }
.subscribe a:hover { background: var(--accent); color: var(--accent-fg); }
.subscribe small { margin-left: 0.25rem; }
.card { border-top: 1px solid var(--line); padding: 1rem 0; }
.card :is(h3, h4, h5) { margin: 0.1rem 0 0.4rem; font-size: 1.25rem; }
.card :is(h3, h4, h5) a { color: var(--fg); text-decoration: none; }
.card :is(h3, h4, h5) a:hover { color: var(--accent); }
.card p { margin: 0; }
.more { border-top: 1px solid var(--line); padding-top: 1rem; font-weight: 600; }
.when { color: var(--muted); font-size: 0.85rem; margin: 0; text-transform: uppercase; letter-spacing: 0.04em; }
/* The network's index, by region and metro area (§6) */
.region { font-size: 1.15rem; margin: 2.5rem 0 0.25rem; padding-top: 0.75rem; border-top: 2px solid var(--fg); }
.episodes > .region:first-child { margin-top: 1rem; }
.metro { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 1.5rem 0 0.4rem; }
.region + .metro { margin-top: 0.75rem; }

/* An episode */
.episode-head { padding-top: 1.5rem; }
.episode [id] { scroll-margin-top: 8rem; }
.summary { font-size: 1.2rem; line-height: 1.5; }
.disclosure { color: var(--muted); font-size: 0.95rem; font-style: italic; }
.download { font: 0.9rem var(--sans); color: var(--muted); margin: 0.5rem 0; }
.corrections { background: var(--mark); border-radius: 0.5rem; padding: 0.75rem 1rem; margin: 1rem 0; }
.corrections h2 { margin: 0 0 0.25rem; font-size: 1rem; }
.corrections p { margin: 0.25rem 0; }
/* Folds: the transcript by chapter, and what happened by meeting and item, each closed until opened (§6) */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 2.5rem 0 0.5rem; }
.section-head h2 { margin: 0; }
.unfold { font: 600 0.85rem var(--sans); color: var(--muted); background: none; border: 0; padding: 0.25rem 0;
          cursor: pointer; }
.unfold:hover { color: var(--accent); }
.fold { border-top: 1px solid var(--line); }
.fold > summary { display: flex; align-items: baseline; gap: 0.75rem; padding: 0.7rem 0; cursor: pointer; list-style: none;
                  font-family: var(--sans); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: ""; flex: none; width: 0.4rem; height: 0.4rem; margin: 0 0.15rem 0 0.1rem;
                          border: solid var(--muted); border-width: 0 2px 2px 0; transform: translateY(-0.2em) rotate(-45deg);
                          transition: transform 0.15s; }
.fold[open] > summary::before { transform: translateY(-0.35em) rotate(45deg); }
.fold > summary:hover::before { border-color: var(--accent); }
.fold > summary :is(h3, h4) { flex: 1; min-width: 0; margin: 0; }
.fold > summary:hover :is(h3, h4) { color: var(--accent); }
.fold > summary .at, .fold > summary .count { flex: none; }
.fold > :not(summary) { margin-left: 1.4rem; }
.fold[open] > :last-child { margin-bottom: 1.25rem; }
.fold.meeting { border-top: 2px solid var(--fg); }
.fold.meeting > summary { padding: 0.85rem 0; }
.fold.meeting + .fold.meeting { margin-top: 0.5rem; }
.fold .date, .fold .count, .item .ref { color: var(--muted); font-weight: 400; }
.fold .count, .item .ref { font-size: 0.85rem; }
.item .ref { margin-left: 0.25rem; white-space: nowrap; }
.item.fold:first-of-type { border-top: 0; }
.sources { font-size: 0.9rem; margin: 0 0 0.75rem; }
.item p { margin-block: 0.25rem; }
.see { font: 0.9rem/1.6 var(--sans); color: var(--muted); margin-top: 0.75rem; }
.outcomes, .points { padding-left: 1.2rem; margin: 0.4rem 0; }
.outcomes li { font-weight: 600; }
.outcomes li.unclear { font-weight: 400; color: var(--muted); }
.points li { margin: 0.2rem 0; }
.at { font-size: 0.8rem; font-variant-numeric: tabular-nums; white-space: nowrap; text-decoration: none;
      padding: 0 0.3rem; border-radius: 0.25rem; background: var(--panel); }
.at:hover { background: var(--mark); }
.transcript { font-size: 1rem; }
.transcript .fold > summary h3 { font-size: 1rem; }
.transcript .fold > .cue { margin-left: 1rem; }               /* its words under the chapter's title */
.transcript .cue { margin: 0 0 0.6rem; padding: 0.1rem 0.4rem; border-radius: 0.3rem; cursor: pointer;
                   scroll-margin: 40vh; transition: background 0.2s; }
.transcript .cue:hover { background: var(--panel); }
.transcript .cue.now { background: var(--mark); }
.transcript .who { font-weight: 650; font-size: 0.85rem; margin-right: 0.3rem; }
.episode-foot { border-top: 1px solid var(--line); margin-top: 2.5rem; color: var(--muted); font-size: 0.95rem; }
.prose ul { padding-left: 1.2rem; }
.retracted { padding: 3rem 0; }

/* The player: a web component over an <audio>, with chapters, ±15 s, speed, and the transcript following along */
civicfm-player { display: block; position: sticky; top: 0; z-index: 2; background: var(--bg);
                 padding: 0.75rem 0; margin: 1rem 0; border-bottom: 1px solid var(--line); }
civicfm-player audio { width: 100%; }
civicfm-player .controls { display: grid; grid-template-columns: auto auto auto 1fr auto; align-items: center; gap: 0.5rem; }
civicfm-player button { font: 600 0.9rem var(--sans); border: 1px solid var(--line); background: var(--panel); color: var(--fg);
                        border-radius: 2rem; padding: 0.35rem 0.7rem; cursor: pointer; min-width: 2.75rem; }
civicfm-player button:hover { border-color: var(--muted); }
civicfm-player button.play { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); min-width: 4.5rem; }
civicfm-player button.play:hover { filter: brightness(1.1); }
civicfm-player .time { font: 0.85rem var(--sans); font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
civicfm-player input[type=range] { width: 100%; accent-color: var(--accent); }
civicfm-player .bar { display: flex; align-items: center; gap: 0.5rem; }
civicfm-player .now-chapter { display: flex; align-items: center; gap: 0.6rem; font: 600 0.85rem var(--sans);
                              margin: 0.5rem 0 0; min-height: 1.2em; }
civicfm-player .toggle::after { content: " ▾"; color: var(--muted); }
civicfm-player.open .toggle::after { content: " ▴"; }
civicfm-player .now-chapter .title { color: var(--muted); }
.chapters { list-style: none; padding: 0; margin: 0.5rem 0 0; font-size: 0.9rem; columns: 2 16rem; }
.chapters a { display: block; text-decoration: none; color: var(--fg); padding: 0.1rem 0.3rem; border-radius: 0.25rem; break-inside: avoid; }
.chapters a:hover { background: var(--panel); }
.chapters a.now { background: var(--mark); }
.chapters .t { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 0.3rem; }
civicfm-player:defined .chapters { max-height: 0; overflow: hidden; margin: 0; }
civicfm-player.open .chapters { max-height: 40vh; overflow: auto; margin-top: 0.5rem; }
@media (max-width: 30rem) {
  body { font-size: 17px; }
  .intro .title img { width: 88px; height: 88px; }
  civicfm-player .controls { grid-template-columns: repeat(4, auto) 1fr; }
  civicfm-player .bar { grid-column: 1 / -1; order: 9; }
  .fold .fold > :not(summary) { margin-left: 0; }
  .fold.meeting .date { display: block; font-size: 0.9rem; }
}

/* Topics, search, and the API, across every show (§6) */
.topics { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.4rem 0 0 !important; font: 0.8rem var(--sans); }
.topics a { padding: 0.1rem 0.6rem; border-radius: 2rem; background: var(--panel); border: 1px solid var(--line);
            color: var(--muted); text-decoration: none; }
.topics a:hover { color: var(--accent); border-color: var(--accent); }
.topics small { margin-left: 0.2rem; }
.facets { margin: 0 0 1rem !important; }
.fold > summary:has(.topics) { flex-wrap: wrap; row-gap: 0.3rem; }      /* an item's topics, under its title, folded or not */
.fold > summary .topics { flex-basis: 100%; margin: 0 0 0 1.4rem !important; }
.find { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0.5rem; font-family: var(--sans); }
.find input[type=search] { flex: 1 1 14rem; min-width: 0; font: 1rem var(--sans); padding: 0.5rem 0.75rem;
                           border: 1px solid var(--line); border-radius: 0.4rem; background: var(--bg); color: var(--fg); }
.find select, .find button { font: 600 0.95rem var(--sans); padding: 0.5rem 0.9rem; border-radius: 0.4rem;
                             border: 1px solid var(--line); background: var(--panel); color: var(--fg); }
.find button { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); cursor: pointer; }
.find button:hover { filter: brightness(1.1); }
.hit h3 { font-size: 1.15rem; }
.hit h3 .ref { color: var(--muted); font-weight: 400; font-size: 0.85rem; }
.hit .sources { margin-top: 0.4rem; }
.hit .topics { margin: 0 0 0.4rem !important; }
.hit .outcomes li.more { font-weight: 400; color: var(--muted); list-style: none; margin-left: -1.2rem; }
.filter { font-family: var(--sans); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-top: 1px solid var(--line);
         padding-top: 1rem; font: 600 0.95rem var(--sans); }
.area h2 { border-top: 2px solid var(--fg); padding-top: 0.75rem; }
.topic-list { list-style: none; padding: 0; margin: 0; }
.topic-list li { padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.topic-list a { font-weight: 600; font-family: var(--sans); }
.topic-list .quiet { font-family: var(--sans); }
.topic-list .about { display: block; color: var(--muted); font-size: 0.9rem; }
pre { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 0.4rem; padding: 0.75rem 1rem;
      font-size: 0.8rem; line-height: 1.45; }
code { font-size: 0.9em; }
.endpoints dt { margin-top: 1rem; font-weight: 600; }
.endpoints dd { margin: 0.25rem 0 0 1rem; }
