/*
 * Voter Guide Commons: one stylesheet for the public pages and the Worker's
 * /admin pages. Tokens and their contrast ratios are documented in BRAND.md.
 *
 * The site ships no JavaScript and no inline styles (the CSP forbids both), so
 * everything visual lives here.
 */

/* ---------------------------------------------------------------- fonts */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/newsreader-roman.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/newsreader-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/publicsans-roman.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Public Sans";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/publicsans-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------- tokens */

:root {
  /* Light only (2026-10-06): reads as newsprint whatever the visitor's OS setting. */
  color-scheme: light;

  --paper: #faf7f0;
  --paper-raised: #fffdf8;
  --accent-wash: #e7efe9;
  --ink: #1b1a17;
  --ink-muted: #5b574f;
  --rule: #ddd6c8;
  --rule-strong: #8c8578;
  --accent: #1d5e52;
  --accent-ink: #ffffff;
  --ok: #2d6a31;
  --warn: #8a5300;
  --bad: #a12a1e;

  --font-serif: "Newsreader", "Iowan Old Style", Charter, Georgia, serif;
  --font-sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.3rem + 2vw, 2.375rem);
  --step-4: clamp(2.125rem, 1.4rem + 3.4vw, 3.375rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  --measure: 40rem;
  --radius: 3px;
}


/* ----------------------------------------------------------------- base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}

h1 {
  font-size: var(--step-4);
  font-weight: 650;
}

h2 {
  font-size: var(--step-3);
}

h3 {
  font-size: var(--step-1);
  line-height: 1.3;
}

p,
ul,
ol {
  margin: 0 0 var(--space-4);
}

ul,
ol {
  padding-left: 1.25rem;
}

li + li {
  margin-top: var(--space-2);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

strong {
  font-weight: 650;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--space-7) 0;
}

/* ---------------------------------------------------------------- utils */

.wrap {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

@media (min-width: 48rem) {
  .wrap {
    padding: 0 var(--space-6);
  }
}

.prose {
  max-width: var(--measure);
}

.muted {
  color: var(--ink-muted);
}

.small {
  font-size: var(--step--1);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* The signup honeypot. Off-screen rather than display:none, since some bots
   skip fields they can tell are hidden. */
.trap {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -3rem;
  background: var(--accent);
  color: var(--accent-ink);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  z-index: 10;
}

.skip-link:focus {
  top: var(--space-3);
}

.kicker {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--step--1);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--space-3);
}

/* --------------------------------------------------------------- header */

.site-header {
  border-top: 5px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-size: 1.375rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1;
}

.wordmark:hover {
  color: var(--ink);
}


.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li + li {
  margin-top: 0;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 550;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

.site-nav a.button,
.site-nav a.button:hover {
  color: var(--accent-ink);
  text-decoration: none;
}

/* --------------------------------------------------------------- footer */

.site-footer {
  margin-top: var(--space-8);
  border-top: 1px solid var(--rule);
  padding: var(--space-6) 0 var(--space-7);
  font-size: var(--step--1);
  color: var(--ink-muted);
}

.site-footer p {
  max-width: var(--measure);
  margin-bottom: var(--space-2);
}

.site-footer .wordmark {
  font-size: 1.125rem;
  margin-bottom: var(--space-4);
}


/* -------------------------------------------------------------- buttons */

.button {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  font-weight: 650;
  line-height: 1.2;
  padding: 0.7rem 1.1rem;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.button--secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}

.button--secondary:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.site-nav .button {
  padding: 0.5rem 0.85rem;
  font-size: var(--step--1);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-5);
}

/* ---------------------------------------------------------------- pages */

main {
  display: block;
}

.hero {
  padding: var(--space-7) 0 var(--space-6);
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 48rem) {
  .hero {
    padding: var(--space-8) 0 var(--space-7);
  }
}

.hero h1 {
  max-width: 22ch;
}

.lede {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-size: var(--step-2);
  line-height: 1.45;
  max-width: 36rem;
  color: var(--ink);
}

.page-head {
  padding: var(--space-7) 0 var(--space-5);
}

.page-head h1 {
  max-width: 24ch;
}

.section {
  padding: var(--space-7) 0 0;
}

.section > h2 {
  max-width: 28ch;
}

.two-col {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 52rem) {
  .two-col {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-7);
    align-items: start;
  }
}

/* Numbered steps, set like a newspaper explainer. */
.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 52rem) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6);
  }
}

.steps li {
  counter-increment: step;
  border-top: 2px solid var(--ink);
  padding-top: var(--space-3);
  margin: 0;
}

.steps li::before {
  content: counter(step);
  display: block;
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-size: 2.5rem;
  font-weight: 500;
  line-height: 1;
  color: var(--accent);
  margin-bottom: var(--space-3);
}

.steps h3 {
  margin-bottom: var(--space-2);
}

