/* Logan County Republican Central Committee — "Heartland Americana" theme.
   Condensed campaign-signage headlines (Oswald) + a Franklin-gothic civic body
   (Libre Franklin), a warm muted-flag palette on cream "newsprint," star-rule
   dividers, and sign-style buttons. Fonts are self-hosted (see assets/fonts/)
   so the site makes no external requests. */

/* ---------- Self-hosted fonts (variable — one file covers all weights) ---------- */
@font-face { font-family:"Oswald"; font-style:normal; font-weight:200 700; font-display:swap; src:url("fonts/oswald.woff2") format("woff2"); }
@font-face { font-family:"Libre Franklin"; font-style:normal; font-weight:100 900; font-display:swap; src:url("fonts/librefranklin.woff2") format("woff2"); }

:root {
  /* Muted flag palette on warm cream */
  --navy: #1c2e4a;
  --navy-deep: #14223a;
  --navy-soft: #2f4468;
  --red: #9e2a2b;
  --red-dark: #7f2122;
  --gold: #b0863a;
  --gold-soft: #cb9e52;
  --paper: #fffdf7;
  --bg: #f3ecda;
  --line: #e3d9c1;
  --text: #23262b;
  --muted: #5f584b;

  --wrap: 1120px;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(20, 34, 58, 0.05), 0 6px 20px rgba(20, 34, 58, 0.07);
  /* --head kept as the old --serif slot: every h1/h2/h3 references it. */
  --head: "Oswald", "Arial Narrow", "Segoe UI", sans-serif;
  --serif: var(--head);
  --font: "Libre Franklin", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--head); line-height: 1.1; margin: 0 0 0.5em; font-weight: 600; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.3rem); font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); color: var(--navy); text-transform: uppercase; letter-spacing: 0.015em; }
h3 { font-size: 1.28rem; color: var(--navy); letter-spacing: 0.01em; }
p { margin: 0 0 1em; }
a { color: var(--red-dark); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section--tight { padding: 48px 0; }
.section--paper { background: var(--paper); }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 62ch; }
.center { text-align: center; }
.center .lede { margin-inline: auto; }

/* Section headings get a short star-and-rule accent. */
.section h2:not(.plain)::after,
.banner h1::after {
  content: "";
  display: block;
  width: 68px; height: 3px;
  margin-top: 14px;
  background: var(--red);
  box-shadow: 12px 0 0 -1px var(--bg), 20px 0 0 0 var(--gold);
}
.center h2:not(.plain)::after { margin-inline: auto; }
.banner h1::after { background: var(--gold); box-shadow: none; margin-top: 16px; }

/* Skip link */
.skip { position: absolute; left: -9999px; background: var(--navy); color: #fff; padding: 12px 20px; z-index: 100; }
.skip:focus { left: 12px; top: 12px; }

/* ---------- Top utility bar (Follow on Facebook) — injected by site.js ---------- */
.topbar { background: var(--navy-deep); border-bottom: 2px solid var(--gold); }
.topbar__inner { display: flex; justify-content: flex-end; padding: 8px 24px; }
.topbar a {
  display: inline-flex; align-items: center; gap: 9px; color: #fff; text-decoration: none;
  font-family: var(--head); font-size: 0.95rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.07em;
}
.topbar a:hover { color: var(--gold-soft); }
.topbar svg { flex: none; }
.topbar__arrow { transition: transform .15s ease; }
.topbar a:hover .topbar__arrow { transform: translateX(3px); }
@media (max-width: 860px) { .topbar__inner { justify-content: center; } }

/* ---------- Header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 4px solid var(--red);
  box-shadow: 0 1px 0 var(--gold), 0 2px 14px rgba(20, 34, 58, 0.09);
}
.hdr__inner { max-width: var(--wrap); margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); }
.brand__mark { width: 52px; height: 52px; border-radius: 50%; display: block; flex: none; }
.brand__text { font-family: var(--head); font-weight: 600; font-size: 1.2rem; line-height: 1.05; text-transform: uppercase; letter-spacing: 0.02em; }
.brand__text span { display: block; font-family: var(--font); font-weight: 400; font-size: 0.7rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav a {
  padding: 8px 13px; border-radius: 3px; text-decoration: none;
  color: var(--navy); font-family: var(--head); font-size: 1rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.nav a:hover { background: var(--bg); color: var(--red-dark); }
.nav a[aria-current="page"] { color: var(--red-dark); box-shadow: inset 0 -3px 0 var(--gold); border-radius: 0; }
/* Donate is a filled button, not a text link — don't let the current-page style
   turn it red-on-red or add the underline. Keep it a proper white-on-red button. */
.nav a.btn--donate[aria-current="page"] { color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); border-radius: 2px; }

