/* avipresberg.com
   Layout: civic-bulletin flow (masthead, sections, tally countdown, index-card notes, stamp footer)
   Colors: established navy and gold scheme */
:root {
  --navy: #1f4e79;
  --navy-dark: #163a5a;
  --ink: #1d2733;
  --ink-soft: #55606d;
  --paper: #f5f8fb;
  --paper-raised: #ffffff;
  --line: #dde4ec;
  --gold: #c8a24a;
  --gold-ink: #8a6a1f;
  --max: 1080px;
  --sans: "Libre Franklin", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--navy); text-underline-offset: 3px; }
a:hover { color: var(--navy-dark); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.wrap { width: min(var(--max), 100% - 2.5rem); margin-inline: auto; }
.prose { max-width: 66ch; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--navy); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; top: 1rem; }

.label { font-family: var(--sans); text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 700; color: var(--gold-ink); }
hr.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* Masthead */
.masthead { background: var(--paper-raised); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 72px; }
.masthead-id { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); line-height: 1.25; }
.masthead-name { font-family: var(--serif); font-weight: 700; font-size: 1.3rem; }
.masthead-role { font-size: .78rem; color: var(--ink-soft); letter-spacing: .02em; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 6px; padding: .45rem .8rem; font: inherit; font-size: .9rem; cursor: pointer; }
nav.tabs ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
nav.tabs a { display: block; font-size: .88rem; font-weight: 600; text-decoration: none; color: var(--ink); padding: .55rem .9rem; border: 1px solid transparent; border-bottom: 0; border-radius: 4px 4px 0 0; }
nav.tabs a:hover { color: var(--navy); }
nav.tabs a[aria-current="page"] { border-color: var(--line); background: var(--paper); color: var(--navy); }
@media (max-width: 820px) {
  .nav-toggle { display: inline-block; }
  nav.tabs { display: none; position: absolute; top: 72px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); }
  nav.tabs.open { display: block; }
  nav.tabs ul { flex-direction: column; padding: .5rem 1.25rem 1rem; }
  nav.tabs a { border: 0; padding: .6rem 0; }
}

/* Buttons */
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.btn { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .88rem; letter-spacing: .02em; text-decoration: none; padding: .75rem 1.25rem; border: 1.5px solid var(--navy); color: var(--navy); background: transparent; cursor: pointer; transition: background-color .16s, color .16s, transform .16s; }
.btn:hover { transform: translateY(-1px); background: var(--navy); color: #fff; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); border-color: var(--navy-dark); }

/* Hero */
.hero { padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2.5rem, 6vw, 4rem); background: var(--paper-raised); }
.hero-grid { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: clamp(1.75rem, 5vw, 4rem); align-items: start; }
@media (max-width: 700px) { .hero-grid { grid-template-columns: 1fr; } .photo-well { max-width: 280px; } }
.photo-well { aspect-ratio: 4 / 5; border: 1.5px solid var(--navy); background: var(--paper); padding: 10px; position: relative; overflow: hidden; will-change: transform; }
.photo-well::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(255,255,255,.35); pointer-events: none; z-index: 2; }
.photo-well img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.1rem); font-weight: 700; margin-top: .5rem; }
.role-line { font-weight: 600; color: var(--navy); font-size: 1.05rem; margin: .6rem 0 1.4rem; }
.hero p { max-width: 62ch; }
.emph { color: var(--ink-soft); transition: color .42s ease; }
.emph.on { color: var(--ink); font-weight: 700; }