.steps p {
  margin: 0;
}

/* A list of short points, each with a ruled top. */
.points {
  list-style: none;
  padding: 0;
  margin: 0;
}

.steps + .points {
  margin-top: var(--space-7);
  max-width: 40rem;
}

.points li {
  border-top: 1px solid var(--rule);
  padding: var(--space-4) 0;
  margin: 0;
}

.points li:last-child {
  border-bottom: 1px solid var(--rule);
}

.points h3 {
  margin-bottom: var(--space-1);
}

.points p {
  margin: 0;
}

.callout {
  background: var(--accent-wash);
  border-left: 4px solid var(--accent);
  padding: var(--space-5);
  border-radius: 0 var(--radius) var(--radius) 0;
  max-width: var(--measure);
}

.callout > :last-child {
  margin-bottom: 0;
}

.credit {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-size: var(--step-1);
}

.band {
  margin-top: var(--space-8);
  border-top: 5px solid var(--ink);
  padding-top: var(--space-5);
}

.band h2 {
  max-width: 24ch;
}

/* A wordless sketch of an answer: quote, credit line, link. Bars stand in for
   text so the illustration never puts words in a candidate's mouth. */
.answer-sketch {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--space-5);
  margin: 0;
}

.answer-sketch .sketch-label {
  display: block;
  font-size: var(--step--1);
  color: var(--ink-muted);
  margin-bottom: var(--space-4);
}

.answer-sketch .sketch-quote {
  border-left: 3px solid var(--accent);
  padding-left: var(--space-4);
  margin-bottom: var(--space-4);
}

.bar {
  display: block;
  height: 0.6rem;
  border-radius: 2px;
  background: var(--rule);
  margin: 0 0 0.55rem;
}

.bar--90 {
  width: 90%;
}

.bar--100 {
  width: 100%;
}

.bar--75 {
  width: 75%;
}

.bar--60 {
  width: 60%;
}

.answer-sketch .sketch-credit {
  display: block;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-1);
}

.answer-sketch .sketch-link {
  display: block;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--accent);
}

.answer-sketch figcaption {
  margin-top: var(--space-4);
  font-size: var(--step--1);
  color: var(--ink-muted);
}

/* ---------------------------------------------------------------- forms */

form {
  max-width: var(--measure);
}

fieldset {
  border: 0;
  margin: 0 0 var(--space-6);
  padding: 0;
  min-width: 0;
}

/* Floated so the rule sits above the legend instead of running through it. */
legend {
  float: left;
  width: 100%;
  border-top: 2px solid var(--ink);
  padding: var(--space-3) 0 0;
  margin-bottom: var(--space-4);
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-size: var(--step-2);
  font-weight: 600;
}

legend + * {
  clear: both;
}

.field {
  margin-bottom: var(--space-5);
}

.field label,
.field .label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.hint {
  display: block;
  font-size: var(--step--1);
  color: var(--ink-muted);
  margin-bottom: var(--space-2);
}

.optional {
  font-weight: 400;
  color: var(--ink-muted);
}

input[type="text"],
input[type="url"],
input[type="email"],
textarea {
  display: block;
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.choices {
  display: grid;
  gap: var(--space-3);
}

.choice {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
}

.choice:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.choice input,
.check input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.25rem 0 0;
  accent-color: var(--accent);
  flex: none;
}

.choice strong {
  display: block;
}

.choice span {
  display: block;
}

.check {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-weight: 600;
}

.submit-note {
  font-size: var(--step--1);
  color: var(--ink-muted);
  margin-top: var(--space-3);
}

/* ------------------------------------------------------- admin helpers */

.badge {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: 0.02em;
  padding: 0.1rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--ink-muted);
  background: var(--paper-raised);
  white-space: nowrap;
}

.badge--ok {
  color: var(--ok);
}

.badge--warn {
  color: var(--warn);
}

.badge--bad {
  color: var(--bad);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  margin: 0 0 var(--space-5);
}

caption {
  text-align: left;
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-size: var(--step-1);
  font-weight: 600;
  padding-bottom: var(--space-2);
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}

thead th {
  border-bottom: 2px solid var(--ink);
  font-weight: 650;
  white-space: nowrap;
}

td.num,
th.num {
  text-align: right;
  padding-right: 0;
  padding-left: 0.75rem;
}

.table-scroll {
  overflow-x: auto;
  max-width: 100%;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--space-4);
  margin: 0 0 var(--space-6);
}

.stat {
  border-top: 2px solid var(--ink);
  padding-top: var(--space-3);
}

.stat-value {
  display: block;
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-size: var(--step-3);
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums lining-nums;
}

.stat-label {
  display: block;
  font-size: var(--step--1);
  color: var(--ink-muted);
  margin-top: var(--space-1);
}

/* ---------------------------------------------------------------- print */

@media print {
  .site-nav,
  .skip-link,
  .actions {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
