/* ==========================================================================
   MARSH BEND TOWNSHIP — "Township Desk"
   Its own system. Utility-first and dense: a persistent navigation rail on
   desktop, tables and lists rather than cards, a tight spacing scale, square
   corners and hairline rules. Nothing here is shared with the other sites.
   ========================================================================== */

:root {
  --paper:      oklch(99% 0.003 250);
  --panel:      oklch(100% 0 0);
  --sunk:       oklch(96.5% 0.006 250);
  --ink:        oklch(19% 0.012 255);
  --ink-2:      oklch(45% 0.015 255);
  --ink-3:      oklch(60% 0.012 255);
  --rule:       oklch(88% 0.01 250);
  --rule-hard:  oklch(74% 0.015 250);
  --blue:       oklch(48% 0.10 253);
  --blue-deep:  oklch(33% 0.09 253);
  --blue-wash:  oklch(95% 0.018 253);
  --green:      oklch(45% 0.09 160);
  --green-wash: oklch(94% 0.02 160);
  --amber-wash: oklch(95% 0.04 85);
  --amber-ink:  oklch(42% 0.09 70);

  --ff-head: 'Archivo', system-ui, sans-serif;
  --ff-text: 'Work Sans', system-ui, -apple-system, sans-serif;

  /* deliberately tighter than a marketing site — this is a services desk */
  --u1: 4px; --u2: 6px; --u3: 10px; --u4: 14px; --u5: 20px;
  --u6: 28px; --u7: 40px; --u8: 56px;

  --t-xs: 0.75rem;
  --t-sm: 0.8125rem;
  --t-md: 0.9375rem;
  --t-lg: clamp(1rem, 0.97rem + 0.16vw, 1.0625rem);
  --t-h3: clamp(1.0625rem, 1.01rem + 0.27vw, 1.1875rem);
  --t-h2: clamp(1.25rem, 1.14rem + 0.55vw, 1.5rem);
  --t-h1: clamp(1.5rem, 1.28rem + 1.06vw, 2.125rem);

  --rail: 232px;
  --page: 1240px;
  --pad: clamp(14px, 3.2vw, 28px);
  --r: 2px;
}

*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--ff-text); font-size: var(--t-md); line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-wrap: break-word;
}
h1, h2, h3, h4 { font-family: var(--ff-head); margin: 0; line-height: 1.2; letter-spacing: -0.015em; font-weight: 600; }
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--blue); text-underline-offset: 2px; }
svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip { position: absolute; left: -9999px; top: 0; z-index: 90; background: var(--panel); padding: var(--u3) var(--u5); font-weight: 600; }
.skip:focus { left: 0; }

/* ---------- Status strip ---------- */
.strip { background: var(--blue-deep); color: oklch(93% 0.02 253); font-size: var(--t-xs); }
.strip .row { display: flex; flex-wrap: wrap; gap: var(--u2) var(--u5); padding: var(--u2) var(--pad); max-width: var(--page); margin-inline: auto; }
.strip a { color: inherit; }
@media (max-width: 47.99em) { .strip [data-hide] { display: none; } }

/* ---------- Masthead: identity + search on one line ---------- */
.top { background: var(--panel); border-bottom: 1px solid var(--rule-hard); position: sticky; top: 0; z-index: 60; }
.top-in {
  max-width: var(--page); margin-inline: auto; padding: var(--u3) var(--pad);
  display: flex; align-items: center; gap: var(--u4);
}
.mark { display: flex; align-items: center; gap: var(--u3); text-decoration: none; color: var(--ink); flex: 0 1 auto; }
.mark svg { flex: none; }
.mark b { font-family: var(--ff-head); font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.02em; display: block; line-height: 1.15; }
.mark span { font-size: var(--t-xs); color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.07em; }

/* search is the primary control on this site, not an afterthought */
.find { display: flex; flex: 1 1 260px; max-width: 460px; margin-left: auto; }
.find input {
  flex: 1 1 auto; font: inherit; font-size: var(--t-sm); min-height: 38px;
  border: 1px solid var(--rule-hard); border-right: 0; border-radius: var(--r) 0 0 var(--r);
  padding: 0 var(--u3); background: var(--panel); color: var(--ink);
}
.find button {
  font: inherit; font-size: var(--t-sm); font-weight: 600; min-height: 38px; padding: 0 var(--u4);
  flex: 0 0 auto; white-space: nowrap;
  border: 1px solid var(--blue); background: var(--blue); color: #fff;
  border-radius: 0 var(--r) var(--r) 0; cursor: pointer;
}
.find button:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
@media (max-width: 61.99em) { .find { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; } .top-in { flex-wrap: wrap; } }

