/* ContactMyMuni — single stylesheet, no build step, light + dark. */

/*
 * Colour system
 * -------------
 * Three rules keep this from turning into a wash of one hue:
 *
 * 1. Surfaces are genuinely neutral. Tinting the background with the brand hue
 *    leaves an accent nothing to stand against.
 * 2. The brand green marks interaction only — links, the primary button, focus,
 *    the logo. It is not used for headings, figures or labels.
 * 3. Green/amber/red mean status and nothing else, so a colour on the page is
 *    always a judgement about a municipality rather than decoration.
 *
 * Roughly 60% neutral surface, 30% structure, 10% colour.
 */
:root {
  color-scheme: light;

  /* Neutrals */
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --border: #dee2e7;
  --border-strong: #c6ccd4;
  --text: #161b21;
  --text-muted: #5b6672;

  /* Brand — interaction only */
  --brand: #0b6b4f;
  --brand-hover: #085740;
  --brand-on: #ffffff;
  --link: #0a6349;

  /* Status — never used decoratively */
  --ok: #177349; /* darkened from #1a7f52 to clear 4.5:1 against --ok-bg at badge size */
  --ok-bg: #e7f4ed;
  --ok-border: #b3ddc7;
  --warn: #8a6100;
  --warn-bg: #fbf1dc;
  --warn-border: #e6cf9b;
  --danger: #b02a20;
  --danger-bg: #fbeae8;
  --danger-border: #eeb7b1;

  --shadow: 0 1px 2px rgba(20, 26, 33, .05), 0 4px 12px rgba(20, 26, 33, .05);
  --radius: 12px;
  --wrap: 1100px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: #0f1216;
    --surface: #171b21;
    --surface-2: #1f242b;
    --border: #2b323a;
    --border-strong: #3d4650;
    --text: #e7eaee;
    --text-muted: #98a2ae;

    --brand: #35c48f;
    --brand-hover: #5ad4a7;
    --brand-on: #06231a;
    --link: #5fd3a7;

    --ok: #4ecf9a;
    --ok-bg: #12291f;
    --ok-border: #23503b;
    --warn: #e2b458;
    --warn-bg: #2b2312;
    --warn-border: #574526;
    --danger: #ff8f83;
    --danger-bg: #2d1917;
    --danger-border: #5c2f2a;

    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 4px 14px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.5rem); }
h2 { font-size: clamp(1.2rem, 1.05rem + .6vw, 1.5rem); }
p { margin: 0 0 1em; }

a { color: var(--link); text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.wrap.narrow { max-width: 760px; }
.muted { color: var(--text-muted); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--surface); padding: 10px 16px; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

.icon { width: 1.05em; height: 1.05em; flex: none; }

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------------------------------------------------------- header */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex; align-items: center; gap: 14px;
  min-height: 62px; flex-wrap: wrap;
}

.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 1.05rem; color: var(--text); text-decoration: none; font-weight: 600; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: var(--brand-on); }
.brand-mark svg { width: 17px; height: 17px; }
.brand-text strong { color: var(--brand); font-weight: 700; }

.site-nav { display: flex; gap: 18px; margin-left: auto; font-size: .93rem; }
.site-nav a { color: var(--text-muted); text-decoration: none; }
.site-nav a:hover { color: var(--text); }

.header-search { position: relative; width: 210px; }

.lang-switch { display: flex; align-items: center; gap: 2px; font-size: .82rem; }
.lang-switch a {
  color: var(--text-muted); text-decoration: none; padding: 3px 7px;
  border-radius: 6px; white-space: nowrap;
}
.lang-switch a:hover { color: var(--text); background: var(--surface-2); }
.lang-switch a[aria-current="true"] { color: var(--text); font-weight: 650; }

.review-banner {
  background: var(--warn-bg); color: var(--warn);
  border-bottom: 1px solid var(--warn-border);
  font-size: .85rem; text-align: center; padding: 8px 20px;
}

@media (max-width: 760px) {
  .header-inner { min-height: 56px; }
  .site-nav { order: 3; width: 100%; margin-left: 0; padding-bottom: 10px; overflow-x: auto; }
  .header-search { margin-left: auto; width: 130px; }
  .lang-switch { order: 2; font-size: .78rem; }
}

/* ---------------------------------------------------------- search */

.search-field {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 0 16px; box-shadow: var(--shadow);
}
.search-field .icon { color: var(--text-muted); }
.search-field input {
  flex: 1; min-width: 0; border: 0; background: none; outline: none;
  font: inherit; color: var(--text); padding: 14px 0;
}
.search-field input::-webkit-search-cancel-button { cursor: pointer; }
.search-field.compact { padding: 0 12px; box-shadow: none; background: var(--surface-2); }
.search-field.compact input { padding: 8px 0; font-size: .9rem; }
.search-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }

