/* ================================================
   DC Election Facts — styles.css
   Design language: bold editorial, civic-neutral
   - Heavy display sans (Archivo Black) for headlines
   - Inter for body
   - Highlighter mark on key facts (warm gold)
   - Wavy SVG section dividers
   - High contrast, generous whitespace, mobile-first
   ================================================ */

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f7f5f0;
  --color-text: #0a0a0a;
  --color-text-soft: #4a4a4a;
  --color-border: #e5e5e5;
  --color-rule: #1a1a1a;
  --color-accent: #0b2545;       /* deep navy */
  --color-accent-light: #1d3a7a;
  --color-highlight: #fde047;    /* warm gold highlighter */
  --color-highlight-soft: rgba(253, 224, 71, 0.55);
  --color-pending: #a3a3a3;

  --font-display: "Archivo Black", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --container-max: 1180px;
  --container-narrow: 760px;
  --radius: 6px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 18px rgba(0,0,0,0.06);
}

/* ===== Reset & base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--color-accent-light); }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: #000; color: #fff; padding: 8px 12px;
  z-index: 999;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ===== Layout helpers ===== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}
.container.narrow { max-width: var(--container-narrow); }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding-top: 10px; padding-bottom: 10px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit;
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex: 0 0 auto;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-soft);
  margin-top: 2px;
}
.primary-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.primary-nav a {
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text);
  text-decoration: none;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.primary-nav a:hover {
  border-bottom-color: var(--color-accent);
  color: var(--color-accent);
}
@media (max-width: 640px) {
  .brand-tag { display: none; }
  .primary-nav { gap: 12px; }
  .primary-nav a { font-size: 13px; }
}

/* ===== Hero ===== */
.hero {
  padding: 88px 0 72px;
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
  border-bottom: 1px solid var(--color-rule);
  position: relative;
}
.hero .kicker {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-accent);
  margin: 0 0 16px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  max-width: 14ch;
}
.hero .lead {
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.45;
  max-width: 60ch;
  margin: 0 0 32px;
  color: var(--color-text);
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.08s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--color-text);
  color: #fff;
}
.btn-primary:hover {
  background: var(--color-accent);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-rule);
}
.btn-ghost:hover {
  background: var(--color-text);
  color: #fff;
}
.btn-secondary {
  background: var(--color-accent);
  color: #fff;
  font-size: 14px;
  padding: 10px 18px;
}
.btn-secondary:hover {
  background: var(--color-accent-light);
  color: #fff;
}

/* ===== Section base ===== */
.section { padding: 80px 0; position: relative; }
.section-alt { background: var(--color-bg-alt); }
.section-heading {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.section-intro {
  font-size: 18px;
  color: var(--color-text-soft);
  max-width: 70ch;
  margin: 0 0 40px;
}

/* Wavy divider between major sections */
.section + .section { border-top: none; }
.section::before {
  content: "";
  display: block;
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 16px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 16' preserveAspectRatio='none'><path d='M0,8 C150,16 300,0 600,8 C900,16 1050,0 1200,8' stroke='%230a0a0a' stroke-width='2' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
  opacity: 0;
}
.section.section-alt::before,
.section + .section::before { opacity: 1; }

/* ===== Highlighter mark ===== */
mark {
  background: linear-gradient(180deg, transparent 55%, var(--color-highlight-soft) 55%, var(--color-highlight-soft) 92%, transparent 92%);
  padding: 0 2px;
  color: inherit;
  font-weight: 600;
  border-radius: 2px;
}

/* ===== Candidates ===== */
.candidates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.candidate-card {
  background: var(--color-bg);
  border: 2px solid var(--color-rule);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.candidate-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #efeae0, #f7f5f0);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  color: var(--color-accent);
  margin-bottom: 20px;
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.candidate-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}
.candidate-photo.placeholder-photo span { letter-spacing: 0.05em; }
.candidate-name {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 38px);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.candidate-role {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-soft);
  font-weight: 600;
  margin: 0 0 16px;
}
.candidate-bio {
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  margin: 0;
}

@media (max-width: 760px) {
  .candidates-grid { grid-template-columns: 1fr; gap: 24px; }
  .candidate-card { padding: 24px; }
}

/* ===== Filter bar ===== */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 32px;
  padding: 12px 0;
  position: sticky;
  top: 64px;
  z-index: 10;
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}
.filter-btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 14px;
  border: 2px solid var(--color-rule);
  background: var(--color-bg);
  color: var(--color-text);
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.filter-btn:hover {
  background: var(--color-text);
  color: var(--color-bg);
}
.filter-btn.is-active {
  background: var(--color-text);
  color: var(--color-bg);
}