.burger {
  display: none; align-items: center; justify-content: center;
  width: 42px; height: 42px; margin-left: auto;
  border: 1px solid var(--rule-hard); border-radius: var(--r);
  background: var(--panel); color: var(--ink); cursor: pointer;
}
.burger i { display: block; width: 17px; height: 2px; background: currentColor; position: relative; }
.burger i::before, .burger i::after { content: ""; position: absolute; left: 0; width: 17px; height: 2px; background: currentColor; }
.burger i::before { top: -5px; } .burger i::after { top: 5px; }
[aria-expanded="true"] i { background: transparent; }
[aria-expanded="true"] i::before { top: 0; transform: rotate(45deg); }
[aria-expanded="true"] i::after { top: 0; transform: rotate(-45deg); }

/* ---------- Page frame: persistent rail on desktop ---------- */
.frame { max-width: var(--page); margin-inline: auto; padding: 0 var(--pad); }
@media (min-width: 62em) {
  .frame { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); gap: var(--u7); align-items: start; }
}

.rail { padding-block: var(--u5); }
.rail h4 { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.09em; color: var(--ink-3); margin-bottom: var(--u3); font-family: var(--ff-text); }
.rail a {
  display: block; padding: var(--u3) var(--u3); min-height: 42px;
  border-left: 3px solid transparent; color: var(--ink); text-decoration: none;
  font-size: var(--t-sm); font-weight: 500;
}
.rail a:hover { background: var(--sunk); }
.rail a[aria-current="page"] { border-left-color: var(--blue); color: var(--blue); background: var(--blue-wash); }
.rail .rail-cta {
  display: block; margin-top: var(--u4); text-align: center; background: var(--blue); color: #fff;
  border-left: 0; border-radius: var(--r); font-weight: 600;
}
.rail .rail-cta:hover { background: var(--blue-deep); }

@media (max-width: 61.99em) {
  .burger { display: inline-flex; }
  .rail {
    position: fixed; inset: var(--top-h, 60px) 0 0 auto; width: min(300px, 86vw); z-index: 70;
    background: var(--panel); border-left: 1px solid var(--rule-hard);
    transform: translateX(100%); transition: transform 200ms ease;
    overflow-y: auto; padding: var(--u5) var(--pad) var(--u8);
  }
  .rail[data-open="true"] { transform: none; }
  .rail a { border-left: 0; border-bottom: 1px solid var(--rule); font-size: var(--t-lg); min-height: 48px; }
  .veil { position: fixed; inset: var(--top-h, 60px) 0 0 0; background: oklch(19% 0.012 255 / 0.42); z-index: 65; opacity: 0; pointer-events: none; transition: opacity 200ms; }
  .veil[data-open="true"] { opacity: 1; pointer-events: auto; }
  body[data-lock="true"] { overflow: hidden; }
}

.main { padding-block: var(--u5) var(--u8); }

/* ---------- Section headers: a labelled bar, not a big display heading ---------- */
.bar {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--u3);
  flex-wrap: wrap; border-top: 2px solid var(--ink); padding-top: var(--u3); margin-bottom: var(--u4);
}
.bar h2 { font-size: var(--t-h3); text-transform: uppercase; letter-spacing: 0.05em; }
.bar a { font-size: var(--t-sm); font-weight: 600; text-decoration: none; }
.bar a:hover { text-decoration: underline; }

.lede { font-size: var(--t-lg); color: var(--ink-2); max-width: 66ch; }
.hint { font-size: var(--t-sm); color: var(--ink-2); }
.crumbs { font-size: var(--t-xs); color: var(--ink-3); padding-block: var(--u3); }
.crumbs a { color: var(--ink-3); }