.search-results {
  position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; max-height: 60vh; overflow-y: auto;
}
.header-search .search-results { width: 320px; left: auto; }

.search-result {
  display: block; padding: 10px 14px; text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover, .search-result.is-active { background: var(--surface-2); }
.search-result mark { background: color-mix(in srgb, var(--brand) 20%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; font-weight: 700; }
.sr-name { display: block; font-weight: 600; font-size: .95rem; }
.sr-meta { display: block; font-size: .82rem; color: var(--text-muted); }
.search-empty { padding: 14px; color: var(--text-muted); font-size: .9rem; }
.sr-tag {
  font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 1px 6px; border-radius: 999px; vertical-align: middle;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ------------------------------------------------------------ hero */

.hero { padding: clamp(40px, 6vw, 76px) 0 28px; text-align: center; }
.hero h1 { max-width: 18ch; margin-inline: auto; }
.hero-sub { max-width: 60ch; margin-inline: auto; color: var(--text-muted); font-size: 1.05rem; }
.hero-search { position: relative; max-width: 620px; margin: 28px auto 10px; text-align: left; }
.hero-hint { font-size: .87rem; }

/* ----------------------------------------------------------- stats */

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; margin-bottom: 8px;
}
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; text-align: center;
}
.stat-value { display: block; font-size: 1.6rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat-label { display: block; font-size: .85rem; color: var(--text-muted); }

/* --------------------------------------------------------- layout */

/* margin-block, not the `margin: X 0` shorthand — this class is combined with .wrap
   on the home page, and a shorthand would reset that wrapper's `margin-inline: auto`
   and pin the whole block to the left edge. */
.section { margin-block: clamp(36px, 5vw, 56px); }
.section-sub { margin-top: -.4em; font-size: .93rem; }
.page-header { margin: 8px 0 28px; }
.lede { font-size: 1.05rem; color: var(--text-muted); max-width: 65ch; }

.breadcrumbs { padding: 16px 0 0; font-size: .85rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; color: var(--text-muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: 6px; opacity: .6; }
.breadcrumbs a { color: var(--text-muted); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: clamp(18px, 3vw, 26px); margin-bottom: 20px;
}
.callout { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); }
.callout h2 { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------- grids */

.province-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; }
.province-card {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s;
}
.province-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.province-name { font-weight: 620; }
.province-count, .province-breakdown { font-size: .84rem; }

.muni-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.muni-card {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s;
}
.muni-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.muni-card-head { display: flex; align-items: baseline; gap: 8px; justify-content: space-between; }
.muni-card-name { font-weight: 620; }
.muni-card-meta { font-size: .82rem; color: var(--text-muted); }
.muni-card-phone { display: inline-flex; align-items: center; gap: 6px; font-size: .87rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.badge {
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 999px; white-space: nowrap;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}
.badge.cat-A { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); font-weight: 700; }
.badge.cat-C { background: transparent; color: var(--text-muted); border-style: dashed; }

.district-block h2 { font-size: 1.15rem; }
.district-block h2 a { text-decoration: none; }
.district-block h2 a:hover { text-decoration: underline; }

/* --------------------------------------------------- municipality */

.muni-page { padding-bottom: 40px; }
.muni-header { display: flex; align-items: flex-start; gap: 16px; justify-content: space-between; margin: 10px 0 20px; }
.muni-header h1 { margin-bottom: .15em; }
.muni-subtitle { color: var(--text-muted); margin: 0; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; font-size: .93rem; font-weight: 550;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  text-decoration: none; cursor: pointer; font-family: inherit; transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-on); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
@media (prefers-color-scheme: dark) { .btn-primary { color: #06231a; } }
.btn-ghost { background: none; }
/* Trailing external-link glyph sits quieter than the leading icon. */
.btn .icon:last-child { width: .85em; height: .85em; opacity: .6; margin-left: -2px; }

.contact-card h2, .card h2 { margin-top: 0; }

.contact-rows { margin: 0; display: grid; gap: 2px; }
.contact-row { display: grid; grid-template-columns: 190px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); align-items: start; }
.contact-row:first-child { border-top: 0; padding-top: 0; }
.contact-row dt { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: .92rem; }
.contact-row dd { margin: 0; display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.contact-row dd a { font-weight: 550; word-break: break-word; }
.row-note { display: block; width: 100%; font-size: .85rem; }

@media (max-width: 620px) {
  .contact-row { grid-template-columns: 1fr; gap: 2px; }
  .muni-header { flex-direction: column-reverse; align-items: flex-start; }
}

.copy {
  font: inherit; font-size: .74rem; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted);
  cursor: pointer; opacity: 0; transition: opacity .15s;
}
.contact-row:hover .copy, .copy:focus-visible { opacity: 1; }
@media (hover: none) { .copy { opacity: 1; } }
.copy:hover { color: var(--text); border-color: var(--border-strong); }
.copy.copied { color: var(--ok); border-color: var(--ok-border); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 0; }
.facts > div { min-width: 0; }
.facts dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.facts dd { margin: 2px 0 0; }

.notice { background: var(--surface-2); }

/* ------------------------------------------------------------ audit */

/* Tones carry meaning, so each is paired with a text label — never colour alone. */
.audit-badge {
  display: inline-block;
  font-size: .78rem; font-weight: 700; letter-spacing: .02em;
  padding: 4px 12px; border-radius: 999px; white-space: nowrap;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}
.audit-badge.tone-good { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border); }
.audit-badge.tone-ok   { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border); }
.audit-badge.tone-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.audit-badge.tone-bad  { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }

.audit-card { border-left: 3px solid var(--border); }
.audit-card.tone-good, .audit-card.tone-ok { border-left-color: var(--ok); }
.audit-card.tone-warn { border-left-color: var(--warn); }
.audit-card.tone-bad { border-left-color: var(--danger); }

.audit-headline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: .6em; }
.audit-year { font-size: .88rem; }
.audit-blurb { margin-bottom: 1em; }
.audit-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 1em; }
.audit-source { font-size: .84rem; margin: 0; }
.audit-missing { font-size: .88rem; margin: 0 0 1em; }