/* ===== Comparison header (sticky names) ===== */
.comparison-header {
  display: grid;
  grid-template-columns: 220px 1fr 1fr;
  gap: 24px;
  padding: 16px 0;
  margin-bottom: 24px;
  border-top: 2px solid var(--color-rule);
  border-bottom: 2px solid var(--color-rule);
  position: sticky;
  top: 124px;
  z-index: 9;
  background: var(--color-bg-alt);
}
.ch-name {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.5vw, 28px);
  line-height: 1;
}
.ch-spacer { font-size: 0; }

@media (max-width: 760px) {
  .comparison-header { display: none; }
}

/* ===== Issue area ===== */
.issue-area {
  margin: 0 0 56px;
  scroll-margin-top: 200px;
}
.area-heading {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.2vw, 36px);
  letter-spacing: -0.01em;
  margin: 0 0 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-rule);
  text-transform: uppercase;
}
.issue {
  display: grid;
  grid-template-columns: 220px 1fr 1fr;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--color-border);
}
.issue-heading {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.005em;
}
.comparison {
  display: contents;
}
.position {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  font-size: 16px;
  line-height: 1.65;
}
.position p { margin: 0 0 14px; }
.position p:last-child { margin-bottom: 0; }
.position blockquote {
  margin: 14px 0;
  padding: 6px 0 6px 16px;
  border-left: 3px solid var(--color-rule);
  font-style: italic;
  color: var(--color-text);
}
.position .sources {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--color-border);
  font-size: 13px;
  color: var(--color-text-soft);
  line-height: 1.55;
}
.position .sources strong { color: var(--color-text); }
.position .sources a {
  color: var(--color-text-soft);
  text-decoration: underline;
  text-decoration-color: var(--color-border);
}
.position .sources a:hover {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
}

.position-pending {
  background: transparent;
  border-style: dashed;
  display: flex; align-items: center; justify-content: center;
  min-height: 80px;
}
.position-pending .placeholder {
  color: var(--color-pending);
  font-style: italic;
  font-size: 14px;
  margin: 0;
  text-align: center;
}

@media (max-width: 880px) {
  .issue {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .issue-heading {
    grid-column: 1 / -1;
    margin-bottom: 4px;
    font-size: 22px;
  }
}
@media (max-width: 560px) {
  .issue { grid-template-columns: 1fr; gap: 12px; }
  .position { padding: 18px; }
  .position::before {
    content: attr(data-name);
  }
  /* Mobile: inject candidate name labels */
  .issue .position:nth-of-type(1)::before {
    content: "KENYAN McDUFFIE";
    display: block;
    font-family: var(--font-display);
    font-size: 13px;
    letter-spacing: 0.06em;
    color: var(--color-accent);
    margin-bottom: 10px;
  }
  .issue .position:nth-of-type(2)::before {
    content: "JANEESE LEWIS GEORGE";
    display: block;
    font-family: var(--font-display);
    font-size: 13px;
    letter-spacing: 0.06em;
    color: var(--color-accent);
    margin-bottom: 10px;
  }
}

/* Filtering: hide non-matching areas when a filter is active */
body.filter-active .issue-area:not(.is-visible) { display: none; }

/* ===== Voter info grid ===== */
.voter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 32px;
}
.voter-card {
  background: var(--color-bg);
  border: 2px solid var(--color-rule);
  border-radius: var(--radius);
  padding: 24px;
  display: flex; flex-direction: column;
  gap: 12px;
}
.voter-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.01em;
}
.voter-card p { margin: 0; font-size: 15px; line-height: 1.55; }
.voter-card .placeholder-soft {
  color: var(--color-text-soft);
  font-style: italic;
  font-size: 14px;
}
.voter-card .btn { margin-top: auto; align-self: flex-start; }

/* ===== About ===== */
#about h3 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 32px 0 12px;
  letter-spacing: -0.005em;
}
#about p { font-size: 17px; line-height: 1.7; margin: 0 0 16px; }
.last-updated {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  font-size: 14px;
  color: var(--color-text-soft);
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-text);
  color: #ddd;
  padding: 40px 0 48px;
  font-size: 14px;
}
.site-footer p { margin: 0 0 6px; }
.site-footer .footer-meta { color: #999; font-size: 13px; }

/* ===== Print ===== */
@media print {
  .site-header, .filter-bar, .hero-actions, .site-footer { display: none; }
  body { font-size: 12px; }
  .position { break-inside: avoid; border: 1px solid #ccc; }
  .issue { break-inside: avoid; }
  a { color: #000; text-decoration: underline; }
  mark { background: #ffe; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