/* ---------- The service index: a dense table, not icon tiles ---------- */
.svc { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.svc caption { text-align: left; font-size: var(--t-xs); color: var(--ink-3); padding-bottom: var(--u2); }
.svc th {
  text-align: left; font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ink-2); font-weight: 700; padding: var(--u2) var(--u3); border-bottom: 1px solid var(--rule-hard);
  background: var(--sunk);
}
.svc td { padding: var(--u3); border-bottom: 1px solid var(--rule); vertical-align: top; }
.svc tr:hover td { background: var(--sunk); }
.svc a { font-weight: 600; text-decoration: none; }
.svc a:hover { text-decoration: underline; }
.svc .muted { color: var(--ink-2); }
.svc .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* on a phone each row becomes a labelled block — no squeezed columns */
@media (max-width: 40em) {
  .svc, .svc tbody, .svc tr, .svc td { display: block; width: 100%; }
  .svc thead { display: none; }
  .svc tr { border-bottom: 1px solid var(--rule-hard); padding-block: var(--u3); }
  .svc td { border: 0; padding: 2px 0; }
  .svc td[data-label]::before {
    content: attr(data-label); display: block;
    font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); font-weight: 700;
  }
  .svc .num { text-align: left; }
}

/* ---------- Two-up panels ---------- */
.cols { display: grid; gap: var(--u5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 46em) { .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cols--wide { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 62em) { .cols--wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--u7); } }

.box { border: 1px solid var(--rule); background: var(--panel); border-radius: var(--r); padding: var(--u5); }
.box--sunk { background: var(--sunk); }
.box h3 { margin-bottom: var(--u3); }

.deflist { font-size: var(--t-sm); }
.deflist div { display: flex; gap: var(--u3); padding: var(--u2) 0; border-bottom: 1px solid var(--rule); }
.deflist div:last-child { border-bottom: 0; }
.deflist dt { color: var(--ink-2); flex: 0 0 42%; }
.deflist dd { margin: 0; flex: 1 1 auto; font-weight: 500; }

