/* ==========================================================
   VoterHub — design tokens
   Concept: the physical language of voting — ballot stubs,
   precinct call-boards, stamped ward numbers, perforated
   edges — rendered in the industrial/civic register that
   fits a border manufacturing city built on precise, honest
   signage rather than polish.
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@600;700;800;900&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* color */
  --ink: #172038;
  --ink-soft: #232d4d;
  --paper: #efeee6;
  --paper-raised: #f7f6f0;
  --river: #2d7d93;
  --river-deep: #205a6a;
  --stamp: #a8402c;
  --verify: #3f7d57;
  --slate: #5b6472;
  --line: #d3cfc0;
  --line-on-ink: rgba(239, 238, 230, 0.16);

  /* type */
  --f-display: 'Big Shoulders Display', sans-serif;
  --f-body: 'IBM Plex Sans', sans-serif;
  --f-mono: 'IBM Plex Mono', monospace;

  --radius: 3px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- focus & motion ---------- */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--river);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- top bar ---------- */
.topbar {
  background: var(--ink);
  color: var(--paper);
  border-bottom: 3px solid var(--stamp);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--paper);
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  background: var(--river);
  color: var(--ink);
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 13px;
  border-radius: 2px;
  transform: translateY(1px);
}
.brand .tag {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--paper);
  opacity: 0.55;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 400;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav a {
  text-decoration: none;
  color: var(--paper);
  opacity: 0.78;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 2px;
  transition: opacity .15s, background .15s;
  white-space: nowrap;
}
.nav a:hover { opacity: 1; background: rgba(255,255,255,0.07); }

.ward-jump {
  background: var(--ink-soft);
  color: var(--paper);
  border: 1px solid rgba(255,255,255,0.18);
  font-family: var(--f-mono);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 2px;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--paper);
  padding: 8px 12px;
  font-family: var(--f-mono);
  font-size: 13px;
  border-radius: 2px;
}

@media (max-width: 880px) {
  .nav { display: none; }
  .menu-toggle { display: inline-block; }
  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 68px; left: 0; right: 0;
    background: var(--ink);
    padding: 8px 24px 20px;
    border-bottom: 3px solid var(--stamp);
    z-index: 40;
  }
  .brand .tag { display: none; }
}

/* ---------- ballot tray (shortlist) ---------- */
.tray {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  border-top: 3px solid var(--river);
  transform: translateY(100%);
  transition: transform .25s ease;
}
.tray.visible { transform: translateY(0); }
.tray .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 16px;
}
.tray-count {
  font-family: var(--f-mono);
  font-size: 14px;
}
.tray-count b { color: var(--river); font-size: 16px; }
.tray-actions { display: flex; gap: 10px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 2px;
  text-decoration: none;
  transition: transform .12s ease, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--river); color: #fff; }
.btn-primary:hover { background: var(--river-deep); }
.btn-ghost { background: transparent; color: var(--paper); border: 1px solid rgba(255,255,255,0.35); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* ---------- hero ---------- */
.hero {
  background: var(--ink);
  color: var(--paper);
  position: relative;
  overflow: hidden;
  padding: 64px 0 48px;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(90deg, transparent, transparent 79px, var(--line-on-ink) 79px, var(--line-on-ink) 80px);
  opacity: 0.5;
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.eyebrow {
  font-family: var(--f-mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--river);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--stamp);
  border-radius: 50%;
  display: inline-block;
}
.hero h1 {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(44px, 8vw, 92px);
  line-height: 0.92;
  letter-spacing: 0.005em;
  margin: 0 0 20px;
  text-transform: uppercase;
}
.hero p.lede {
  font-size: 18px;
  max-width: 620px;
  color: rgba(239,238,230,0.82);
  margin: 0 0 28px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }

.countdown-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-top: 1px solid var(--line-on-ink);
  padding-top: 24px;
}
.count-item {
  padding: 0 28px 0 0;
  margin-right: 28px;
  border-right: 1px solid var(--line-on-ink);
}
.count-item:last-child { border-right: none; }
.count-item .num {
  font-family: var(--f-mono);
  font-size: 30px;
  font-weight: 600;
  color: var(--river);
  line-height: 1;
}
.count-item .label {
  font-size: 12px;
  color: rgba(239,238,230,0.6);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 6px;
}

/* ---------- alert / notice ---------- */
.notice {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-left: 4px solid var(--stamp);
  padding: 16px 18px;
  border-radius: var(--radius);
  font-size: 14.5px;
  color: var(--ink);
}
.notice + .notice { margin-top: 10px; }
.notice b { color: var(--stamp); }

/* ---------- section scaffolding ---------- */
.section { padding: 56px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--f-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(28px, 4vw, 40px);
  margin: 0;
  letter-spacing: 0.01em;
}
.section-head .sub {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--slate);
}

