/* ============================================================
   TOWN OF SPANK — styles.css
   Single source of truth for the civic identity. [LAW:one-source-of-truth]
   Register: small-town American municipal. Dignified, earnest, tidy.
   ============================================================ */

@font-face {
  font-family: "Libre Baskerville";
  src: url("assets/fonts/LibreBaskerville.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Libre Baskerville";
  src: url("assets/fonts/LibreBaskerville-italic.woff2") format("woff2");
  font-weight: 400 700; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("assets/fonts/PublicSans.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --navy:      #16284d;
  --navy-deep: #0f1d39;
  --cream:     #f5f0e3;
  --paper:     #fffdf6;
  --gold:      #b8902e;
  --gold-lit:  #cda94a;
  --sage:      #3f5d49;
  --red:       #8e3b2f;
  --ink:       #23262d;
  --muted:     #6c6657;
  --line:      #ddd5c0;
  --serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --sans:  "Public Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: var(--sans); font-size: 18px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 28px; }
.narrow { max-width: 760px; }
a { color: var(--navy); }

h1, h2, h3 { font-family: var(--serif); color: var(--navy); font-weight: 700; line-height: 1.2; }
.kicker {
  font-family: var(--sans); font-weight: 700; font-size: 0.74rem;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold);
  margin: 0 0 0.8em;
}
.section-title { font-size: clamp(1.6rem, 3.4vw, 2.1rem); margin: 0 0 0.2em; }
.section-lead { font-size: 1.05rem; color: var(--muted); margin: 0 0 2.2em; max-width: 620px; }

/* a gold civic rule with a center diamond */
.civrule { display:flex; align-items:center; gap:14px; justify-content:center; margin: 0 auto 2.6em; max-width: 320px; }
.civrule::before, .civrule::after { content:""; height:1px; flex:1; background: var(--gold); opacity:.55; }
.civrule i { width:7px; height:7px; background: var(--gold); transform: rotate(45deg); display:block; }

/* ============================================================ HEADER */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy); color: #fff;
  border-bottom: 3px solid var(--gold);
}
.topbar .wrap { display: flex; align-items: center; gap: 14px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand .seal-sm { width: 40px; height: 40px; flex: none; }
.brand b { font-family: var(--serif); font-size: 1.12rem; letter-spacing: 0.02em; white-space: nowrap; }
.brand span { display:block; font-family: var(--sans); font-size: 0.6rem; letter-spacing:0.24em; text-transform:uppercase; color: var(--gold-lit); }
.nav { margin-left: auto; display: flex; gap: 26px; }
.nav a {
  color: #e8ecf4; text-decoration: none; font-weight: 600; font-size: 0.82rem;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: #fff; border-bottom-color: var(--gold); }

/* ============================================================ HERO */
.hero { text-align: center; padding: 78px 24px 64px; }
.hero .seal-lg { width: min(220px, 50vw); height: auto; margin: 0 auto 26px; display: block; }
.hero h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); margin: 0 0 0.18em; letter-spacing: 0.01em; }
.hero .tagline { font-family: var(--serif); font-style: italic; font-size: clamp(1.05rem, 2.6vw, 1.4rem); color: var(--sage); margin: 0 0 1.4em; }
.hero .motto { font-family: var(--serif); letter-spacing: 0.34em; text-transform: uppercase; font-size: 0.82rem; color: var(--gold); margin: 0; }
.factbar {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0;
  margin: 30px auto 0; max-width: 720px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.factbar div { padding: 16px 26px; font-size: 0.84rem; color: var(--muted); }
.factbar div + div { border-left: 1px solid var(--line); }
.factbar b { display:block; font-family: var(--serif); font-size: 1.25rem; color: var(--navy); letter-spacing: 0.02em; }

/* ============================================================ TOWNSCAPE BANNER */
.townscape { position: relative; }
.townscape img { width: 100%; height: clamp(260px, 42vw, 460px); object-fit: cover; display: block; }
.townscape .plate {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: rgba(22,40,77,0.92); color: #fff; padding: 10px 22px;
  font-family: var(--serif); font-style: italic; font-size: 0.95rem;
  border: 1px solid var(--gold-lit); white-space: nowrap;
}

/* ============================================================ GENERIC SECTION */
section { padding: 76px 0; }
section.tint { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.center { text-align: center; }

/* mayor's letter */
.letter { background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--navy); padding: 40px 44px; }
.letter p { margin: 0 0 1.1em; }
.letter .sign { font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--navy); margin-top: 1.2em; }
.letter .sign small { display:block; font-family: var(--sans); font-style: normal; font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

/* departments grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 28px 26px; }
.card .dept-no { font-family: var(--sans); font-weight: 700; font-size: 0.7rem; letter-spacing: 0.18em; color: var(--gold); }
.card h3 { font-size: 1.16rem; margin: 6px 0 8px; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* events list */
.events { max-width: 760px; margin: 0 auto; }
.event { display: grid; grid-template-columns: 96px 1fr; gap: 22px; padding: 22px 0; border-top: 1px solid var(--line); }
.event:last-child { border-bottom: 1px solid var(--line); }
.event .when { font-family: var(--serif); color: var(--red); font-size: 0.92rem; line-height: 1.35; }
.event h3 { font-size: 1.12rem; margin: 0 0 4px; }
.event p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* at a glance */
.glance { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 48px; max-width: 760px; margin: 0 auto; }
.glance dl { display: contents; }
.glance .row { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px dotted var(--line); }
.glance dt { color: var(--muted); }
.glance dd { margin: 0; font-family: var(--serif); color: var(--navy); text-align: right; }

/* ============================================================ FOOTER */
.foot { background: var(--navy); color: #cdd5e4; padding: 56px 0 28px; }
.foot .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; }
.foot .seal-sm { width: 76px; height: 76px; }
.foot h4 { font-family: var(--serif); color: #fff; font-size: 1.05rem; margin: 0 0 12px; }
.foot p, .foot a { color: #b9c2d6; font-size: 0.9rem; line-height: 1.8; text-decoration: none; margin: 0; }
.foot a:hover { color: #fff; }
.foot .colophon { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,0.14); margin-top: 14px; padding-top: 22px; font-size: 0.78rem; color: #8c97ad; display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; }

/* ============================================================ THE SEAL (inline SVG symbol) */
.seal-ring { font-family: var(--serif); font-weight: 700; letter-spacing: 3px; }
.seal-ring.top { font-size: 31px; }
.seal-ring.bot { font-size: 26px; }
.seal-star { font-size: 26px; }
.seal-motto { font-family: var(--serif); font-weight: 700; font-size: 19px; letter-spacing: 2px; }

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .nav { display: none; }
  .foot .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .glance { grid-template-columns: 1fr; }
  .factbar div + div { border-left: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