/* ---------- Meeting rows ---------- */
.mtg { display: flex; gap: var(--u4); padding: var(--u4) 0; border-bottom: 1px solid var(--rule); align-items: flex-start; }
.mtg:last-child { border-bottom: 0; }
.when {
  flex: none; width: 54px; text-align: center; border: 1px solid var(--rule-hard); border-radius: var(--r);
  padding: var(--u2) 0; line-height: 1.05; background: var(--panel);
}
.when b { display: block; font-family: var(--ff-head); font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.when span { display: block; font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.mtg-b { flex: 1 1 auto; font-size: var(--t-sm); }
.mtg-b strong { font-size: var(--t-md); }
.docs { display: flex; gap: var(--u2); flex-wrap: wrap; margin-top: var(--u2); }
.docs a {
  font-size: var(--t-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  border: 1px solid var(--rule-hard); border-radius: var(--r); padding: 5px var(--u3);
  min-height: 32px; display: inline-flex; align-items: center; text-decoration: none;
}
.docs a:hover { border-color: var(--blue); background: var(--blue-wash); }

.tag { display: inline-block; font-size: var(--t-xs); font-weight: 700; padding: 2px 8px; border-radius: var(--r); }
.tag--up { background: var(--blue-wash); color: var(--blue-deep); }
.tag--ok { background: var(--green-wash); color: var(--green); }
.tag--soon { background: var(--amber-wash); color: var(--amber-ink); }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: var(--u2); margin-bottom: var(--u4); }
.filters button {
  font: inherit; font-size: var(--t-sm); min-height: 38px; padding: 0 var(--u4);
  border: 1px solid var(--rule-hard); background: var(--panel); color: var(--ink);
  border-radius: var(--r); cursor: pointer;
}
.filters button:hover { border-color: var(--blue); }
.filters [aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }

/* ---------- Forms ---------- */
.form { display: grid; gap: var(--u4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 46em) { .form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.f { display: flex; flex-direction: column; gap: 5px; }
.f--all { grid-column: 1 / -1; }
label { font-size: var(--t-sm); font-weight: 600; }
input, select, textarea {
  font: inherit; font-size: var(--t-md); color: var(--ink); background: var(--panel);
  border: 1px solid var(--rule-hard); border-radius: var(--r); padding: 9px var(--u3); min-height: 42px; width: 100%;
}
textarea { min-height: 120px; resize: vertical; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--u2);
  min-height: 42px; padding: 0 var(--u5); border-radius: var(--r); border: 1px solid transparent;
  font: inherit; font-size: var(--t-md); font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn--go { background: var(--blue); color: #fff; }
.btn--go:hover { background: var(--blue-deep); }
.btn--line { border-color: var(--rule-hard); background: var(--panel); color: var(--ink); }
.btn--line:hover { border-color: var(--blue); color: var(--blue); }
.done { background: var(--green-wash); color: var(--green); border-radius: var(--r); padding: var(--u5); }

/* ---------- News: a dated list, not image cards ---------- */
.wire { border-top: 2px solid var(--ink); }
.wire li { border-bottom: 1px solid var(--rule); }
.wire a { display: flex; gap: var(--u4); padding: var(--u4) 0; text-decoration: none; color: inherit; align-items: baseline; }
.wire a:hover .wire-t { color: var(--blue); text-decoration: underline; }
.wire time { flex: 0 0 88px; font-size: var(--t-xs); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; font-variant-numeric: tabular-nums; }
.wire-t { font-weight: 500; font-size: var(--t-md); }
@media (max-width: 34em) { .wire a { flex-direction: column; gap: 3px; } .wire time { flex: none; } }

/* ---------- Calendar ---------- */
.month { display: none; }
@media (min-width: 52em) {
  .month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--rule-hard); }
  .month > div { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: var(--u2); min-height: 78px; }
  .month .dow { min-height: 0; background: var(--sunk); font-size: var(--t-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); text-align: center; }
  .month .n { font-size: var(--t-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }
  .month .ev { display: block; margin-top: 3px; font-size: var(--t-xs); font-weight: 600; background: var(--blue-wash); color: var(--blue-deep); padding: 2px 5px; border-radius: var(--r); }
}

/* ---------- Footer ---------- */
.foot { border-top: 2px solid var(--ink); background: var(--panel); margin-top: var(--u8); }
.foot-in { max-width: var(--page); margin-inline: auto; padding: var(--u6) var(--pad); display: grid; gap: var(--u5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 46em) { .foot-in { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.foot h4 { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: var(--u3); font-family: var(--ff-text); }
.foot a { color: var(--ink); text-decoration: none; font-size: var(--t-sm); display: inline-flex; align-items: center; min-height: 34px; }
.foot a:hover { color: var(--blue); text-decoration: underline; }
.foot p { font-size: var(--t-sm); color: var(--ink-2); }
.foot-end { border-top: 1px solid var(--rule); font-size: var(--t-xs); color: var(--ink-3); }
.foot-end div { max-width: var(--page); margin-inline: auto; padding: var(--u4) var(--pad); display: flex; flex-wrap: wrap; gap: var(--u3); justify-content: space-between; }

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

/* ---------- Department grid: a plain index, not decorated cards ---------- */
.deptgrid { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 40em) { .deptgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 68em) { .deptgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.deptgrid a { display: block; background: var(--panel); padding: var(--u4); text-decoration: none; color: var(--ink); min-height: 60px; }
.deptgrid a:hover { background: var(--blue-wash); }
.deptgrid b { display: block; font-size: var(--t-md); font-weight: 600; }
.deptgrid span { font-size: var(--t-sm); color: var(--ink-2); }

/* ---------- Editable flag ---------- */
.edit {
  font-size: var(--t-xs); font-weight: 600; color: var(--green);
  background: var(--green-wash); padding: 2px var(--u3); border-radius: var(--r);
}

/* ---------- FAQ ---------- */
.qa { border-bottom: 1px solid var(--rule); }
.qa summary {
  list-style: none; cursor: pointer; padding: var(--u4) 0; min-height: 48px;
  font-family: var(--ff-head); font-weight: 600; font-size: var(--t-md);
  display: flex; align-items: center; gap: var(--u3);
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; margin-left: auto; color: var(--blue); font-size: 1.3em; line-height: 1; }
.qa[open] summary::after { content: "\2212"; }
.qa summary:hover { color: var(--blue); }
.qa-a { padding-bottom: var(--u4); font-size: var(--t-sm); color: var(--ink-2); max-width: 66ch; }

/* ---------- News thumbnails: small, flat, in the site's own blues ---------- */
.wire--art a { align-items: center; }
.thumb { flex: 0 0 72px; width: 72px; height: 54px; border: 1px solid var(--rule); }
@media (max-width: 34em) { .wire--art a { flex-direction: row; align-items: center; } .wire--art time { flex: 0 0 auto; } }
