/* ward8votes.org — shared styles
   Palette: cool paper, deep Anacostia green, marigold marker.
   Type: Atkinson Hyperlegible Next (built for readability), Caveat only for handwriting on the ballot. */

:root {
  --paper: #f5f7f3;
  --surface: #ffffff;
  --ink: #17211c;
  --ink-2: #44514a;
  --green: #1e5b43;
  --green-dark: #154332;
  --green-tint: #e3eee8;
  --marigold: #f3b83a;
  --marigold-tint: #fdf1d4;
  --rule: #c9d3cd;

  --measure: 40rem;
  --wide: 62rem;
  --gutter: clamp(1rem, 4vw, 2rem);

  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; }

a { color: var(--green); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { color: var(--green-dark); text-decoration-thickness: 0.14em; }

:focus-visible { outline: 3px solid var(--marigold); outline-offset: 3px; border-radius: 2px; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem; z-index: 10;
}
.skip-link:focus { top: 1rem; color: #fff; }

/* ---------- Disclaimer bar ---------- */
.disclaimer {
  background: var(--ink);
  color: #f0f3f1;
  font-size: 0.95rem;
  line-height: 1.45;
  padding: 0.6rem var(--gutter);
}
.disclaimer p { margin: 0 auto; max-width: var(--wide); }

/* ---------- Site header (same on every page) ---------- */
.site-header {
  position: relative;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.9rem var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.wordmark { font-weight: 800; font-size: 1.2rem; color: var(--ink); text-decoration: none; }
.wordmark:hover { color: var(--green); }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem 1.75rem; }
.site-nav li { margin: 0; }
.site-nav a {
  display: block; padding: 0.35rem 0;
  font-weight: 700; font-size: 1.05rem;
  color: var(--ink); text-decoration: none;
  border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: var(--green); border-bottom-color: var(--rule); }
.site-nav a[aria-current="page"] { color: var(--green); border-bottom-color: var(--green); }

.menu-toggle { display: none; }

/* Small screens: the main menu collapses behind a Menu button (only when JavaScript is on,
   so the links stay visible if it isn't). */
@media (max-width: 43.99rem) {
  .js .menu-toggle {
    display: inline-flex; align-items: center; gap: 0.55rem;
    font: inherit; font-size: 1rem; font-weight: 700;
    color: var(--ink); background: var(--surface);
    border: 2px solid var(--ink); border-radius: 0.5rem;
    padding: 0.45rem 0.8rem; cursor: pointer;
  }
  .js .menu-toggle:hover { background: var(--green-tint); }
  .bars, .bars::before, .bars::after {
    display: block; width: 1.15rem; height: 2px; background: var(--ink);
    transition: transform 0.15s ease, background-color 0.15s ease;
  }
  .bars { position: relative; }
  .bars::before, .bars::after { content: ""; position: absolute; left: 0; }
  .bars::before { top: -6px; }
  .bars::after { top: 6px; }
  .menu-toggle[aria-expanded="true"] .bars { background: transparent; }
  .menu-toggle[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); }

  .js .site-nav {
    display: none;
    position: absolute; z-index: 20;
    top: calc(100% - 0.25rem); left: var(--gutter); right: var(--gutter);
    background: var(--surface);
    border: 2px solid var(--ink); border-radius: 0.5rem;
    box-shadow: 0.35rem 0.35rem 0 var(--green);
  }
  .js .site-header.menu-open .site-nav { display: block; }
  .js .site-nav ul { flex-direction: column; gap: 0; }
  .js .site-nav li + li { border-top: 1px solid var(--rule); }
  .js .site-nav a { padding: 0.9rem 1.1rem; font-size: 1.15rem; border-bottom: 0; }
  .js .site-nav a[aria-current="page"] { background: var(--green-tint); box-shadow: inset 4px 0 0 var(--green); }
}
@media (prefers-reduced-motion: reduce) { .bars, .bars::before, .bars::after { transition: none; } }

/* ---------- On-this-page menu ---------- */
.page-nav { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.page-nav ul {
  list-style: none; margin: 0; padding: 0.6rem 0;
  display: flex; flex-wrap: wrap; gap: 0.2rem 1.25rem;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
}
.page-nav li { margin: 0; }
.page-nav a { color: var(--ink-2); }
.page-nav a:hover { color: var(--green); }

/* ---------- Back to top ---------- */
.to-top {
  display: inline-block;
  margin-top: 1.75rem;
  font-size: 0.9rem;
  color: var(--ink-2);
  opacity: 0.7;
  text-decoration: none;
}
.to-top:hover, .to-top:focus-visible { opacity: 1; color: var(--green); text-decoration: underline; }

/* ---------- Layout ---------- */
main { display: block; }

.section {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 4.5rem) var(--gutter);
  border-top: 1px solid var(--rule);
}
.section > * { max-width: var(--measure); }
.section > .wide { max-width: none; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.75rem; }
h1 { font-size: clamp(2.1rem, 6.4vw, 3.5rem); font-weight: 800; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 800; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; font-weight: 700; margin-top: 2rem; }

p, ul, ol { margin: 0 0 1rem; }
li { margin-bottom: 0.4rem; }
li::marker { color: var(--green); font-weight: 700; }

.lede { font-size: 1.25rem; color: var(--ink-2); }
.small { font-size: 0.95rem; color: var(--ink-2); }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) var(--gutter) clamp(2.5rem, 7vw, 4.5rem);
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}
@media (min-width: 52rem) {
  .hero { grid-template-columns: 1.15fr 1fr; }
}
.hero h1 { max-width: 16ch; }
.hero .lede { max-width: 34rem; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

.button {
  display: inline-block;
  padding: 0.85rem 1.3rem;
  border-radius: 0.5rem;
  border: 2px solid var(--green);
  font-weight: 700; font-size: 1.05rem; line-height: 1.2;
  text-decoration: none;
  background: var(--green); color: #fff;
}
.button:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.button.secondary { background: transparent; color: var(--green); }
.button.secondary:hover { background: var(--green-tint); color: var(--green-dark); }

/* The ballot: the one bold element on the page.
   Modeled on the real 2026 ANC-8E05 ballot section: gray header cell, heavy rule,
   white write-in cell with a small oval in its top-right corner. */
.ballot-figure {
  margin: 0;
  max-width: 28rem;
  width: 100%;
  justify-self: center;
}
.ballot {
  background: #fff;
  border: 2px solid #111;
  box-shadow: 0.5rem 0.5rem 0 var(--green);
  font-family: Arial, Helvetica, "Liberation Sans", sans-serif;
  color: #111;
}
.ballot-head {
  background: #c9c9c7;
  padding: 1.6rem 1rem 1.4rem;
  border-bottom: 6px solid #111;
}
.ballot-head p { margin: 0; font-size: clamp(1.05rem, 3.6vw, 1.3rem); line-height: 1.25; }
.ballot-head .ballot-office {
  font-size: clamp(2.1rem, 8vw, 2.7rem);
  line-height: 1.1;
  margin-bottom: 0.7rem;
}
.ballot-cell {
  position: relative;
  padding: 2.2rem 1rem 0.35rem;
}
.oval {
  position: absolute;
  top: 0.55rem; right: 0.9rem;
  width: 1.5rem; height: 0.95rem;
  border: 2px solid #111; border-radius: 50%;
}
.handwriting {
  display: inline-block;
  font-family: var(--hand);
  font-size: 2.5rem; line-height: 1.1;
  color: var(--green-dark);
  background: linear-gradient(transparent 58%, var(--marigold-tint) 58%, var(--marigold-tint) 92%, transparent 92%);
  padding: 0 0.2rem;
  margin-left: 0.25rem;
  white-space: nowrap;
  animation: write 1.6s 0.4s steps(22, end) both;
}
@keyframes write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { .handwriting { animation: none; } }
.write-line {
  display: flex; justify-content: space-between; gap: 1rem;
  border-top: 2px solid #111;
  margin-right: 12%;
  padding-top: 0.15rem;
  font-size: clamp(0.95rem, 3.2vw, 1.1rem);
}
.ballot-notes { margin-top: 1.4rem; font-size: 1.05rem; line-height: 1.45; }
.ballot-notes p { margin: 0 0 0.5rem; }
.ballot-notes p:last-child { margin-bottom: 0; }

/* ---------- Key dates ---------- */
.dates {
  max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter) clamp(2.5rem, 6vw, 3.5rem);
}
.dates h2 { font-size: 1.3rem; }
.dates ol {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
}
.dates li {
  margin: 0; padding: 0.8rem 1rem;
  background: var(--surface);
  border-left: 4px solid var(--green);
  line-height: 1.35;
}
.dates li.critical { border-left-color: var(--marigold); background: var(--marigold-tint); }
.dates strong { display: block; font-size: 1.05rem; }
.dates span { font-size: 0.95rem; color: var(--ink-2); }