.nav__toggle { margin-left: auto; display: none; background: none; border: 1px solid var(--line); border-radius: 3px; padding: 8px 12px; font-size: 1.1rem; cursor: pointer; color: var(--navy); }

/* ---------- Buttons — sign-style ---------- */
.btn {
  display: inline-block; padding: 12px 26px; border-radius: 2px;
  font-family: var(--head); font-weight: 600; font-size: 1.02rem; text-transform: uppercase; letter-spacing: 0.05em;
  text-decoration: none; cursor: pointer; border: 2px solid transparent;
  transition: transform .06s ease, background .15s ease, color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--donate { background: var(--red); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.btn--donate:hover { background: var(--red-dark); }
.btn--navy { background: var(--navy); color: #fff; }
.btn--navy:hover { background: var(--navy-deep); }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn--ghost:hover { background: rgba(255,255,255,.12); }
.btn--outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn--outline:hover { background: var(--navy); color: #fff; }
.btn--sm { padding: 9px 18px; font-size: 0.95rem; }
.btn--lg { padding: 16px 40px; font-size: 1.12rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.center .btn-row { justify-content: center; }

/* ---------- Hero ---------- */
/* The Lincoln statue + Logan County courthouse, dimmed under a navy wash so the
   headline stays legible. Darker on the left where the text sits; the courthouse
   shows through on the right. */
.hero {
  background:
    linear-gradient(100deg, rgba(20,34,58,.90) 0%, rgba(20,34,58,.66) 44%, rgba(20,34,58,.26) 100%),
    url("hero-courthouse.jpg") center 26%/cover no-repeat;
  color: #fff; padding: 46px 0 54px; position: relative; overflow: hidden;
  border-bottom: 5px solid var(--red);
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: repeating-linear-gradient(90deg, var(--gold) 0 22px, transparent 22px 30px);
  opacity: .5;
}
.hero__inner { position: relative; z-index: 1; max-width: 70rem; }
.hero h1 { color: #fff; text-shadow: 0 1px 5px rgba(8,16,30,.45); font-size: clamp(1.85rem, 4.4vw, 2.75rem); margin-bottom: 0.3em; }
.hero .lede { color: rgba(255, 255, 255, 0.9); text-shadow: 0 1px 4px rgba(8,16,30,.5); margin-bottom: 10px; max-width: 46rem; }
.hero .btn-row { margin-top: 18px !important; }
.hero__eyebrow {
  display: inline-block; margin-bottom: 10px; padding: 5px 16px;
  color: var(--gold-soft); font-family: var(--head); font-weight: 600;
  font-size: 0.82rem; letter-spacing: 0.16em; text-transform: uppercase;
  border-top: 2px solid var(--gold); border-bottom: 2px solid var(--gold);
}
.hero__eyebrow::before, .hero__eyebrow::after { content: "\2605"; color: var(--red); margin: 0 10px; }

/* ---------- Page banner (interior pages) ---------- */
.banner { background: var(--navy-deep); color: #fff; padding: 60px 0; border-bottom: 5px solid var(--red); position: relative; }
.banner::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: repeating-linear-gradient(90deg, var(--gold) 0 22px, transparent 22px 30px); opacity: .5; }
.banner h1 { color: #fff; margin-bottom: .2em; }
.banner p { color: rgba(255,255,255,.82); margin: 0; max-width: 62ch; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 24px; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--navy);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card__icon {
  width: 46px; height: 46px; border-radius: 50%; margin-bottom: 16px;
  background: var(--navy); color: var(--gold-soft);
  display: grid; place-items: center; font-size: 1.35rem;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--gold);
}

/* Event list — rendered from content/events.json */
.event {
  display: flex; gap: 20px; align-items: flex-start;
  background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--red);
  border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow);
}
.event__date { flex: none; text-align: center; min-width: 64px; background: var(--navy); color: #fff; border-radius: 3px; padding: 8px 6px; }
.event__mon { display: block; font-family: var(--head); font-size: 0.74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-soft); }
.event__day { display: block; font-family: var(--head); font-size: 1.7rem; font-weight: 700; line-height: 1.05; }
.event__body h3 { margin: 0 0 4px; }
.event__meta { color: var(--muted); font-size: 0.92rem; margin: 0 0 6px; }
.event__body p:last-child { margin-bottom: 0; }
.stack { display: grid; gap: 16px; }

/* Candidate list — rendered from content/candidates.json */
.candgroup { margin-bottom: 48px; }
.candgroup:last-child { margin-bottom: 0; }
.candlist { background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--navy); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cand { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 15px 24px; border-bottom: 1px solid var(--line); }
.cand:last-child { border-bottom: 0; }
.cand__office { color: var(--muted); font-size: 0.95rem; }
.cand__name { color: var(--navy); font-weight: 600; font-family: var(--head); font-size: 1.22rem; letter-spacing: .01em; text-align: right; }
@media (max-width: 520px) { .cand { flex-direction: column; gap: 2px; } .cand__name { text-align: left; } }

.empty { border: 2px dashed var(--line); border-radius: var(--radius); padding: 36px; text-align: center; color: var(--muted); background: var(--paper); }

/* ---------- Photo gallery (content/gallery.json) ---------- */
.galgroup { margin-bottom: 48px; }
.galgroup:last-child { margin-bottom: 0; }
.galgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.gal__item {
  display: block; position: relative; padding: 0; margin: 0; border: 0; cursor: pointer;
  background: var(--paper); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); aspect-ratio: 4 / 3;
}
.gal__item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.gal__item:hover img { transform: scale(1.04); }
.gal__cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 12px 9px; text-align: left;
  color: #fff; font-size: 0.82rem; line-height: 1.3;
  background: linear-gradient(transparent, rgba(14,24,40,.85));
}
.galprev { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

/* Lightbox (opens a gallery photo full-size) */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; padding: 24px;
  background: rgba(8,14,26,.93);
}
/* 76vh (not 82) leaves room for the caption AND the "3 of 24" counter without
   pushing the image off a short laptop screen. */
.lightbox__img { max-width: 92vw; max-height: 76vh; border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,.55); }
.lightbox__cap { color: rgba(255,255,255,.9); font-size: 0.95rem; margin: 0; text-align: center; max-width: 80ch; }
.lightbox__close {
  position: absolute; top: 14px; right: 20px; background: none; border: 0; color: #fff;
  font-size: 2.4rem; line-height: 1; cursor: pointer; padding: 4px 10px;
}
/* Prev/next arrows. Absolutely positioned so they sit beside the photo without
   joining the flex column that stacks image over caption. */
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 54px; height: 78px; padding: 0;
  background: rgba(255,255,255,.10); border: 0; border-radius: 5px;
  color: #fff; font-size: 2.6rem; line-height: 1; cursor: pointer;
  transition: background .18s ease;
}
.lightbox__nav:hover { background: rgba(255,255,255,.22); }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }
.lightbox__count {
  margin: 0; color: rgba(255,255,255,.62);
  font-size: 0.78rem; letter-spacing: .09em; text-transform: uppercase;
}
@media (max-width: 640px) {
  .lightbox__nav { width: 42px; height: 62px; font-size: 2rem; }
  .lightbox__nav--prev { left: 3px; }
  .lightbox__nav--next { right: 3px; }
}

