/* Layout: civic and plain-spoken. Ballot-paper ground, deep teal carried over from the
   old site, filled ballot ovals as the signature mark. Single light theme by choice. */
:root {
  --paper: #fafaf7;
  --white: #ffffff;
  --ink: #172026;
  --muted: #59656b;
  --teal: #1f4433;   /* Greenwich Registrars of Voters primary green */
  --teal-deep: #15301f;
  --teal-wash: #e7ede9;
  --gold-soft: #d9c27a;
  --gold: #b99c35;   /* Registrars of Voters secondary gold */
  --line: #d8dfdc;
  --read: "Newsreader", Georgia, "Times New Roman", serif;
  --ui: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font: 400 1.0625rem/1.65 var(--ui); color: var(--ink); background: var(--paper); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 20; background: var(--white); padding: 8px 12px; }

h1, h2, h3 { font-family: var(--read); font-weight: 500; line-height: 1.12; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 5.2vw, 4.1rem); letter-spacing: -.015em; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); letter-spacing: -.01em; }
.label { font: 700 .75rem/1.4 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--teal); margin: 0 0 .8rem; }
.label a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }

/* The ballot oval */
.oval { display: inline-block; width: 26px; height: 15px; border: 2px solid var(--ink); border-radius: 50%; flex: none; }
.oval.filled { background: var(--ink); }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: rgba(250,250,247,.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 12px; }
.wordmark { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.wordmark-oval { display: block; width: 88px; height: auto; flex: none; }
.wordmark strong { display: block; font: 600 1.4rem/1.2 var(--ui); }
.wordmark small { display: block; font-size: .88rem; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--teal); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }
.nav .nav-cta { background: var(--teal); color: var(--white); padding: 8px 16px; border-radius: 4px; }
.nav .nav-cta:hover { background: var(--teal-deep); color: var(--white); }

