/* Publick town site styles.
   Mobile first. The colors below are the defaults; a town sets its own in
   [site.colors] and the build appends them (pipeline/config.py). Type is
   Public Sans, served from this site.
   Accessibility: sizes in rem so text scales; text and UI colors meet WCAG AA
   contrast; tap targets are at least 44px; focus is always visible. */

@font-face { font-family: "Public Sans"; font-weight: 400; font-display: swap; src: url(/static/fonts/public-sans-400.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 600; font-display: swap; src: url(/static/fonts/public-sans-600.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 700; font-display: swap; src: url(/static/fonts/public-sans-700.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 800; font-display: swap; src: url(/static/fonts/public-sans-800.woff2) format("woff2"); }
/* Headlines: Source Serif 4 (SIL Open Font License), served from this site. */
@font-face { font-family: "Source Serif 4"; font-weight: 600; font-display: swap; src: url(/static/fonts/source-serif-4-600.woff2) format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 700; font-display: swap; src: url(/static/fonts/source-serif-4-700.woff2) format("woff2"); }

:root {
  --primary: #1e3e80;       /* town: links, buttons, map markers */
  --primary-dark: #011536;  /* town: headings, rules, masthead */
  --accent: #581824;        /* town: current page in the menu, flags, notices */
  --network: #2c4a63;       /* Publick slate: the network's name in the masthead */
  --primary-soft: #e8edf6;
  --ink: #1b1f24;
  --muted: #545c65;
  --ink-soft: #3d444c;      /* notes that carry meaning: darker than muted */
  --line: #d6dbe1;
  --line-strong: #6b7580;
  --soft: #f3f5f8;
  --bg: #ffffff;
  --focus: #b3450b;
  --warn-bg: #fff3d1;
  --warn-text: #5c3d00;
  --warn-line: #b88300;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --measure: 68ch;
  --gutter: 1rem;
}

/* ---- Base ---- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}
.wrap { width: 100%; max-width: 64rem; margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3 { color: var(--primary-dark); }
h1, h2 { font-family: var(--serif); letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 1.5rem + 1.8vw, 2.6rem); line-height: 1.12; font-weight: 700; margin: 0 0 0.4rem; }
h2 { font-size: 1.5rem; line-height: 1.2; font-weight: 700; margin: 2.25rem 0 0.75rem; }
h3 { font-size: 1.05rem; line-height: 1.3; font-weight: 700; margin: 2rem 0 0.5rem; }
/* Each section starts with a rule and space above, so a page reads as separate blocks. */
main h2 { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.section-head { padding-top: 1.5rem; border-top: 1px solid var(--line); }
.section-head h2, .toc h2, .callout h2 { margin-top: 0; padding-top: 0; border-top: 0; }
.section-head > a { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 600; }
p, main li { max-width: var(--measure); }
main li + li { margin-top: 0.3rem; }

a { color: var(--primary); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
main:focus { outline: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 0.5rem; top: -10rem; z-index: 100;
  padding: 0.75rem 1rem; background: var(--bg); color: var(--primary); font-weight: 700;
  border: 2px solid var(--primary);
}
.skip-link:focus { top: 0.5rem; }

/* Links that open a new tab: an arrow here, hidden text for screen readers. */
a.external::after { content: "\2009\2197"; font-size: 0.85em; }

/* ---- Header: a masthead and a section bar, like a paper's front page ---- */

.site-header { background: var(--bg); }
.masthead { padding: 1.1rem var(--gutter) 0.8rem; }
.brand {
  display: inline-block; color: var(--primary-dark); text-decoration: none;
  font-family: var(--serif); font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.3rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.01em;
}
.brand span { color: var(--network); }
.brand:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.masthead-line { margin: 0.3rem 0 0; color: var(--ink-soft); font-size: 0.95rem; }

.site-nav { border-top: 1px solid var(--primary-dark); border-bottom: 4px double var(--primary-dark); }
.nav-list { display: flex; flex-wrap: wrap; column-gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.nav-list a {
  display: flex; align-items: center; min-height: 2.75rem;
  color: var(--ink); font-weight: 600; font-size: 0.95rem; text-decoration: none;
  border-bottom: 3px solid transparent;
}
.nav-list a:hover { color: var(--primary); border-bottom-color: var(--line-strong); }
.nav-list a[aria-current] { color: var(--accent); border-bottom-color: currentColor; }
@media (min-width: 40rem) { .nav-list { column-gap: 1.75rem; } }

/* ---- Page ---- */

main { display: block; padding: 1.25rem 0 3rem; }
@media (min-width: 48rem) { main { padding-top: 2rem; } }
.dateline { margin: 0 0 0.25rem; color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.lede { color: var(--muted); font-size: 1.05rem; margin: 0 0 1rem; }
.page-head { margin-bottom: 1.25rem; }
.source-note { color: var(--muted); font-size: 0.875rem; }
.small { color: var(--ink-soft); font-size: 0.9375rem; line-height: 1.5; }
.note {
  padding: 0.75rem 1rem; border-left: 4px solid var(--warn-line);
  background: var(--warn-bg); color: var(--warn-text);
}
.credit { margin: 1.25rem 0; padding-left: 0.75rem; border-left: 3px solid var(--line); color: var(--muted); font-size: 0.875rem; }
.credit p { margin: 0; }
.report-link {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.75rem; margin-top: 0.5rem; padding: 0 0.85rem;
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); font-size: 0.875rem; font-weight: 600; text-decoration: none;
}
.report-link svg { color: var(--accent); flex: none; }
.report-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: underline; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; margin: 3rem 0 0.5rem; }
.section-head h2 { margin: 0; }
.link-row { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0.6rem 0 0; padding: 0; list-style: none; font-size: 0.9rem; }
main .link-row li + li { margin-top: 0; }
.link-row a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.more { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 700; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.9rem; padding: 0 1.1rem; border: 1.5px solid var(--primary); border-radius: 0;
  color: var(--primary); background: var(--bg); font-weight: 700; text-decoration: none;
}
.button:hover { background: var(--primary-soft); }
.button-primary { background: var(--primary); color: #fff; }
.button-primary:hover { background: var(--primary-dark); }
@media (max-width: 30rem) { .actions .button { flex: 1 1 100%; } }

/* Street lookup box on the home page */
.street-box { margin: 1.25rem 0 0; padding: 1rem; border: 1px solid var(--line); border-left: 4px solid var(--primary); background: var(--soft); }
.street-box label { display: block; margin-bottom: 0.4rem; font-family: var(--serif); font-size: 1.2rem; font-weight: 700; color: var(--primary-dark); }
.street-box .small { margin: 0.5rem 0 0; }

/* Meeting search */
.search-form { margin: 1.25rem 0 0; }
.search-form label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.search-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.search-row input {
  flex: 1 1 12rem; min-width: 0; min-height: 2.9rem; padding: 0 0.75rem;
  border: 1.5px solid var(--line-strong); border-radius: 0; font: inherit; color: var(--ink); background: var(--bg);
}
.search-results { padding-left: 0; list-style: none; }
.search-results > li { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.search-results > li + li { margin-top: 0; }
.search-results .excerpt { margin: 0.35rem 0 0; font-size: 0.95rem; }
.search-results mark { background: #fff1a8; color: inherit; font-weight: 600; }

/* Status words: plain text with a marker, never color alone. */
.flag { font-weight: 700; color: var(--accent); }
.status { display: inline-block; font-size: 0.85rem; font-weight: 700; color: var(--muted); }

/* ---- Headline numbers ---- */

.stats {
  display: grid; grid-template-columns: 1fr 1fr;
  margin: 1rem 0 0.5rem; padding: 0; list-style: none;
  border-top: 2px solid var(--primary-dark);
}
main .stats > li { max-width: none; margin: 0; }
.stat { border-bottom: 1px solid var(--line); }
.stat:nth-child(odd) { border-right: 1px solid var(--line); }
.stat > a, .stat > div { display: block; height: 100%; padding: 1rem 0.75rem 1.1rem 0; color: inherit; text-decoration: none; }
.stat:nth-child(even) > a, .stat:nth-child(even) > div { padding-left: 0.85rem; }
.stat > a:hover .stat-value { text-decoration: underline; text-decoration-thickness: 2px; }
.stat-label { display: block; min-height: 2.6em; color: var(--ink-soft); font-size: 0.9rem; font-weight: 700; line-height: 1.3; }
.stat-value {
  display: block; margin: 0.25rem 0; color: var(--primary-dark); font-family: var(--serif); font-size: 2.1rem; font-weight: 700;
  line-height: 1.1; letter-spacing: -0.01em;
}
.stat-change { display: block; font-size: 0.9rem; line-height: 1.4; }
.stat-source { display: block; margin-top: 0.3rem; color: var(--muted); font-size: 0.8125rem; line-height: 1.4; }
@media (min-width: 48rem) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stat { border-right: 1px solid var(--line); }
  .stat:last-child { border-right: 0; }
  .stat > a, .stat > div { padding-left: 0.85rem; }
  .stat:first-child > a, .stat:first-child > div { padding-left: 0; }
}

/* ---- Meetings ---- */

.day-heading {
  margin: 1.75rem 0 0; padding-bottom: 0.35rem; border-bottom: 1px solid var(--line);
  color: var(--accent); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.meeting-list { margin: 0; padding: 0; list-style: none; }
main .meeting-list > li { max-width: none; margin: 0; }
.meeting-item { display: grid; grid-template-columns: 5rem 1fr; gap: 0.1rem 0.75rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.meeting-when { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meeting-link { font-weight: 700; color: var(--primary-dark); text-decoration: none; }
.meeting-link:hover { text-decoration: underline; color: var(--primary); }
.meeting-main { min-width: 0; }
.meeting-preview {
  margin: 0.25rem 0 0; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.meeting-meta { display: block; margin-top: 0.3rem; color: var(--muted); font-size: 0.875rem; }
.meeting-meta .flag { color: var(--accent); }
@media (max-width: 22rem) { .meeting-item { grid-template-columns: 1fr; } }

/* Decisions: one block per meeting, its votes as a plain list. */
.decision-list { margin: 0; padding: 0; list-style: none; }
main .decision-list > li { max-width: none; margin: 0; }
.decision-meeting { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.decision-meeting h3 { margin: 0; }
.decision-meeting h3 a { color: var(--primary-dark); text-decoration: none; }
.decision-meeting h3 a:hover { text-decoration: underline; }
.decision-meeting > .item-detail { margin: 0.2rem 0 0.6rem; }
.decision-meeting ul { margin: 0; padding-left: 1.25rem; }
.decision-meeting details.expand { margin-top: 0.5rem; border-top: 0; padding: 0; }
.decision-label { margin: 0.9rem 0 0.2rem; color: var(--ink-soft); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }

.board-list { margin: 0; padding: 0; list-style: none; columns: 1; }
@media (min-width: 48rem) { .board-list { columns: 2; column-gap: 2rem; } }
main .board-list > li { max-width: none; margin: 0; break-inside: avoid; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.board-list a { font-weight: 700; color: var(--primary-dark); }
.board-list .meta { display: block; color: var(--muted); font-size: 0.875rem; }

dl.facts { margin: 0.5rem 0 0; border-top: 1px solid var(--line); }
dl.facts > div { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
dl.facts dt { color: var(--ink-soft); font-size: 0.875rem; font-weight: 700; }
dl.facts dd { margin: 0.1rem 0 0; }
@media (min-width: 40rem) {
  dl.facts > div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; }
  dl.facts dd { margin: 0; }
}

.breadcrumb ol { display: flex; flex-wrap: wrap; margin: 0 0 0.6rem; padding: 0; list-style: none; font-size: 0.9rem; }
main .breadcrumb li + li { margin-top: 0; }
.breadcrumb li + li::before { content: "/"; margin: 0 0.45rem; color: var(--muted); }
.breadcrumb a { display: inline-block; padding: 0.3rem 0; font-weight: 600; }

details.expand { margin: 1rem 0 0; padding: 0.25rem 0; border-top: 1px solid var(--line); }
details.expand[open] { padding-bottom: 0.75rem; }
/* A chart's own links sit right under its table toggle, as one footer. */
details.expand + .link-row { margin-top: 0; }
details.expand > summary {
  display: flex; align-items: center; min-height: 2.75rem;
  color: var(--primary); font-weight: 700; cursor: pointer;
}
.transcript-body { padding-top: 0.25rem; }
.transcript-body h3, .transcript-body h4, .transcript-body h5 { font-size: 1rem; }

.timeline { margin: 0; padding: 0; list-style: none; }
main .timeline li + li { margin-top: 0.6rem; }
.timeline li { padding-left: 0.75rem; border-left: 3px solid var(--line); }
.timeline time { display: block; color: var(--muted); font-size: 0.85rem; font-weight: 600; }

.toc { margin: 1.25rem 0; padding: 0.75rem 1rem; background: var(--soft); }
.toc h2 { font-size: 1rem; margin: 0 0 0.25rem; }
.toc ul { margin: 0; padding-left: 1.2rem; }
.toc a { display: inline-block; padding: 0.15rem 0; }

/* ---- Charts and tables ---- */

figure.chart { margin: 0.75rem 0 0; }
.columns { display: flex; align-items: flex-end; gap: 4px; height: 10rem; border-bottom: 1px solid var(--ink); }
.columns .col { flex: 1; min-height: 2px; background: var(--primary); border-radius: 2px 2px 0 0; }
.columns .col.recent { background: repeating-linear-gradient(45deg, var(--primary), var(--primary) 3px, #6f86b8 3px, #6f86b8 6px); }
.columns .col.noted { background: var(--accent); }
.col-labels { display: flex; gap: 4px; margin-top: 0.3rem; color: var(--muted); font-size: 0.8rem; }
.col-labels span { flex: 1; text-align: center; }
.chart-key { margin: 0.5rem 0 0; color: var(--ink-soft); font-size: 0.9rem; }

.hbars { margin: 0.5rem 0 0; padding: 0; list-style: none; }
main .hbars > li { max-width: none; margin: 0; }
.hbar { display: grid; grid-template-columns: 5.5rem 1fr 3.5rem; align-items: center; gap: 0.6rem; padding: 0.3rem 0; font-size: 0.95rem; }
.hbar .bar { height: 0.85rem; min-width: 2px; background: var(--primary); border-radius: 2px; }
.hbar .n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.hbars.wide-n .hbar { grid-template-columns: 5.5rem 1fr auto; }
.hbars.wide-n .n { white-space: nowrap; }
.hbar a { font-weight: 600; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 0.65rem 0.5rem 0.65rem 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table thead th {
  border-bottom: 2px solid var(--primary-dark); color: var(--muted);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
}
.data-table tbody th { font-weight: 600; }
.data-table .cell-note { font-weight: 400; font-size: 0.875rem; }
.data-table .moe { display: block; color: var(--muted); }
.data-table .num { text-align: right; white-space: nowrap; }
.data-table thead th.num { white-space: normal; }
.data-table .wide { display: none; }
@media (min-width: 48rem) {
  .data-table .wide { display: table-cell; }
  .data-table th, .data-table td { padding-right: 0.75rem; }
}

.notes-list { padding-left: 1.4rem; font-size: 0.9rem; }
.note-ref {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.5rem; min-height: 1.5rem;
  margin-left: 0.2rem; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  font-size: 0.75rem; font-weight: 700; text-decoration: none; vertical-align: middle;
}
.plain-list { padding-left: 1.4rem; }
main .plain-list > li + li { margin-top: 0.75rem; }
.item-detail { display: block; color: var(--ink-soft); font-size: 0.95rem; }

/* "On this page": a plain contents line under a long page's numbers. */
.jump { margin: 1.5rem 0 0; padding: 0.4rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.jump ul { display: flex; flex-wrap: wrap; column-gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
main .jump li + li { margin-top: 0; }
.jump a { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 600; }
.jump-label { margin: 0.25rem 0 0; color: var(--ink-soft); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---- Footer ---- */

.site-footer { border-top: 1px solid var(--line); background: var(--soft); color: var(--muted); font-size: 0.9rem; padding: 1.5rem 0 2rem; }
.footer-brand { margin: 0 0 0.25rem; color: var(--primary-dark); font-weight: 800; }
.site-footer p { margin: 0 0 0.5rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin: 0.5rem 0 0; padding: 0; list-style: none; }
.footer-links a { display: inline-flex; align-items: center; min-height: 2.75rem; }

/* ---- Preferences and print ---- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media print {
  body { font-size: 11pt; }
  .topline, .site-nav, .skip-link, .actions, .link-row, .footer-links, .more, .jump { display: none !important; }
  .site-header { border: 0; }
  h2 { break-after: avoid; }
  figure.chart, .data-table tr { break-inside: avoid; }
  .columns .col, .hbar .bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
  a.external::after { content: ""; }
}
.meeting-item.single { grid-template-columns: 1fr; }
dl.defs { margin: 0.5rem 0 1rem; }
dl.defs dt { margin-top: 0.9rem; font-weight: 700; color: var(--primary-dark); }
dl.defs dd { margin: 0.15rem 0 0; max-width: var(--measure); }
.stat a.external::after { content: none; }

/* ---- Maps ---- */
.map {
  height: 22rem; margin: 0.75rem 0 0; isolation: isolate;
  border: 1px solid var(--line); background: var(--primary-soft);
}
@media (max-width: 30rem) { .map { height: 18rem; } }
.map.leaflet-container { font: inherit; font-size: 0.9rem; }
.map .leaflet-popup-content { margin: 0.75rem 1rem; line-height: 1.4; }
.map .leaflet-popup-content p { margin: 0.25rem 0 0.4rem; }
.map .leaflet-popup-content a { color: var(--primary); }
.map .leaflet-control-attribution a { color: var(--primary); }

/* ---- Notice: a public hearing or other chance to take part ---- */
.notice { margin: 1rem 0 0.5rem; padding: 0.9rem 1rem 0.6rem; border: 1px solid var(--accent); border-top-width: 4px; background: var(--bg); }
.notice h3 { margin: 0 0 0.25rem; color: var(--accent); }
.notice .plain-list { margin: 0.4rem 0 0; }
.notice > p { margin: 0 0 0.3rem; }

/* ---- Callout ---- */
.callout {
  margin: 1.25rem 0 1.5rem; padding: 1rem 1.1rem;
  border-left: 4px solid var(--primary);
  background: var(--soft);
}
.callout p { margin: 0; }
.callout .actions { margin: 0.8rem 0 0; }

/* Manchester Publick colors, from [site.colors] in config/manchester.toml. */
:root {
  --primary: #12469a;
  --primary-dark: #14284b;
  --primary-soft: #e7eef9;
  --accent: #7c2629;
  --network: #2c4a63;
}
