/* ==========================================================================
   WhiskeyCivic — the civic register
   Set like a printed broadsheet calendar: paper and ink, rules instead of
   boxes, metadata in small capitals instead of coloured badges. Colour is
   reserved for the one thing with a hard end — a deadline — and for links.

   Type:
     Fraunces        display: nameplate, headlines, figures
     Source Serif 4  reading: body, titles in running text
     Public Sans     data: dates, times, labels (the US government's typeface)

   Structure:
     .masthead      dateline · nameplate · section rule
     .ledger        the register: a date column, then .entry rows
     .entry         one event: when | what, who, tags
     .tags/.tag     small-caps metadata separated by middle dots
     .section-head  a ruled label over any list
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("./fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url("./fonts/fraunces-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("./fonts/source-serif-4-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 300 800;
  font-display: swap;
  src: url("./fonts/source-serif-4-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("./fonts/public-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #f5f1e8;
  --paper-2: #ece6d8;
  --ink: #1c1a17;
  --ink-2: #47423b;
  /* 5.1:1 on --paper: WCAG AA for small text (the old #7b7468 was 4.1:1). */
  --muted: #6b655b;
  --rule: #d6cdbb;
  --accent: #b03a1a;
  --accent-deep: #8a2b10;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --text: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 72px;

  --container: 1160px;
  --measure: 40rem;
}

/* ------------------------------------------------------------------ base */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--text);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  font-optical-sizing: auto;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-optical-sizing: auto; }

a { color: var(--accent-deep); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
a:hover { text-decoration-color: currentColor; }

form { margin: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--s-5); }
.narrow { max-width: var(--measure); }

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--s-3);
  z-index: 50;
  padding: var(--s-2) var(--s-4);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 14px;
}
.skip-link:focus { top: var(--s-3); }

/* Small capitals in Public Sans: the one label voice used everywhere. */
.micro-label,
.section-head h2,
.result-head h2,
.side-block h2,
.fact-grid dt,
.figures dt,
.source-table th,
.toc-label {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}
.micro-label { display: block; color: var(--muted); }

.mono { font-family: var(--mono); }
.hide-sm { display: inline; }

/* -------------------------------------------------------------- masthead */

.masthead { padding-top: var(--s-2); }

.dateline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-4);
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.dateline a { color: var(--ink); text-decoration: none; font-weight: 700; }
.dateline a:hover { color: var(--accent); }

.nameplate {
  display: block;
  /* The descender of the y hangs below the line box, so the bottom margin is
     larger by about that much: the two gaps then read as equal. */
  margin: 30px 0 38px;
  text-align: center;
  font-family: var(--display);
  font-size: clamp(46px, 8.5vw, 92px);
  font-weight: 750;
  font-variation-settings: "opsz" 144;
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-decoration: none;
}
.nameplate-civic { font-style: italic; font-weight: 400; color: var(--accent); letter-spacing: -0.02em; }


/* The menu bar follows the scroll; the paper behind it hides what passes under. */
.sections-bar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--paper);
}
.sections {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2) 26px;
  padding: 12px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.sections a { color: var(--ink); text-decoration: none; }
.sections a:hover { color: var(--accent); }
.sections-rule { width: 1px; height: 13px; margin: 0 2px; background: var(--ink-2); opacity: 0.35; }

/* ---------------------------------------------------------------- footer */

.site-footer {
  margin-top: var(--s-8);
  padding-bottom: var(--s-7);
}
/* One rule, the width of the column above it — on the grid, not the window. */
.footer-grid {
  padding-top: var(--s-6);
  border-top: 1px solid var(--ink);
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: var(--s-6);
  align-items: start;
}
.footer-name {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}
.footer-col { display: flex; flex-direction: column; gap: 7px; font-family: var(--sans); font-size: 14px; }
.footer-col h2 {
  margin: 0 0 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.footer-col a { color: var(--ink-2); text-decoration: none; }
.footer-col a:hover { color: var(--accent); }

/* ------------------------------------------------------------ page heads */

.page-head {
  margin: var(--s-7) 0 var(--s-6);
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--rule);
}
.page-head-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.page-head h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: -0.025em;
}
.page-head .lead,
.lead {
  margin: var(--s-3) 0 0;
  max-width: var(--measure);
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink-2);
}
.lead.small { font-size: 16px; }
.btn-row { display: inline-flex; gap: var(--s-2); flex-wrap: wrap; }