/* Section scaffold */
.block { padding: clamp(2.75rem, 6vw, 4.5rem) 0; }
.block-raised { background: var(--paper-raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1.25rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.block-head h2 { font-size: clamp(1.45rem, 2.7vw, 1.9rem); }
.block-lede { color: var(--ink-soft); max-width: 60ch; margin-top: -.75rem; margin-bottom: 1.75rem; }

/* Countdown */
.tally { display: grid; grid-template-columns: repeat(4, minmax(64px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 1rem 0 1.25rem; max-width: 560px; }
.tally-cell { background: var(--paper); padding: 1rem .5rem .9rem; text-align: center; border-top: 3px solid var(--gold); }
.tally-num { font-family: var(--mono); font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 600; color: var(--navy); line-height: 1; }
.tally-unit { display: block; margin-top: .5rem; font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.countdown-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (max-width: 820px) { .countdown-grid { grid-template-columns: 1fr; } }
.next-name { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; color: var(--ink); }
.next-meta { color: var(--ink-soft); font-size: .92rem; }
.elections-table { border-top: 1px solid var(--line); }
.elections-row { display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.elections-row strong { display: block; }
.elections-row span { color: var(--ink-soft); }
.elections-row .mono { text-align: right; font-size: .85rem; color: var(--ink); }
.local-note { margin-top: 1.25rem; padding: 1rem 1.1rem; background: var(--paper); border-left: 3px solid var(--gold); font-size: .9rem; color: var(--ink-soft); }
.local-note strong { color: var(--ink); }

/* Get involved */
.involve-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.involve-card { background: var(--paper-raised); padding: 1.5rem 1.4rem 1.6rem; display: flex; flex-direction: column; gap: .5rem; }
.involve-card h3 { font-family: var(--sans); font-size: 1.06rem; font-weight: 700; }
.involve-card p { color: var(--ink-soft); font-size: .94rem; margin: 0; flex: 1; }
.involve-card a.go { font-weight: 700; font-size: .88rem; text-decoration: none; margin-top: .5rem; }
.involve-card a.go::after { content: " \2192"; }

@media (max-width: 900px) { .involve-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .involve-grid { grid-template-columns: 1fr; } }

/* About preview */
.about-grid { display: grid; grid-template-columns: 1.3fr .9fr; gap: clamp(1.75rem, 5vw, 3.75rem); }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }
.pull { border-left: 3px solid var(--gold); padding: .25rem 0 .25rem 1.25rem; font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--ink); }
.fact-block { align-self: start; border: 1px solid var(--line); background: var(--paper-raised); padding: 1.4rem; }
.fact-row { display: flex; justify-content: space-between; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.fact-row:last-child { border-bottom: 0; }
.fact-row .k { color: var(--ink-soft); }
.fact-row .v { font-weight: 600; text-align: right; }

/* Field notes list */
.filter-row { display: flex; gap: .5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.filter-btn { font: inherit; font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; padding: .45rem .9rem; border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft); cursor: pointer; }
.filter-btn:hover { border-color: var(--navy); color: var(--navy); }
.filter-btn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.notes-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.note-card { display: grid; grid-template-columns: 14px 120px 1fr 96px; gap: 1.1rem; align-items: start; padding: 1.2rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.note-card:hover h3 { color: var(--navy); }
.note-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: .5rem; }
.note-dot.essay { background: var(--navy); }
.note-dot.policy { background: var(--gold); }
.note-date { font-family: var(--mono); font-size: .78rem; color: var(--ink-soft); padding-top: .2rem; }
.note-tag { font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; display: inline-block; margin-bottom: .2rem; }
.note-tag.essay { color: var(--navy); }
.note-tag.policy { color: var(--gold-ink); }
.note-body h3 { font-family: var(--sans); font-size: 1.04rem; font-weight: 700; margin-bottom: .25rem; }
.note-body p { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.note-thumb { aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
.note-thumb img { width: 100%; height: 100%; object-fit: cover; }
.note-thumb.contain img { object-fit: contain; padding: 8px; }
li[hidden] { display: none; }
@media (max-width: 680px) {
  .note-card { grid-template-columns: 10px 1fr; }
  .note-card .note-date { grid-column: 2; order: 2; }
  .note-card .note-body { grid-column: 2; order: 1; }
  .note-card .note-thumb { display: none; }
}

/* Voter strip */
.voter { background: var(--navy); color: #fff; }
.voter .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap; padding: 1.6rem 0; }
.voter h2 { color: #fff; font-size: 1.25rem; }
.voter p { margin: .25rem 0 0; max-width: 56ch; font-size: .92rem; color: #dce7f2; }
.voter .btn { border-color: var(--gold); color: var(--ink); background: var(--gold); }
.voter .btn:hover { background: #fff; border-color: #fff; color: var(--navy); }

/* Inner pages */
.page-hero { background: var(--paper-raised); border-bottom: 1px solid var(--line); padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(2rem, 4vw, 2.75rem); }
.page-hero h1 { font-size: clamp(2rem, 4.4vw, 2.9rem); margin: .5rem 0 .75rem; }
.page-hero .lede { font-size: 1.1rem; color: var(--ink-soft); max-width: 60ch; margin: 0; }
.bio-grid { display: grid; grid-template-columns: 300px 1fr; gap: clamp(1.75rem, 5vw, 4rem); align-items: start; }
@media (max-width: 820px) { .bio-grid { grid-template-columns: 1fr; } .bio-grid .sticky { position: static; max-width: 280px; } }
.sticky { position: sticky; top: 96px; }
.photo { border: 1px solid var(--line); overflow: hidden; background: var(--paper-raised); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-tall { aspect-ratio: 4 / 5; }
.photo-wide { aspect-ratio: 3 / 2; }

/* Timeline (education) */
.timeline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 220px 1fr; gap: 1.25rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
@media (max-width: 680px) { .timeline li { grid-template-columns: 1fr; gap: .35rem; } }
.timeline h3 { font-size: 1.2rem; margin-bottom: .4rem; }
.timeline p { color: var(--ink-soft); margin: 0; }

/* Contact */
.contact-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.contact-list a { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.contact-list a:hover .value { color: var(--navy); }
.contact-list .label { display: block; }
.contact-list .value { font-weight: 600; font-size: 1.05rem; }
.icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border: 1.5px solid var(--navy); color: var(--navy); }
.icon svg { width: 20px; height: 20px; }

/* Single post */
.post-header { padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem; }
.post-header h1 { font-size: clamp(2rem, 4.4vw, 2.7rem); max-width: 24ch; margin: .5rem 0 .75rem; }
.post-header .meta { color: var(--ink-soft); font-family: var(--mono); font-size: .85rem; }
.back-link { display: inline-block; margin-bottom: 1rem; text-decoration: none; font-weight: 600; font-size: .9rem; }
.post-body { max-width: 68ch; font-size: 1.07rem; background: var(--paper-raised); border: 1px solid var(--line); padding: clamp(1.25rem, 4vw, 2.5rem); }
.post-body figure { margin: 0 0 1.75rem; }
.post-body figure img { max-height: 560px; width: auto; max-width: 100%; margin-inline: auto; }
.post-body figure.small img { max-width: 160px; }
.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin: 2rem 0 0; max-width: 68ch; }
.post-nav a { text-decoration: none; max-width: 46%; font-weight: 600; }
.post-nav small { display: block; color: var(--ink-soft); font-weight: 400; }

/* Footer stamp */
footer { padding: 2.5rem 0 3rem; }
.stamp { border: 1.5px solid var(--navy); background: var(--paper-raised); padding: 1.25rem 1.5rem; display: grid; grid-template-columns: 1fr auto; gap: 1.25rem; align-items: center; }
@media (max-width: 600px) { .stamp { grid-template-columns: 1fr; } }
.stamp-links { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: .9rem; }
.stamp-links a { color: var(--ink); text-decoration: none; font-weight: 600; }
.stamp-links a:hover { color: var(--navy); }
.stamp-meta { text-align: right; font-family: var(--mono); font-size: .76rem; color: var(--ink-soft); }
@media (max-width: 600px) { .stamp-meta { text-align: left; } }

/* Reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .56s ease, transform .56s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .photo-well { transform: none !important; }
}