/* Buttons */
.btn { display: inline-block; font: 600 1rem var(--ui); text-decoration: none; cursor: pointer; padding: 13px 24px; border-radius: 4px; border: 2px solid transparent; }
.btn-primary { background: var(--teal); color: var(--white); }
.btn-primary:hover { background: var(--teal-deep); }
.btn-ghost { border-color: currentColor; color: var(--teal); }
.btn-ghost:hover { background: var(--teal-wash); }
.btn-gold { background: var(--gold); color: #10241a; }
.btn-gold:hover { background: var(--gold-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Home hero */
.hero { padding-block: clamp(48px, 7vw, 88px); background: var(--teal); color: var(--white); }
.hero h1 { color: var(--white); }
.hero .label { color: var(--gold-soft); }
.hero .lede { color: #d3e0d8; }
.hero .btn-primary { background: var(--gold); color: #10241a; }
.hero .btn-primary:hover { background: var(--gold-soft); }
.hero .btn-ghost { color: var(--white); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.1); }
.hero-photo { box-shadow: 0 12px 34px rgba(0,0,0,.28); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-text { min-width: 0; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 54ch; }
.hero-text .actions { margin-top: 1.8rem; }
.hero-visual { position: relative; min-width: 0; padding-bottom: 48px; }
.hero-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 30%; border-radius: 6px; }
.ballot {
  position: absolute; left: -24px; bottom: 0; width: min(380px, 92%);
  background: var(--white); border: 2px solid var(--ink); color: var(--ink);
  box-shadow: 0 10px 30px rgba(23,32,38,.16);
  font-family: "Oswald", "Arial Narrow", sans-serif; text-transform: uppercase;
}
.ballot-head { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 10px; padding: 8px 12px; border-bottom: 2px solid var(--ink); font-weight: 500; font-size: 1rem; letter-spacing: .02em; }
.ballot-num { font-size: 1.15rem; }
.ballot-vote { font-weight: 400; font-size: .72rem; letter-spacing: .04em; }
.ballot-row { display: grid; grid-template-columns: 1fr 1.05fr; }
.ballot-row + .ballot-row { border-top: 1px solid var(--ink); }
.ballot-party { display: grid; align-items: center; padding: 10px 12px; border-right: 1px solid var(--ink); font-size: .9rem; letter-spacing: .03em; }
.ballot-cell { display: grid; justify-items: center; gap: 4px; padding: 8px 10px 10px; }
.ballot-top { display: flex; align-items: center; gap: 10px; font-size: .85rem; align-self: start; }
.ballot .oval { width: 30px; height: 15px; border-width: 1.5px; background: transparent; }
.ballot-name { font-size: 1.05rem; font-weight: 500; letter-spacing: .03em; line-height: 1.1; text-align: center; }

/* Tally strip */
.tally { background: var(--white); color: var(--ink); padding-block: 36px; border-bottom: 1px solid var(--line); }
.tally-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; }
.tally-grid > div { display: grid; gap: 6px; border-left: 3px solid var(--gold); padding-left: 16px; min-width: 0; }
.tally-num { font: 500 2rem/1 var(--read); font-variant-numeric: lining-nums tabular-nums; color: var(--teal); }
.tally-num .arrow { color: var(--gold); font-size: .8em; }
.tally-text { font-size: .88rem; color: var(--muted); line-height: 1.4; }

/* Sections */
.section { padding-block: clamp(56px, 8vw, 100px); }
.section-tint { background: var(--teal-wash); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 2rem; }
.section-head h2 { margin: 0; }
.more { font-weight: 600; }

.record-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 2rem; }
.record { display: grid; align-content: start; gap: 8px; text-decoration: none; color: var(--ink); min-width: 0; }
.record img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; background: var(--teal-wash); margin-bottom: 6px; }
.record-title { font: 600 1.1rem/1.3 var(--ui); color: var(--teal-deep); }
.record:hover .record-title { text-decoration: underline; }
.record-text { color: var(--muted); font-size: .96rem; }

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card { display: grid; grid-template-rows: auto 1fr; background: var(--white); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; text-decoration: none; color: var(--ink); min-width: 0; }
.post-card img, .card-ph { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--teal-wash); }
.card-ph { display: grid; place-items: center; }
.card-ph .oval { width: 44px; height: 26px; border-color: var(--teal); }
.post-card-text { display: grid; gap: 6px; padding: 18px 20px 22px; }
.post-title { font: 500 1.3rem/1.25 var(--read); }
.post-card:hover .post-title { color: var(--teal); }
.post-date { display: block; font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.kind { font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; margin-right: 6px; }

.press-home { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(32px, 5vw, 72px); }
.press-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.press-list li { border-bottom: 1px solid var(--line); }
.press-list a { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 14px 0; text-decoration: none; color: var(--ink); font-weight: 500; }
.press-list a:hover { color: var(--teal); }
.press-list .post-date { padding-top: 2px; }

.join { background: var(--teal-deep); color: var(--white); padding-block: clamp(48px, 7vw, 80px); }
.join h2 { color: var(--white); }
.join .label { color: var(--gold-soft); }
.join p { color: #d3e0d8; max-width: 52ch; }
.join .btn-ghost { color: var(--white); }
.join .btn-ghost:hover { background: rgba(255,255,255,.1); }
.join-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; }
.join-grid .actions { justify-content: flex-end; }

/* Inner pages */
.page-head { background: var(--teal); color: var(--white); padding-block: clamp(40px, 6vw, 72px); }
.page-head h1 { color: var(--white); }
.page-head .label { color: var(--gold-soft); }
.page-head .page-meta { color: #c9d8cf; }
.page-head h1 { max-width: 24ch; font-size: clamp(2.1rem, 4.4vw, 3.4rem); }
.page-meta { margin: 0; color: var(--muted); font-size: .95rem; }

.prose { max-width: 760px; padding-block: clamp(40px, 6vw, 72px); font: 400 1.18rem/1.7 var(--read); }
.prose h2, .prose h3, .prose h4 { font-family: var(--read); font-weight: 600; margin-top: 1.8em; }
.prose h2 { font-size: 1.7rem; } .prose h3 { font-size: 1.4rem; } .prose h4 { font-size: 1.2rem; }
.prose img { margin: 1.5rem 0; border-radius: 4px; border: 1px solid var(--line); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: 1.5rem 0; padding-left: 20px; border-left: 3px solid var(--gold); color: var(--muted); }
.prose table { border-collapse: collapse; font: .9rem var(--ui); display: block; overflow-x: auto; max-width: 100%; }
.prose td, .prose th { border: 1px solid var(--line); padding: 6px 10px; }
.prose a { word-break: break-word; }
.notice { font: 500 1rem var(--ui); background: #fff6e2; border-left: 4px solid var(--gold); padding: 12px 16px; border-radius: 4px; }
.video { margin: 1.5rem 0; }
.video iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 4px; background: var(--ink); }
.video figcaption { font: .9rem var(--ui); margin-top: 6px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font: 500 1rem/1.35 var(--ui); }
.post-nav a { text-decoration: none; color: var(--ink); min-width: 0; }
.post-nav a:hover { color: var(--teal); }
.post-nav span { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin-bottom: 4px; }
.post-nav .older { grid-column: 2; text-align: right; }

.list-wrap { padding-block: clamp(36px, 5vw, 64px); }
.list-intro { color: var(--muted); font-size: 1.1rem; max-width: 60ch; margin-bottom: 2rem; }
.year { display: grid; grid-template-columns: 120px 1fr; gap: 24px; margin-bottom: 2rem; }
.year-num { font-size: 2rem; color: var(--teal); margin: 6px 0 0; font-variant-numeric: lining-nums; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(32px, 5vw, 64px); padding-block: clamp(40px, 6vw, 72px); align-items: start; }
.form-intro { min-width: 0; color: var(--muted); }
.form { display: grid; gap: 18px; background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: clamp(20px, 4vw, 32px); min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; min-width: 0; }
.optional { font-weight: 400; color: var(--muted); }
.form input:not([type="checkbox"]), .form textarea { font: 1rem var(--ui); color: var(--ink); width: 100%; min-width: 0; padding: 11px 13px; border: 1px solid #b9c4c1; border-radius: 4px; background: var(--paper); }
.checks { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.checks legend { font-weight: 700; margin-bottom: 10px; }
.form .check { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.check input { width: 18px; height: 18px; accent-color: var(--teal); }
.form .btn { justify-self: start; }
.form-note { margin: 0; padding: 12px 14px; border-radius: 4px; background: var(--teal-wash); color: var(--teal-deep); font-size: .95rem; }
.hp { position: absolute; left: -9999px; }

/* Footer */
.site-footer { background: #10241a; color: #b7c1c4; padding-block: 40px 28px; font-size: .92rem; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 20px 40px; }
.footer-inner p { margin: 0; }
.footer-name { color: var(--white); font-weight: 600; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: start; }
.footer-nav a { color: #dfe6e8; text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.paid-for { grid-column: 1 / -1; border-top: 1px solid #33424a; padding-top: 16px; font-size: .82rem; }

@media (max-width: 1020px) {
  .nav a:not(.nav-cta) { font-size: .9rem; }
  .tally-grid { grid-template-columns: repeat(3, 1fr); }
  .record-grid { grid-template-columns: repeat(2, 1fr); }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .wrap { padding-inline: 16px; }
  .nav a:not(.nav-cta) { display: none; }
  .wordmark { gap: 10px; }
  .wordmark-oval { width: 46px; }
  .wordmark strong { font-size: 1.15rem; }
  .wordmark small { font-size: .74rem; }
  .hero-grid, .press-home, .join-grid, .form-grid, .footer-inner { grid-template-columns: 1fr; }
  .ballot { left: 12px; }
  .tally-grid { grid-template-columns: 1fr 1fr; }
  .record-grid, .post-grid, .field-row, .checks { grid-template-columns: 1fr; }
  .join-grid .actions { justify-content: flex-start; }
  .press-list a { grid-template-columns: 1fr; gap: 2px; }
  .year { grid-template-columns: 1fr; gap: 8px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .older { grid-column: auto; text-align: left; }
  .prose { font-size: 1.1rem; }
}

/* Larger text on desktop and laptop screens */
@media (min-width: 1100px) { html { font-size: 112.5%; } }
@media (min-width: 1600px) { html { font-size: 125%; } }

/* Photo at the top of a page */
.lead-photo { margin: 0 0 2rem; }
.lead-photo img { width: auto; max-width: 100%; max-height: 520px; border: 0; border-radius: 6px; margin: 0; }
.lead-photo figcaption { font: .9rem/1.4 var(--ui); color: var(--muted); margin-top: .6rem; }