.back-link {
  display: inline-block;
  margin-top: var(--s-6);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.back-link:hover { color: var(--accent); }

/* A ruled label over a list: the section heading of the register. */
.section-head,
.result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  padding-bottom: var(--s-2);
  border-bottom: 2px solid var(--ink);
}
.section-head h2,
.result-head h2 { margin: 0; }
.section-head a,
.result-head .count { font-family: var(--sans); font-size: 13px; color: var(--ink-2); }
.result-head .count a { color: var(--accent-deep); }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 13px 20px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.secondary { background: transparent; color: var(--ink); }
.btn.secondary:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.small { padding: 9px 13px; font-size: 11px; }
.btn.disabled, .btn.disabled:hover { color: var(--rule); border-color: var(--rule); background: transparent; pointer-events: none; }

/* ------------------------------------------------------------------ tags */

/* Metadata as words: "City · Public hearing · Comment closes in 4 days". */
.tags {
  display: block;
  margin-top: 7px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.tag + .tag::before { content: "·"; margin: 0 0.55em; color: var(--rule); font-weight: 400; }
.tag.due { color: var(--accent); }
.tag.due.soon { font-weight: 800; }
.tag.alert, .alert { color: var(--accent); font-weight: 800; }

/* Active-filter removers, set as text: "City ✕". */
.chip {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.chip:hover { color: var(--accent); border-color: var(--accent); }

/* Status words on /sources: text, not pills. */
.status {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.status.error { color: var(--accent); }
.status.plain { color: var(--muted); }

/* ---------------------------------------------------------------- front */


.front-grid {
  margin-top: var(--s-6);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--s-7);
  align-items: start;
}
.front-side { padding-left: var(--s-6); border-left: 1px solid var(--rule); }

.side-block + .side-block { margin-top: var(--s-7); }
.side-block h2 { margin: 0 0 var(--s-3); padding-bottom: var(--s-2); border-bottom: 2px solid var(--ink); }
.side-note { margin: var(--s-3) 0 0; font-size: 15.5px; line-height: 1.5; color: var(--ink-2); }
.side-more { display: inline-block; margin-top: var(--s-3); font-family: var(--sans); font-size: 13px; }

.due-list { list-style: none; margin: 0; padding: 0; }
.due-list li + li { border-top: 1px solid var(--rule); }
.next-election-link {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  column-gap: var(--s-3);
  align-items: start;
  padding: 6px 0 var(--s-2);
  color: inherit;
  text-decoration: none;
}
.next-election-link:hover .due-title { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.due-list a {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  column-gap: var(--s-3);
  align-items: start;
  padding: 14px 0;
  color: inherit;
  text-decoration: none;
}
/* The figure and its unit are one block in their own column, so they sit in
   the same place on every row however many lines the title takes. */
.due-count { display: flex; flex-direction: column; align-items: flex-start; }
.due-n {
  font-family: var(--display);
  font-size: 42px;
  font-weight: 330;
  font-variation-settings: "opsz" 144;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 0.9;
  color: var(--accent);
}
.due-unit { margin-top: 6px; font-family: var(--sans); font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; color: var(--accent); }
.due-what { display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.due-title { font-size: 16.5px; font-weight: 600; line-height: 1.3; }
.due-meta { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.due-list a:hover .due-title { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

.level-index { list-style: none; margin: 0; padding: 0; }
.level-index li { border-bottom: 1px solid var(--rule); }
.level-index a {
  display: block;
  padding: 9px 0;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 450;
  color: var(--ink);
  text-decoration: none;
}
.level-index a:hover { color: var(--accent); }

/* --------------------------------------------------------------- ledger */

.ledger-day {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: var(--s-5);
  padding: var(--s-4) 0 var(--s-3);
  border-bottom: 1px solid var(--rule);
}
.ledger-date {
  position: sticky;
  top: var(--s-4);
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 2px 0 0;
  font-weight: normal;
}
.ld-dow, .ld-mon {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ld-dow { color: var(--accent); }
.ld-mon { color: var(--muted); }
.ld-num {
  font-family: var(--display);
  font-size: 50px;
  font-weight: 330;
  font-variation-settings: "opsz" 144;
  font-variant-numeric: lining-nums;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 2px 0;
}

.entry {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: var(--s-4);
  padding: var(--s-3) 0;
  color: inherit;
  text-decoration: none;
}
.ledger-entries .entry + .entry,
.register .entry + .entry { border-top: 1px dotted var(--rule); }
.entry-when {
  padding-top: 4px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.entry-what { display: block; min-width: 0; }
.entry h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 560;
  font-variation-settings: "opsz" 24;
  line-height: 1.22;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.entry:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.entry-where { display: block; margin-top: 3px; font-style: italic; font-size: 16px; color: var(--ink-2); }
.entry-summary {
  display: -webkit-box;
  margin-top: 5px;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--ink-2);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Kept in the register, struck through: someone who saw it last week needs to
   be told it is off, and it must never read as going ahead. */
.entry.cancelled h3 { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--accent); }
.entry.cancelled .entry-where,
.entry.cancelled .entry-summary { color: var(--muted); }

/* The deadline register: the days left lead. */
.register { border-top: 2px solid var(--ink); }
.result-head + .register,
.result-head + .ledger { border-top: 0; }
.result-head + .ledger .ledger-day:first-child,
.section-head + .ledger .ledger-day:first-child { padding-top: var(--s-3); }
.register .entry { grid-template-columns: 118px minmax(0, 1fr); padding: var(--s-4) 0; }
.when-n {
  display: block;
  font-family: var(--display);
  font-size: 46px;
  font-weight: 330;
  font-variation-settings: "opsz" 144;
  line-height: 0.9;
  color: var(--accent);
}
.when-unit, .when-date { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.when-unit { color: var(--accent); margin-top: 6px; }
.when-date { color: var(--muted); margin-top: 2px; }

/* ----------------------------------------------------------- filter bar */

.filterbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s-4) var(--s-5);
  align-items: end;
  margin-bottom: var(--s-4);
  padding: var(--s-4) 0 var(--s-5);
  border-bottom: 1px solid var(--rule);
}
.filterbar .f { min-width: 0; }
.filterbar .f.wide { grid-column: span 2; }
.filterbar label,
.field label { margin-bottom: 6px; }

.filterbar input[type="search"],
.filterbar input[type="date"],
.filterbar select,
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid var(--ink-2);
  border-radius: 0;
  background: transparent;
  font-family: var(--text);
  font-size: 16px;
  color: var(--ink);
  appearance: none;
}
.filterbar select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 9px) 55%, calc(100% - 4px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 18px;
}
.filterbar input:focus,
.filterbar select:focus,
.field input:focus { outline: none; border-bottom: 2px solid var(--accent); }
.filterbar .f.check { padding-bottom: 6px; }
.filterbar .f.check label { display: flex; gap: var(--s-2); align-items: center; margin: 0; font-size: 15px; }
.filterbar .f.check input { accent-color: var(--accent); }
.filterbar .f.submit .btn { width: 100%; justify-content: center; }

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  align-items: baseline;
  margin-bottom: var(--s-5);
}
.active-filters .micro-label { display: inline; }
.active-filters a.clear { font-family: var(--sans); font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------ pagination */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin: var(--s-6) 0;
  padding-top: var(--s-4);
  border-top: 2px solid var(--ink);
}
.page-of { font-family: var(--sans); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* --------------------------------------------------------- event detail */

.event-detail { margin: var(--s-5) 0 var(--s-7); }
.kicker {
  margin: 0;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.kicker a { color: var(--accent); text-decoration: none; }
.kicker-sep { margin: 0 0.6em; color: var(--rule); }
.event-detail h1 {
  max-width: 22ch;
  margin: var(--s-3) 0 var(--s-6);
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.fact-grid {
  display: grid;
  grid-template-columns: 9rem 1fr;
  margin: 0 0 var(--s-5);
  border-top: 2px solid var(--ink);
}
.fact-grid dt,
.fact-grid dd { padding: var(--s-3) 0; border-bottom: 1px solid var(--rule); }
.fact-grid dt { padding-top: 15px; color: var(--muted); }
.fact-grid dd { margin: 0; font-size: 18px; }
.fact-grid dd a { word-break: break-word; }
.fact-grid .tag { font-family: var(--sans); font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

/* The article: text on the left, the facts and the action in a column on
   the right that stays in view while the description is read. */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--s-7);
  align-items: start;
}
.detail-facts { grid-column: 2; grid-row: 1; position: sticky; top: var(--s-4); }
.detail-body { grid-column: 1; grid-row: 1; }
.detail-facts .fact-grid { grid-template-columns: 6.5rem 1fr; }
.detail-facts .fact-grid dd { font-size: 16.5px; }
.detail-facts .action-row { flex-direction: column; margin-top: var(--s-4); }
.detail-facts .btn { justify-content: center; }
.detail-body .prose:first-child { margin-top: 0; }
.no-summary { font-style: italic; color: var(--muted); }

/* /events: the filters as an index column beside the register. */
.listing {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: var(--s-7);
  align-items: start;
}
.listing-filters { position: sticky; top: var(--s-4); }
.listing-filters .filterbar { grid-template-columns: 1fr; gap: var(--s-4); padding-top: var(--s-3); border-top: 2px solid var(--ink); border-bottom: 0; }
.listing-filters .filterbar .f.wide { grid-column: auto; }

.action-row { display: flex; gap: var(--s-3); flex-wrap: wrap; margin: var(--s-5) 0 var(--s-6); }

.prose { max-width: var(--measure); font-size: 19px; line-height: 1.65; }
.prose p { margin: 0 0 var(--s-4); }

.cancel-banner {
  margin: var(--s-4) 0;
  padding: 2px 0 2px var(--s-4);
  border-left: 3px solid var(--accent);
  font-style: italic;
  color: var(--ink-2);
}

.agenda { margin: var(--s-5) 0; border-top: 2px solid var(--ink); padding-top: var(--s-3); }
.agenda h2 { font-family: var(--display); font-size: 22px; font-weight: 600; margin: 0 0 var(--s-3); }
.agenda ul { margin: 0; padding-left: var(--s-5); }
.agenda li { margin-bottom: var(--s-2); }

.source-note {
  margin-top: var(--s-6);
  padding-top: var(--s-3);
  border-top: 1px solid var(--rule);
  font-size: 15px;
  font-style: italic;
  color: var(--ink-2);
}

/* --------------------------------------------------------------- figures */

.figures { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-7); margin: 0 0 var(--s-6); }
.figure { display: flex; flex-direction: column-reverse; }
.figures dt { color: var(--muted); }
.figures dd {
  margin: 0;
  font-family: var(--display);
  font-size: 48px;
  font-weight: 330;
  font-variation-settings: "opsz" 144;
  font-variant-numeric: lining-nums;
  line-height: 1;
  letter-spacing: -0.02em;
}

/* --------------------------------------------------------------- sources */

.source-group { margin-top: var(--s-7); }
.source-group h2 { margin: 0 0 var(--s-2); font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -0.015em; }
.table-scroll { overflow-x: auto; }

.source-table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 14px; }
.source-table th { padding: var(--s-2) var(--s-3) var(--s-2) 0; text-align: left; border-bottom: 2px solid var(--ink); color: var(--muted); }
.source-table td { padding: var(--s-3) var(--s-3) var(--s-3) 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.source-table a.name { font-family: var(--text); font-size: 17px; font-weight: 600; color: var(--ink); text-decoration: none; }
.source-table a.name:hover { color: var(--accent); }
.source-table .err { margin-top: 4px; font-family: var(--mono); font-size: 11.5px; color: var(--accent); word-break: break-word; }
.source-table .sub,
.subscribe-urls .sub { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.source-links { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: 3px; font-size: 12.5px; }
td > .source-links:only-child { margin-top: 0; }

/* ------------------------------------------------------------ subscribe */

.subscribe-urls { margin-top: var(--s-6); }
.subscribe-urls h2 { margin: 0 0 var(--s-2); padding-bottom: var(--s-2); border-bottom: 2px solid var(--ink); font-family: var(--display); font-size: 28px; font-weight: 600; }
.subscribe-urls .field { padding: var(--s-4) 0; border-bottom: 1px solid var(--rule); }
.url-row { display: flex; gap: var(--s-3); align-items: center; }
.url-row input { flex: 1; min-width: 0; font-family: var(--mono) !important; font-size: 13px !important; }

/* ---------------------------------------------------------------- notes */

.empty {
  padding: var(--s-6) 0;
  border-bottom: 1px solid var(--rule);
  font-style: italic;
  color: var(--ink-2);
}
.empty strong { display: block; font-style: normal; font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--ink); margin-bottom: var(--s-1); }

.notice { margin: 0 0 var(--s-5); padding-left: var(--s-4); border-left: 3px solid var(--accent); font-family: var(--sans); font-size: 14px; color: var(--accent-deep); }
.notice.ok { border-color: var(--ink-2); color: var(--ink-2); }

.callout { margin: var(--s-7) 0; padding-top: var(--s-3); border-top: 2px solid var(--ink); font-size: 16px; color: var(--ink-2); }
.callout h2 { margin: 0 0 var(--s-3); font-family: var(--display); font-size: 28px; font-weight: 600; color: var(--ink); }
.callout li { margin-bottom: var(--s-3); }

/* ---------------------------------------------------------- prose pages */

.prose-page { max-width: var(--measure); margin: var(--s-7) 0 var(--s-8); font-size: 19px; line-height: 1.65; }
.prose-page h1 { font-family: var(--display); font-size: clamp(36px, 5vw, 56px); font-weight: 650; line-height: 1.04; letter-spacing: -0.025em; margin: 0 0 var(--s-4); }
.prose-page h2 { font-family: var(--display); font-size: 27px; font-weight: 600; letter-spacing: -0.01em; margin: var(--s-7) 0 var(--s-3); }
.prose-page ul, .prose-page ol { padding-left: var(--s-5); }
.prose-page li { margin-bottom: var(--s-2); }
.prose-page .lede { font-family: var(--display); font-size: 24px; font-weight: 380; line-height: 1.4; color: var(--ink-2); }

/* ------------------------------------------------------ civic education */

.guide-toc { list-style: none; margin: var(--s-5) 0 var(--s-7); padding: 0; border-top: 2px solid var(--ink); }
.guide-toc a { display: block; padding: var(--s-3) 0; border-bottom: 1px solid var(--rule); color: inherit; text-decoration: none; }
.guide-toc a:hover .toc-head { color: var(--accent); }
.toc-label { display: block; color: var(--muted); }
.toc-head { display: block; margin-top: 2px; font-family: var(--display); font-size: 21px; font-weight: 500; color: var(--ink); }

.guide-section { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 3px double var(--ink); scroll-margin-top: var(--s-4); }
.guide-head { margin-bottom: var(--s-4); }
.guide-head h2 { margin: var(--s-2) 0; font-family: var(--display); font-size: clamp(30px, 4vw, 42px); font-weight: 650; letter-spacing: -0.02em; line-height: 1.08; }
.guide-headline { margin: 0; max-width: 40rem; font-family: var(--display); font-size: 21px; font-weight: 380; line-height: 1.42; color: var(--ink-2); }
.guide-section h3, .guide-block h3, .spine h3 { margin: var(--s-6) 0 var(--s-2); font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.guide-section ul { padding-left: var(--s-5); }
.guide-section li { margin-bottom: var(--s-2); }

.steps { margin: 0; padding-left: var(--s-5); }
.steps li { margin-bottom: var(--s-4); }
.steps li::marker { font-family: var(--display); color: var(--accent); }
.step-action { display: block; font-weight: 700; }
.step-detail { display: block; margin-top: 2px; font-size: 16px; color: var(--ink-2); }

.catch { margin: var(--s-5) 0; padding: 2px 0 2px var(--s-4); border-left: 3px solid var(--accent); }
.catch p { margin: var(--s-2) 0 0; font-size: 17px; color: var(--ink-2); }

.link-list { list-style: none; margin: var(--s-3) 0 0; padding: 0; font-family: var(--sans); font-size: 14px; }
.link-list li { display: inline; }
.link-list li + li::before { content: "·"; margin: 0 0.6em; color: var(--rule); }

.spine, .guide-block { margin: var(--s-6) 0 var(--s-7); padding-top: var(--s-3); border-top: 2px solid var(--ink); }
.spine h3 { margin-top: 0; }
.guide-block-head h2 { margin: var(--s-2) 0; font-family: var(--display); font-size: 30px; font-weight: 600; }
.guide-block-head .lead { margin: 0; font-size: 18px; }

.back-to-events { margin-top: var(--s-5); font-family: var(--sans); font-size: 14px; }

/* --------------------------------------------------------------- narrow */

@media (max-width: 960px) {
  .front-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s-7); }
  .detail-grid, .listing { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
  .detail-facts, .detail-body { grid-column: 1; grid-row: auto; position: static; }
  .listing-filters { position: static; }
  .listing-filters .filterbar { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  /* On one column the side blocks join the main flow: deadlines first (they
     are the reason to open the site), then the register, then the ways in. */
  .front-side { display: contents; }
  .front-side .deadlines { order: -1; }
  .front-side .next-election { order: -2; }
  .front-side .side-lookup { order: -3; }
  .front-side .side-block:not(.deadlines):not(.next-election):not(.side-lookup) { order: 1; margin-top: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .container { padding: 0 var(--s-4); }
  body { font-size: 17px; }
  .hide-sm { display: none; }
  .dateline { font-size: 10.5px; }
  .sections { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; gap: var(--s-4); scrollbar-width: none; }
  .sections::-webkit-scrollbar { display: none; }
  .sections a { white-space: nowrap; }
  .sections-rule { display: none; }

  .ledger-day { grid-template-columns: minmax(0, 1fr); gap: var(--s-1); }
  .ledger-date { position: static; flex-direction: row; align-items: baseline; gap: var(--s-2); }
  .ld-num { font-size: 30px; }
  .entry { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .entry-when { padding-top: 0; font-size: 12px; }
  .register .entry { grid-template-columns: 76px minmax(0, 1fr); gap: var(--s-3); }
  .when-n { font-size: 36px; }

  .filterbar .f.wide { grid-column: 1 / -1; }
  .fact-grid { grid-template-columns: 1fr; }
  .fact-grid dt { padding-bottom: 0; border-bottom: 0; }
  .figures dd { font-size: 38px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* -------------------------------------------------------------- officials */

.body-block + .body-block { margin-top: var(--s-6); }
.body-block .section-head { margin-bottom: var(--s-2); }
.body-name { margin: 0; font-family: var(--display); font-size: 23px; font-weight: 600; letter-spacing: -0.01em; }
.body-name a { font: inherit; color: var(--ink); text-decoration: none; }
.body-name a:hover { color: var(--accent); }
.seat-table td.seat-title { font-family: var(--text); font-size: 16px; }
/* Fixed columns, so every body's table lines up with the next. */
.seat-table { table-layout: fixed; }
.seat-table th:nth-child(1) { width: 34%; }
.seat-table th:nth-child(2) { width: 30%; }
.seat-table th:nth-child(3), .seat-table th:nth-child(4) { width: 18%; }
/* On a phone each seat is a short block: the seat, who holds it, then the two
   dates as labelled lines — four columns at 375px were unreadable. */
@media (max-width: 640px) {
  .seat-table, .seat-table tbody, .seat-table tr, .seat-table td { display: block; width: auto; }
  .seat-table thead { display: none; }
  .seat-table tr { padding: var(--s-3) 0; border-bottom: 1px solid var(--rule); }
  .seat-table td { padding: 0; border: 0; }
  .seat-table td.seat-title { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
  .seat-table td.seat-title a { color: var(--muted); text-decoration: none; }
  .seat-table td.seat-title .sub { display: none; }
  .seat-table a.name { font-size: 18px; }
  .seat-table td[data-label] { font-size: 14px; color: var(--ink-2); }
  .seat-table td[data-label]::before { content: attr(data-label) " · "; color: var(--muted); }
  .election-head { flex-direction: column; gap: var(--s-2); }
}

.run { margin-top: var(--s-7); }
.run-window { display: flex; gap: var(--s-5); align-items: flex-start; margin: var(--s-4) 0 var(--s-5); }
.run-window p { margin: 0; max-width: var(--measure); font-size: 19px; line-height: 1.55; }
.run-count { flex: none; width: 110px; }
.run-facts { max-width: 52rem; }
ul.plain { margin: 0; padding-left: 1.1em; }
ul.plain li { margin-bottom: 4px; }
.run-notes { max-width: var(--measure); padding-left: 1.1em; color: var(--ink-2); }
.run-notes li { margin-bottom: var(--s-2); }

/* -------------------------------------------------------------- elections */

.vote-lookup { margin: var(--s-6) 0; }
.vote-form { margin-top: var(--s-3); max-width: 40rem; }
.vote-form input { flex: 1; min-width: 0; padding: 10px 0; border: 0; border-bottom: 1px solid var(--ink-2); background: transparent; font-family: var(--text); font-size: 18px; color: var(--ink); }
.vote-form input:focus { outline: none; border-bottom: 2px solid var(--accent); }
.vote-form .sub { margin-top: var(--s-2); font-size: 13px; color: var(--muted); }

.election-head { display: flex; gap: var(--s-5); align-items: flex-start; margin-bottom: var(--s-4); }
.election-head h2 { margin: 0; }
.election-date { margin: 4px 0 0; font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.election-what { margin: var(--s-2) 0 0; max-width: var(--measure); color: var(--ink-2); }
.election-sub { margin: var(--s-5) 0 var(--s-2); }
.election-dates { grid-template-columns: 11rem 1fr; }
.election-dates dt { text-transform: none; letter-spacing: 0.02em; font-size: 13px; color: var(--ink); }
.lead-election { padding-top: var(--s-2); }

.vote-result { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-7); align-items: start; }
.polling { border-top: 2px solid var(--ink); padding-top: var(--s-3); }
.polling p { margin: 0 0 var(--s-2); }
.polling-name { font-family: var(--display); font-size: 30px; font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; }
.districts { margin: 0; }
@media (max-width: 760px) { .vote-result { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); } .election-dates { grid-template-columns: 1fr; } }
.vote-form .url-row input { font-family: var(--text) !important; font-size: 18px !important; }

/* ------------------------------------------------------------ more links */

/* "Go somewhere" links: small capitals, no underline until hover, and a
   chevron drawn in CSS — the typed arrow came from a fallback font, since
   none of the site's three faces carries one. Links inside a sentence carry
   no arrow at all; their underline already says what they are. */
.more,
.section-head a.more {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-deep);
  text-decoration: none;
}
.more::after,
.back-link::before,
.btn.prev::before,
.btn.next::after {
  content: "";
  flex: none;
  width: 0.42em;
  height: 0.42em;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transition: transform 0.15s ease;
}
.more::after,
.btn.next::after { transform: rotate(45deg); }
.back-link::before,
.btn.prev::before { transform: rotate(-135deg); }
.more:hover { color: var(--accent); text-decoration: none; }
.more:hover::after,
.btn.next:hover::after { transform: translateX(3px) rotate(45deg); }
.back-link:hover::before,
.btn.prev:hover::before { transform: translateX(-3px) rotate(-135deg); }
.back-link { display: inline-flex; align-items: center; gap: 0.5em; }
.side-more { margin-top: var(--s-3); }

/* A quorum notice — officials may attend an event — is set quieter than a
   meeting a resident can take part in. */
.entry.quorum h3 { font-weight: 420; font-style: italic; color: var(--ink-2); }

.side-lookup .vote-form { margin-top: 0; }
.side-lookup .url-row input { font-size: 16px !important; }

/* ------------------------------------------------------------- plates */

/* Period illustrations, printed as ink on the page's paper colour. */
.plate { margin: 0; }
.plate img { display: block; width: 100%; height: auto; }
.plate figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-2) var(--s-4);
  flex-wrap: wrap;
  margin-top: 6px;
}
.plate-caption { font-family: var(--display); font-style: italic; font-size: 14.5px; color: var(--ink-2); }
.plate-credit { font-family: var(--sans); font-size: 11.5px; color: var(--muted); text-decoration: none; }
.plate-credit:hover { color: var(--accent); text-decoration: underline; }

/* Home: the 1867 view as a band under the masthead, ruled like a plate. */
.plate-band { margin-top: var(--s-5); }
.plate-band img {
  height: clamp(130px, 21vw, 250px);
  object-fit: cover;
  object-position: 50% 58%;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

/* Level pages: a section front. The title and its counts on the left, the
   building that level sits in on the right, every plate the same height so
   the five pages print alike; closed by a full ink rule. */
.level-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 46%);
  gap: var(--s-6);
  align-items: center;
  border-bottom: 1px solid var(--ink);
}
.level-title .lead { margin-top: var(--s-4); }
.level-head .plate img { width: auto; max-width: 100%; height: auto; max-height: 300px; margin: 0 auto; }
.level-head .plate figcaption { justify-content: center; text-align: center; flex-direction: column; align-items: center; gap: 2px; }
@media (max-width: 760px) {
  .level-head { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
  .level-head .plate { order: -1; }
  .level-head .plate img { max-height: 220px; }
}

/* In-page links (#run, #vote) land below the sticky menu bar, not under it. */
html { scroll-padding-top: 64px; }

/* Level pages: the guide reads down the main column; offices and the next
   meetings sit in the rail. */
.level-guide { max-width: var(--measure); }
.level-guide > :first-child { margin-top: 0; }
.level-sub {
  margin: var(--s-7) 0 var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--ink);
  font-family: var(--display);
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.level-list { padding-left: var(--s-5); }
.level-list li { margin-bottom: var(--s-3); }
.body-links { list-style: none; margin: 0; padding: 0; }
.body-links li { padding: var(--s-3) 0; border-top: 1px solid var(--rule); }
.body-links li:first-child { border-top: 0; padding-top: 0; }
.body-links a { display: block; font-family: var(--display); font-size: 17.5px; font-weight: 500; color: var(--ink); text-decoration: none; line-height: 1.3; }
.body-links a:hover { color: var(--accent); }
.side-counts { margin: 0 0 var(--s-3); font-family: var(--sans); font-size: 12.5px; color: var(--muted); }
.next-list a { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; padding: var(--s-3) 0; color: var(--ink); text-decoration: none; }
.next-list a:hover .next-title { color: var(--accent); }
.next-day { font-family: var(--sans); font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.next-title { font-size: 16px; line-height: 1.35; }
.next-list .cancelled .next-title { text-decoration: line-through; color: var(--muted); }