/* ---------- Callouts ---------- */
.callout {
  background: var(--marigold-tint);
  border-left: 6px solid var(--marigold);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.callout h3 { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

.note {
  background: var(--green-tint);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.note p:last-child { margin-bottom: 0; }

/* ---------- Steps ---------- */
.steps { padding-left: 1.4rem; }
.steps > li { padding-left: 0.3rem; margin-bottom: 1rem; }
.steps > li > strong { display: block; }

/* ---------- Candidates ---------- */
.candidate-list {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  margin: 1.5rem 0 2.5rem;
}
.candidate {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--green);
  padding: 1.25rem;
}
.candidate img {
  width: 6rem; height: 6rem; object-fit: cover; border-radius: 50%;
  display: block; margin-bottom: 0.75rem; background: var(--green-tint);
}
.candidate h3 { margin: 0 0 0.25rem; }
.write-as { font-size: 0.95rem; color: var(--ink-2); margin-bottom: 0.75rem; }
.write-as b { font-family: var(--hand); font-size: 1.5rem; font-weight: 700; color: var(--ink); }
.status {
  display: inline-block; font-size: 0.9rem; font-weight: 700;
  padding: 0.15rem 0.6rem; border-radius: 1rem; margin-bottom: 0.75rem;
}
.status.filed { background: var(--green-tint); color: var(--green-dark); }
.status.pending { background: var(--marigold-tint); color: #5c4310; }
.candidate .bio { font-size: 1rem; }
.candidate .contact { font-size: 0.95rem; margin: 0; overflow-wrap: anywhere; }

.empty-state {
  background: var(--surface);
  border: 2px dashed var(--rule);
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.empty-state p:last-child { margin-bottom: 0; }

.compare { margin-top: 1rem; }
.compare details {
  background: var(--surface);
  border: 1px solid var(--rule);
  margin-bottom: 0.75rem;
}
.compare summary {
  cursor: pointer; padding: 1rem 1.25rem;
  font-weight: 700; line-height: 1.4;
}
.compare summary:hover { background: var(--green-tint); }
.compare .answers { padding: 0 1.25rem 0.5rem; }
.compare .answer { border-top: 1px solid var(--rule); padding: 0.9rem 0; }
.compare .answer p { margin: 0.25rem 0 0; white-space: pre-line; }
.compare .who { font-weight: 700; color: var(--green-dark); }

/* ---------- Article page (about-ancs) ---------- */
.article { max-width: var(--wide); margin: 0 auto; padding: clamp(2rem, 6vw, 3.5rem) var(--gutter); }
.article > * { max-width: var(--measure); }
.article > section { max-width: none; }
.article section > * { max-width: var(--measure); }
.article section > .table-wrap { max-width: var(--wide); }
.article h2 { margin-top: 3rem; }
.article table { border-collapse: collapse; width: 100%; max-width: var(--wide); margin: 1rem 0 1.5rem; background: var(--surface); font-size: 1rem; }
.article th, .article td { text-align: left; vertical-align: top; padding: 0.7rem 0.9rem; border: 1px solid var(--rule); }
.article th { background: var(--green-tint); }
.table-wrap { max-width: var(--wide); overflow-x: auto; }

/* ---------- Form page ---------- */
.form-frame {
  width: 100%; max-width: var(--measure); min-height: 1800px;
  border: 1px solid var(--rule); background: var(--surface);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink); color: #e3e8e5;
  padding: 2rem var(--gutter) 2.5rem;
  font-size: 0.95rem;
}
.site-footer > div { max-width: var(--wide); margin: 0 auto; }
.site-footer a { color: #fff; }
.site-footer p { max-width: var(--measure); }

.print-button {
  font: inherit; font-size: 1rem; font-weight: 700;
  background: transparent; color: var(--green);
  border: 2px solid var(--green); border-radius: 0.5rem;
  padding: 0.5rem 0.9rem; cursor: pointer;
}
.print-button:hover { background: var(--green-tint); }

/* ---------- Print ---------- */
@media print {
  body { background: #fff; font-size: 11pt; }
  .skip-link, .site-nav, .menu-toggle, .page-nav, .to-top, .actions, .print-button, .form-frame { display: none !important; }
  .disclaimer, .site-footer { background: #fff; color: #000; border: 1px solid #000; }
  .site-footer a, .disclaimer a { color: #000; }
  .section { border-top: 1px solid #999; padding: 1.2rem 0; }
  .hero { padding: 1rem 0; grid-template-columns: 1fr 1fr; }
  .ballot { box-shadow: none; }
  .ballot-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .handwriting { animation: none; }
  .compare details { break-inside: avoid; }
  .compare details > *:not(summary) { display: block; }
  .candidate, .dates li, .callout { break-inside: avoid; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; word-break: break-all; }
}