/* The primary card carries a little elevation so the page has one clear focus;
   every other card stays flat. */
.contact-card { box-shadow: var(--shadow); }

.audit-summary { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin-bottom: 30px; }
.audit-stat {
  background: var(--surface); border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  border-radius: var(--radius); padding: 16px; text-align: center;
}
.audit-stat.tone-good, .audit-stat.tone-ok { border-top-color: var(--ok); }
.audit-stat.tone-warn { border-top-color: var(--warn); }
.audit-stat.tone-bad { border-top-color: var(--danger); }

/* .stat-value is green by default, which would print a serious outcome in the
   colour of a good one — keep the figure and its border telling the same story. */
.audit-stat.tone-warn .stat-value { color: var(--warn); }
.audit-stat.tone-bad .stat-value { color: var(--danger); }
.audit-stat.tone-none .stat-value { color: var(--text-muted); }
.audit-stat.tone-good .stat-value, .audit-stat.tone-ok .stat-value { color: var(--ok); }
.audit-count { font-size: .9rem; font-weight: 400; }

/* ------------------------------------------------------------ towns */

/* Sixty bordered chips read as sixty buttons. These are reference text, so they
   are set as a plain separated list and kept quiet. */
.town-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap;
  font-size: .92rem; color: var(--text-muted); line-height: 1.9;
}
.town-list li:not(:last-child)::after {
  content: "·"; margin: 0 9px; color: var(--border-strong);
}
.town-more { margin-top: 12px; }
.town-more summary {
  cursor: pointer; font-size: .88rem; color: var(--link);
  padding: 4px 0; width: fit-content;
}
.town-more summary:hover { text-decoration: underline; }
.town-more[open] summary { margin-bottom: 12px; }

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

.person-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }

.person-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.person-head { display: flex; flex-direction: column; gap: 1px; }
.person-role {
  margin: 0; font-size: .74rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
}
.person-name { margin: 0; font-size: 1.08rem; font-weight: 620; }
.person-blurb { margin: 0; font-size: .86rem; line-height: 1.5; }

.person-links { display: flex; flex-direction: column; gap: 5px; }
.person-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .89rem; text-decoration: none; word-break: break-word;
}
a.person-link:hover { text-decoration: underline; }
.person-link .icon { color: var(--text-muted); }

.person-secretary {
  border-top: 1px dashed var(--border); padding-top: 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.secretary-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }
.secretary-name { font-size: .93rem; font-weight: 550; }