/* Promo graphic inside an event card (content/events.json "image") */
.event__img { display: block; width: 100%; max-width: 520px; border-radius: 6px; margin: 4px 0 10px; }

/* ---------- Donate band ---------- */
.band { background: var(--red); color: #fff; padding: 66px 0; text-align: center; position: relative; border-top: 5px solid var(--navy-deep); border-bottom: 5px solid var(--navy-deep); }
.band::before { content: "\2605 \2605 \2605"; display: block; color: var(--gold-soft); letter-spacing: 1em; font-size: .8rem; margin-bottom: 18px; padding-left: 1em; }
.band h2 { color: #fff; }
.band h2::after { display: none; }
.band p { color: rgba(255,255,255,.92); max-width: 60ch; margin-inline: auto; }
.band .btn--donate { background: #fff; color: var(--red); }
.band .btn--donate:hover { background: var(--bg); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; max-width: 620px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 0.95rem; color: var(--navy); }
.field .hint { font-size: 0.85rem; color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 1rem; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 3px; background: var(--paper); color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgba(28, 46, 74, 0.2); outline-offset: 0; border-color: var(--navy); }
.field textarea { resize: vertical; min-height: 130px; }
.field--check { grid-template-columns: auto 1fr; align-items: start; gap: 10px; }
.field--check input { margin-top: 5px; }
.field--check label { font-weight: 400; font-size: 0.95rem; color: var(--text); }
.required { color: var(--red); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.formmsg {
  padding: 16px 20px; border-radius: 4px; font-weight: 600; font-size: 1.05rem;
  border: 1px solid; border-left-width: 6px;
  display: flex; align-items: baseline; gap: 10px;
}
.formmsg::before { font-weight: 700; font-size: 1.1rem; line-height: 1; }
.formmsg--ok { background: #e4f3e1; border-color: #8ccc84; border-left-color: #2e7d32; color: #1d5c25; }
.formmsg--ok::before { content: "\2714"; color: #2e7d32; }
.formmsg--err { background: #f8e3db; border-color: #dc9d88; border-left-color: var(--red); color: var(--red-dark); }
.formmsg--err::before { content: "\26A0"; color: var(--red); }
[hidden] { display: none !important; }

/* ---------- Callouts ---------- */
.note { background: #fbf3dc; border: 1px solid #e7d19a; border-left: 5px solid var(--gold); border-radius: var(--radius); padding: 20px 24px; }
.note p:last-child { margin-bottom: 0; }
.note strong { color: var(--navy); }

.legal { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; font-size: 0.92rem; color: var(--muted); }
.legal p:last-child { margin-bottom: 0; }

.linklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.linklist a {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: var(--radius); padding: 18px 22px; text-decoration: none; color: var(--navy); font-weight: 600;
  box-shadow: var(--shadow);
}
.linklist a:hover { border-left-color: var(--red); color: var(--red-dark); }
.linklist span { color: var(--muted); font-weight: 400; font-size: 0.9rem; }

/* ---------- Footer ---------- */
/* B — stars-and-stripes "bunting" band across the top of the footer */
.ftr {
  background:
    repeating-linear-gradient(90deg, var(--red) 0 22px, #fff 22px 44px) top/100% 6px no-repeat,
    var(--navy-deep);
  color: rgba(255,255,255,.75); padding: 56px 0 28px; font-size: 0.94rem;
}
/* A — small American flag beside the committee name in the footer */
.ftr__grid > div:first-child h4::after {
  content: ""; display: inline-block; width: 27px; height: 15px;
  margin-left: 10px; vertical-align: -1px;
  background: url("flag.svg") center/contain no-repeat;
  border-radius: 1px; box-shadow: 0 0 0 1px rgba(255,255,255,.22);
}
/* C — committee seal + American flag emblem row in the hero (index) */
.hero__badges { display: flex; align-items: center; gap: 15px; margin-bottom: 12px; }
.hero__seal { width: 90px; height: 90px; flex: none; filter: drop-shadow(0 3px 12px rgba(0,0,0,.55)); }
.hero__flag { width: 64px; height: auto; border-radius: 2px; box-shadow: 0 3px 10px rgba(0,0,0,.45); }
/* Second seal on the right side of the hero — placed upper-right so Abe (lower-center) stays exposed */
.hero__seal-right {
  position: absolute; top: 12%; right: 4%; width: 188px; height: 188px; z-index: 1;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.55));
}
@media (max-width: 1080px) { .hero__seal-right { display: none; } }
.ftr a { color: #fff; }
.ftr__grid { display: grid; gap: 32px; grid-template-columns: 1.4fr 1fr 1fr; }
.ftr h4 { color: #fff; font-family: var(--head); font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 12px; }
.ftr ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ftr__legal { margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.15); font-size: 0.86rem; color: rgba(255,255,255,.6); }
.ftr__legal strong { color: rgba(255,255,255,.9); }

@media (max-width: 860px) {
  .nav__toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 4px solid var(--red); padding: 8px;
    box-shadow: 0 12px 24px rgba(20,34,58,.14);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px; border-radius: 0; }
  .nav .btn { margin-top: 8px; text-align: center; }
  .hdr__inner { position: relative; }
  /* Full-width text on mobile — even the wash so the headline stays readable. */
  .hero { background:
    linear-gradient(rgba(20,34,58,.86), rgba(20,34,58,.86)),
    url("hero-courthouse.jpg") center 28%/cover no-repeat; padding: 72px 0 64px; }
  .ftr__grid { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
}
