/* Before the Vote — styles.
   Visual idea: transit wayfinding. Decisions sit on a departures board and travel
   along a line of stops. The board and the line are the loud parts; the rest is quiet.
   Yellow means one thing only: you can act here.
   Order of this file: tokens, base, header/footer, board screen, decision screen,
   source pop-up, method page, poster, phones, print. */

:root {
  --paper: #f3f6fa;   /* cool sign-white page */
  --card: #ffffff;
  --ink: #0e2038;     /* navy: text, the board, the Have your say panel */
  --mute: #55637a;
  --hair: #d5deea;    /* quiet outlines */
  --rail: #2b6ce6;    /* the line itself, focus rings */
  --signal: #ffcb05;  /* "you can act" */
  --go: #0a7a55;      /* checked source, decided */
  --stop: #b93a1e;    /* held back */
  --display: "Bricolage Grotesque", "Arial Narrow", sans-serif;
  --body: "Atkinson Hyperlegible", Verdana, sans-serif;
  --wide: 70rem;
}

/* Base */
* { box-sizing: border-box; }
html { font-size: 112.5%; }  /* 18px: easier reading for everyone */
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); line-height: 1.55; }
h1, h2 { font-family: var(--display); line-height: 1.08; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 800; max-width: 20ch; }
h2 { font-size: 1.4rem; font-weight: 600; margin-bottom: 0.5rem; }
a { color: inherit; }
button, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--rail); outline-offset: 3px; }
#view:focus { outline: none; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--signal); padding: 0.5rem 1rem; z-index: 10; }
.small-note, .near-note, .line-hint { color: var(--mute); font-size: 0.85rem; }
.empty, .board-empty { padding: 1.5rem; }