/* ------------------------------------------------------- directory */

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filters .search-field { flex: 1 1 240px; }
.filters select {
  font: inherit; padding: 11px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.result-count { font-size: .87rem; margin-bottom: 10px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.directory { width: 100%; border-collapse: collapse; min-width: 720px; font-size: .93rem; }
.directory th, .directory td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
/* The wrapper is its own scroll container, so `top` is measured from the wrapper,
   not the viewport — any offset here would overlap the first row. */
.directory th { background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); position: sticky; top: 0; z-index: 1; }
.directory tbody tr:last-child td { border-bottom: 0; }
.directory tbody tr:hover { background: var(--surface-2); }
.directory td a { font-weight: 550; text-decoration: none; }
.directory td a:hover { text-decoration: underline; }
.td-sub { display: block; font-size: .8rem; }
.empty-state { padding: 30px; text-align: center; color: var(--text-muted); }

/* ----------------------------------------------------------- form */

.form .field { margin-bottom: 16px; }
.form label { display: block; font-size: .9rem; font-weight: 550; margin-bottom: 5px; }
.form input, .form select, .form textarea {
  width: 100%; font: inherit; padding: 11px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.form textarea { resize: vertical; }

/* ------------------------------------------------------- escalate */

.contact-box {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius); padding: 14px 18px; margin: 0 0 1.4em;
}
.contact-box-title { font-weight: 650; margin: 0 0 .2em; }
.contact-box p:last-child { margin: 0; }

.templates { margin: 0 0 2em; }
.template {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px;
}
.template h3 { margin-bottom: .25em; font-size: 1.05rem; }
.template-when { font-size: .9rem; margin-bottom: .9em; }
.template-head { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.template-head .copy { opacity: 1; font-size: .8rem; padding: 5px 12px; }

.template-body {
  margin: 0; padding: 16px; overflow-x: auto;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}

.disclaimer {
  font-size: .87rem; border-top: 1px solid var(--border); padding-top: 14px;
}

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

.prose h2 { margin-top: 1.8em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .5em; }
.prose code { background: var(--surface-2); padding: 2px 6px; border-radius: 5px; font-size: .9em; }
.prose .facts { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }

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

.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 50px; padding: 34px 0 30px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.footer-brand { font-weight: 650; margin: 0; }
.footer-inner p { margin: 0; font-size: .9rem; }
.footer-inner nav { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.footer-inner nav a { color: var(--text-muted); text-decoration: none; }
.footer-inner nav a:hover { color: var(--text); }
.footer-note { margin-top: 24px; font-size: .82rem; }
/* Cap the measure on the paragraph, not on the .wrap element itself — narrowing the
   wrapper would re-centre it instead of keeping it flush with the footer above. */
.footer-note p { margin: 0; max-width: 75ch; }

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

/* ----------------------------------------------------------- print */

.print-only { display: none; }

/*
 * Printing is a real use case here: contact sheets go up on community
 * noticeboards and counters. The goal is ink-cheap black on white, every detail
 * present (including the ones hidden behind "show more"), and nothing that only
 * works on screen — buttons, search, navigation.
 */
@media print {
  @page { margin: 15mm; }

  :root {
    --bg: #fff; --surface: #fff; --surface-2: #fff;
    --border: #999; --border-strong: #666;
    --text: #000; --text-muted: #333;
    --link: #000; --brand: #000;
    --ok: #000; --warn: #000; --danger: #000;
    --ok-bg: #fff; --warn-bg: #fff; --danger-bg: #fff;
    --shadow: none;
  }

  body { font-size: 11pt; line-height: 1.4; background: #fff; }

  .print-only { display: block; }
  .print-masthead {
    font-size: 8pt; text-transform: uppercase; letter-spacing: .08em;
    border-bottom: 1px solid #999; padding-bottom: 4pt; margin-bottom: 12pt;
  }
  .print-note {
    font-size: 8pt; color: #333;
    border-top: 1px solid #999; padding-top: 6pt; margin-top: 14pt;
  }

  /* Screen-only chrome */
  .site-header, .site-footer, .skip-link, .actions, .copy, .filters,
  .breadcrumbs, .hero-search, .hero-hint, .search-results, .result-count,
  .town-more summary, .audit-actions, .notice, .callout {
    display: none !important;
  }

  /* Content hidden behind interaction still needs to print. */
  .town-more, .town-more[open] { display: block !important; }
  .town-more ul { display: flex !important; }

  .wrap, .wrap.narrow { max-width: none; padding-inline: 0; }
  .card, .muni-card, .province-card, .person-card, .stat {
    border: 1px solid #999; box-shadow: none; background: #fff;
    break-inside: avoid; page-break-inside: avoid;
  }

  /* A 257-row table must be allowed to flow across pages — keeping it whole
     would push the entire directory past the first sheet. Rows stay intact and
     the header repeats on every page. */
  .table-wrap { border: 1px solid #999; overflow: visible; }
  .directory thead { display: table-header-group; }
  .directory tr { break-inside: avoid; page-break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; page-break-after: avoid; }
  h1 { font-size: 20pt; }
  h2 { font-size: 13pt; }

  /* A printed page cannot be clicked, so the destination has to be legible —
     but only where it is the information itself, not for every link. */
  .contact-row a[href^="http"]::after,
  .person-link[href^="http"]::after {
    content: " (" attr(href) ")"; font-size: 9pt; word-break: break-all;
  }
  a[href^="tel:"]::after, a[href^="mailto:"]::after { content: ""; }
  a { text-decoration: none; }

  .muni-grid, .person-grid, .province-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8pt;
  }
  .directory { min-width: 0; font-size: 9pt; }
  .directory th { background: #fff; border-bottom: 1px solid #666; }
  .audit-badge { border: 1px solid #666; font-weight: 700; }
  .audit-card { border-left: 3px solid #000; }
}