/* ---------- precinct board (ward grid) ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
@media (max-width: 900px) { .board { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .board { grid-template-columns: repeat(2, 1fr); } }

.tile {
  position: relative;
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px 16px;
  min-height: 128px;
  transition: border-color .15s, transform .12s, box-shadow .15s;
}
.tile:hover {
  border-color: var(--river);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 0 rgba(23,32,56,0.06);
}
.tile .tnum {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--slate);
  letter-spacing: 0.05em;
}
.tile .tname {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  margin-top: 10px;
  text-transform: uppercase;
}
.tile .tcount {
  position: absolute;
  bottom: 14px; right: 14px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--slate);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 20px;
}
.tile.tile-empty .tcount { color: var(--stamp); border-color: var(--stamp); }
.tile.tile-wide { grid-column: span 2; }
@media (max-width: 560px) { .tile.tile-wide { grid-column: span 2; } }
.tile.tile-mayor {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.tile.tile-mayor .tnum { color: var(--river); }
.tile.tile-mayor:hover { border-color: var(--river); }

/* ---------- ballot-stub candidate card ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.stub {
  position: relative;
  background: var(--paper-raised);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stub::before {
  content: "";
  position: absolute;
  left: 10px; top: 8px; bottom: 8px;
  width: 0;
  border-left: 2px dashed var(--line);
}
.stub-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 22px;
  color: #fff;
  flex-shrink: 0;
}
.avatar-lg { width: 96px; height: 96px; font-size: 34px; }

.stub-name-block { flex: 1; }
.stub h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.05;
  margin: 0 0 4px;
  text-transform: uppercase;
}
.stub .stub-meta {
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chk {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--slate);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: border-color .15s, background .15s;
}
.chk:hover { border-color: var(--river); }
.chk.on { background: var(--river); border-color: var(--river); }
.chk.on::after {
  content: "✓";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700;
}

.stub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 11.5px;
}
.pill {
  border: 1px solid var(--line);
  padding: 4px 9px;
  border-radius: 20px;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  transition: border-color .15s, color .15s;
}
.pill:hover { border-color: var(--river); color: var(--river-deep); }

.stub-cta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.stub-cta a { font-size: 13.5px; font-weight: 600; color: var(--river-deep); text-decoration: none; }
.stub-cta a:hover { text-decoration: underline; }

/* ---------- empty state ---------- */
.empty {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  color: var(--slate);
  font-size: 14.5px;
}
.empty b { color: var(--ink); }

/* ---------- zone group (trustees) ---------- */
.zone {
  margin-bottom: 34px;
}
.zone-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.zone-head h3 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 19px;
  text-transform: uppercase;
  margin: 0;
}
.zone-seats {
  font-family: var(--f-mono);
  font-size: 11px;
  color: #fff;
  background: var(--river);
  padding: 3px 9px;
  border-radius: 20px;
}
.zone-note { font-family: var(--f-mono); font-size: 11.5px; color: var(--slate); }

/* ---------- candidate profile ---------- */
.profile-head {
  background: var(--ink);
  color: var(--paper);
  padding: 44px 0 36px;
}
.profile-top {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}
.profile-name {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(34px, 6vw, 58px);
  text-transform: uppercase;
  line-height: 0.95;
  margin: 0 0 6px;
}
.profile-race {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--river);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.profile-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 32px 0;
}
.info-block {
  background: var(--paper-raised);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px;
}
.info-block .k {
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--slate);
  margin-bottom: 8px;
}
.info-block .v { font-size: 15px; word-break: break-word; }
.info-block a { color: var(--river-deep); text-decoration: none; font-weight: 600; }
.info-block a:hover { text-decoration: underline; }

.social-row { display: flex; flex-wrap: wrap; gap: 10px; }
.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--ink);
  padding: 9px 16px;
  border-radius: 2px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
}
.social-btn:hover { background: var(--ink); color: var(--paper); }

.panel {
  background: var(--paper-raised);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.panel h2 {
  font-family: var(--f-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 22px;
  margin: 0 0 6px;
}
.panel .hint { font-size: 13.5px; color: var(--slate); margin-bottom: 14px; }

/* ---------- footer ---------- */
footer {
  background: var(--ink);
  color: rgba(239,238,230,0.72);
  padding: 44px 0 90px;
  margin-top: 40px;
  font-size: 13.5px;
}
footer a { color: var(--river); text-decoration: none; }
footer a:hover { text-decoration: underline; }
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 28px;
}
@media (max-width: 700px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-grid h4 {
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--paper);
  margin: 0 0 12px;
}
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid li { margin-bottom: 8px; }
.foot-rule { border-top: 1px solid var(--line-on-ink); padding-top: 18px; }

/* ---------- misc pages ---------- */
.prose { max-width: 720px; font-size: 15.5px; }
.prose h2 { font-family: var(--f-display); text-transform: uppercase; font-weight: 800; margin-top: 34px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 8px; }

.breadcrumb {
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--slate);
  margin-bottom: 20px;
}
.breadcrumb a { text-decoration: none; color: var(--river-deep); }
.breadcrumb a:hover { text-decoration: underline; }

.date-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.date-chip {
  font-family: var(--f-mono);
  font-size: 12.5px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 20px;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.search {
  font-family: var(--f-body);
  font-size: 14px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 2px;
  background: var(--paper-raised);
  flex: 1;
  min-width: 200px;
}
.search:focus { border-color: var(--river); outline: none; }

.stamp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--verify);
  border: 1px solid var(--verify);
  padding: 3px 9px;
  border-radius: 20px;
}

.print-only { display: none; }
@media print {
  .topbar, .tray, footer, .no-print { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; }
}