/* Small plain button, used for tools (language, read aloud, location) */
.btn-plain {
  background: var(--card); border: 2px solid var(--ink); border-radius: 8px;
  padding: 0.3rem 0.8rem; cursor: pointer; font-weight: 700; font-size: 0.9rem;
}
.btn-plain[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* Header, footer, test banner */
.site-header, .site-footer, #view { max-width: var(--wide); margin-inline: auto; padding-inline: 1.25rem; }
.site-header { display: flex; justify-content: space-between; align-items: baseline; padding-block: 1.1rem; }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.25rem; text-decoration: none; }
.site-header nav { display: flex; gap: 1.25rem; }
.site-footer { color: var(--mute); font-size: 0.85rem; padding-block: 2.5rem; }
.site-footer p { max-width: 70ch; margin: 0 0 0.4rem; }
.test-banner { margin: 0; padding: 0.5rem 1.25rem; background: var(--stop); color: #fff; font-weight: 700; text-align: center; }

/* ---------- Board screen ---------- */
.hero { display: grid; grid-template-columns: 1fr 1.05fr; gap: 2.5rem; align-items: center; padding-block: 1.5rem 2rem; }
.lede { font-size: 1.15rem; max-width: 50ch; margin: 1rem 0 1.5rem; }
.near { display: flex; flex-wrap: wrap; gap: 0.6rem 0.8rem; align-items: center; }
.near label { font-weight: 700; }
.near select { margin-left: 0.4rem; padding: 0.3rem 0.5rem; border: 2px solid var(--ink); border-radius: 8px; background: var(--card); max-width: 15rem; }
.near-note { flex-basis: 100%; margin: 0; }

/* Ward map: our own SVG, no tiles */
.hero-map { margin: 0; }
.hero-map figcaption { color: var(--mute); font-size: 0.8rem; margin-top: 0.4rem; }
.ward-map { width: 100%; height: auto; display: block; overflow: visible; }
.ward { fill: #dbe5f3; stroke: var(--paper); stroke-width: 1.2; cursor: pointer; vector-effect: non-scaling-stroke; }
.ward.has-items { fill: #a9c4f5; }
.ward:hover { fill: var(--rail); }
.ward.is-picked { fill: var(--ink); }
.ward:focus-visible { outline: none; stroke: var(--ink); stroke-width: 3; }
.pin { fill: #8a97ab; stroke: #fff; stroke-width: 1.5; pointer-events: none; vector-effect: non-scaling-stroke; }
.pin.is-open { fill: var(--signal); stroke: var(--ink); stroke-width: 2; }
.pin.is-approx { fill: none; stroke: #8a97ab; stroke-width: 2.5; }
.pin.is-approx.is-open { stroke: var(--ink); fill: rgba(255, 203, 5, 0.45); }
.you { fill: none; stroke: var(--stop); stroke-width: 2.5; pointer-events: none; vector-effect: non-scaling-stroke; }

/* Departures board */
.board { background: var(--ink); color: #fff; border-radius: 14px; padding: 0.5rem 0 0; overflow: hidden; }
.board-head, .board-row { display: grid; grid-template-columns: 12rem 1fr 13rem; gap: 1.5rem; padding: 0.9rem 1.5rem; align-items: center; }
.board-head { color: #a9b8cf; font-size: 0.85rem; padding-bottom: 0.4rem; }
.board-list { list-style: none; margin: 0; padding: 0; }
.board-row { text-decoration: none; border-top: 1px solid #2a3d5a; }
.board-row:hover, .board-row:focus-visible { background: #17304f; }
.board-row small { display: block; color: #a9b8cf; font-size: 0.85rem; line-height: 1.35; }
.board-time strong { display: block; font-family: var(--display); font-weight: 800; font-size: 2.1rem; line-height: 1; color: var(--signal); }
.board-row.is-closed .board-time strong { color: #a9b8cf; font-size: 1.5rem; }
.board-what strong { font-size: 1.15rem; line-height: 1.3; }
.board-stage { font-size: 0.85rem; font-weight: 700; justify-self: start; padding: 0.2rem 0.7rem; border-radius: 999px; }
.board-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; margin: 0; padding: 0.9rem 1.5rem; border-top: 1px solid #2a3d5a; font-size: 0.9rem; color: #dbe4f0; }

.board-flags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.35rem; }
.board-flag { font-size: 0.78rem; font-weight: 700; padding: 0.05rem 0.55rem; border-radius: 4px; border: 1px solid #6f84a3; color: #dbe4f0; }
.board-flag.is-new { border-color: var(--signal); color: var(--signal); }
.board-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.6rem 1.5rem 0.9rem; font-size: 0.9rem; color: #dbe4f0; }
.board-more { margin: 0; padding: 0.9rem 1.5rem; border-top: 1px solid #2a3d5a; }

/* How decided is it? Same three looks on the board and on the decision page */
.level-proposed { background: var(--signal); color: var(--ink); }
.level-committee { background: #cfe0ff; color: var(--ink); }
.level-decided { background: var(--go); color: #fff; }

/* ---------- Decision screen ---------- */
.decision { padding-block: 0.5rem 3rem; }
.toolbar, .poster-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.6rem; padding-block: 0.5rem; }
.tools { display: flex; gap: 0.5rem; }
.back { font-size: 0.95rem; }
.replay-note { background: #fff6cc; border-left: 6px solid var(--signal); padding: 0.6rem 1rem; margin: 0.75rem 0; }
.replay-note .btn-plain { margin-left: 0.6rem; }
.status { display: inline-block; margin: 1rem 0 0.75rem; padding: 0.3rem 0.9rem; border-radius: 999px; font-weight: 700; font-size: 0.95rem; }
.official { color: var(--mute); font-size: 0.9rem; margin: 0.75rem 0 0; max-width: 70ch; }
.checked { color: var(--go); font-size: 0.85rem; font-weight: 700; margin: 0.4rem 0 0; }
.checked.is-stale { color: var(--stop); }

/* The Decision Line: one stop per stage, joined by a rail */
.line { list-style: none; margin: 2.25rem 0 0.4rem; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.stop { position: relative; padding-top: 2rem; }
.stop::before { content: ""; position: absolute; top: 0.55rem; left: 0; right: 0; height: 6px; background: var(--rail); }
.stop.is-ahead::before { background: repeating-linear-gradient(90deg, var(--rail) 0 8px, transparent 8px 16px); }
.stop:last-child::before { right: auto; width: 1.3rem; }
.dot { position: absolute; top: 0; left: 0; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--card); border: 5px solid var(--rail); }
.stop.is-done .dot { background: var(--rail); }
.stop.is-next .dot { background: var(--signal); border-color: var(--ink); }
.stop-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; width: 100%;
  padding: 0 1.25rem 0.5rem 0; background: none; border: 0; text-align: left; font-size: 0.9rem; line-height: 1.4;
}
button.stop-btn { cursor: pointer; }
button.stop-btn:hover strong { text-decoration: underline; }
.stop-btn strong { font-family: var(--display); font-size: 1.1rem; line-height: 1.2; }
.stop-date { font-weight: 700; }
.stop-state, .stop-note { color: var(--mute); }
.speak-tag { background: var(--signal); padding: 0.1rem 0.5rem; border-radius: 4px; font-weight: 700; margin-top: 0.25rem; }
.line-hint { margin: 0 0 1.75rem; }

.decision-grid { display: grid; grid-template-columns: 1fr 21rem; gap: 3rem; align-items: start; }
.decision-main section { margin-bottom: 2rem; }
.claim { max-width: 62ch; margin: 0 0 0.9rem; }
.claim.is-lens { background: #fff6cc; box-shadow: -0.75rem 0 0 #fff6cc, 0.5rem 0 0 #fff6cc; border-radius: 2px; }
.unknowns { border-left: 6px dashed var(--mute); padding-left: 1.1rem; }
.updates { background: var(--card); border: 1px solid var(--hair); border-left: 6px solid var(--rail); border-radius: 8px; padding: 0.9rem 1.1rem; }
.updates h2 { font-size: 1.1rem; }
.facts-only { background: #fff6cc; border-left: 6px solid var(--signal); padding: 0.9rem 1.1rem; border-radius: 4px; }
.facts-only h2 { font-size: 1.15rem; }
.facts-only p { margin: 0; max-width: 62ch; }
.decision-main ul { margin: 0; padding-left: 1.1rem; max-width: 60ch; }

/* "I rent", "I live nearby": bring matching sentences forward */
.lenses { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; font-size: 0.9rem; color: var(--mute); }
.chip { background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 0.2rem 0.9rem; cursor: pointer; font-weight: 700; }
.chip.is-on { background: var(--signal); }

/* Votes */
.decision-main ul.votes { list-style: none; padding: 0; }
.votes li { margin-bottom: 0.9rem; }
.votes strong { display: block; }
.vote-bar { display: block; height: 0.6rem; max-width: 22rem; margin: 0.3rem 0; background: #e2b3a7; border-radius: 999px; overflow: hidden; }
.vote-bar span { display: block; height: 100%; background: var(--go); }

/* Source button on every sentence */
.source-btn {
  font-size: 0.8rem; cursor: pointer; white-space: nowrap; padding: 0.05rem 0.6rem; margin-left: 0.25rem;
  border-radius: 999px; background: var(--card); border: 2px solid var(--go); color: var(--go); font-weight: 700;
}
.source-btn.is-on-dark { background: transparent; border-color: #fff; color: #fff; }

/* Have your say panel */
.say { background: var(--ink); color: #fff; border-radius: 14px; padding: 1.4rem; position: sticky; top: 1rem; }
.say h2 { font-size: 1.1rem; }
.say-big { font-family: var(--display); font-weight: 800; font-size: 3rem; line-height: 1; color: var(--signal); margin: 0.4rem 0 0; }
.say.is-closed .say-big { color: #a9b8cf; font-size: 2.2rem; }
.say-small { margin: 0.2rem 0 1rem; color: #dbe4f0; }
.say ul { padding-left: 1.1rem; margin: 0.75rem 0 1.1rem; }
.say-guidance { font-size: 0.9rem; color: #dbe4f0; }
.say-privacy { font-size: 0.82rem; color: #dbe4f0; margin: 1rem 0 0; }
.btn {
  display: block; width: 100%; text-align: center; text-decoration: none; cursor: pointer; font-weight: 700;
  padding: 0.7rem 0.9rem; margin-top: 0.6rem; border-radius: 8px; border: 2px solid var(--signal);
  background: var(--signal); color: var(--ink);
}
.btn-quiet { background: transparent; color: #fff; border-color: #6f84a3; }

/* ---------- Source pop-up ---------- */
dialog { border: none; border-radius: 14px; padding: 1.75rem; max-width: 38rem; width: calc(100% - 2rem); color: var(--ink); }
dialog::backdrop { background: rgba(14, 32, 56, 0.6); }
dialog .close { float: right; background: none; border: 2px solid var(--ink); border-radius: 6px; padding: 0.15rem 0.6rem; cursor: pointer; }
.receipt-claim { color: var(--mute); }
blockquote { margin: 1rem 0; padding: 0.75rem 1rem; background: #fff6cc; border-left: 6px solid var(--signal); }

/* ---------- How we check ---------- */
.method { padding-block: 1.5rem 3rem; }
.method h2 { margin-top: 2rem; }
.method ul, .steps { max-width: 68ch; padding-left: 1.2rem; }
.steps li { margin-bottom: 0.6rem; }
.tally { background: var(--ink); color: #fff; border-radius: 14px; padding: 1rem 1.4rem; max-width: 46rem; }
.tally strong { color: var(--signal); font-family: var(--display); font-size: 1.3rem; }
.table-wrap { overflow-x: auto; background: var(--card); border-radius: 14px; border: 1px solid var(--hair); }
table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
th, td { text-align: left; vertical-align: top; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--hair); }
tr.needs-check { background: #fbeeea; }
tr.needs-check td:last-child { color: var(--stop); font-weight: 700; }

/* ---------- Printable notice ---------- */
.poster { background: var(--card); border: 4px solid var(--ink); border-radius: 6px; padding: 2.5rem; max-width: 46rem; margin: 1rem auto 3rem; }
.poster h1 { max-width: none; font-size: clamp(2rem, 6vw, 3.2rem); margin: 0.3rem 0 0.6rem; }
.poster-kicker { margin: 0; font-weight: 700; font-size: 1.1rem; }
.poster-where { font-weight: 700; margin: 0 0 1.25rem; }
.poster-text { font-size: 1.2rem; margin: 0 0 0.8rem; }
.poster-status { font-weight: 700; border-top: 3px solid var(--ink); padding-top: 0.8rem; }
.poster-act { background: var(--signal); padding: 1.1rem 1.4rem; margin: 1.25rem 0; }
.poster-act p { margin: 0; }
.poster-act .poster-date { font-family: var(--display); font-weight: 800; font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.1; margin: 0.2rem 0 0.5rem; }
.poster-foot { font-size: 0.8rem; color: var(--mute); overflow-wrap: anywhere; }

/* ---------- Phones: everything stacks, the line turns vertical ---------- */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 1.25rem; }
  .board-head { display: none; }
  .board-row { grid-template-columns: 1fr; gap: 0.4rem; }
  .decision-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .say { position: static; order: -1; }   /* the date to act comes first on a phone */
  .line { grid-auto-flow: row; }
  .stop { padding: 0 0 1.25rem 2.2rem; }
  .stop::before { top: 0; bottom: 0; left: 0.42rem; right: auto; width: 6px; height: auto; }
  .stop.is-ahead::before { background: repeating-linear-gradient(180deg, var(--rail) 0 8px, transparent 8px 16px); }
  .stop:last-child::before { height: 1.3rem; width: 6px; }
  .poster { padding: 1.4rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .board-row, .ward { transition: background 120ms, fill 120ms; }
}

/* ---------- Print: only the content, black on white ---------- */
@media print {
  .site-header, .site-footer, .toolbar, .poster-tools, .btn, .source-btn, .lenses, .line-hint, .test-banner { display: none !important; }
  body { background: #fff; }
  .poster { border-width: 3px; margin: 0; max-width: none; }
  .say { background: #fff; color: #000; border: 3px solid #000; position: static; }
  .say-big, .say-small, .say-privacy, .say-guidance { color: #000 !important; }
  .decision-grid { grid-template-columns: 1fr; }
}
