/* FreshTake Florida - 2026 Primary
   Self-contained design system. No Bootstrap. Scoped to /2026P/ only -
   other election-cycle folders keep their existing (Bootstrap) styling. */

:root {
  color-scheme: light;
  --surface: #fcfcfb;
  --surface-alt: #f9f9f7;
  --ink: #0b0b0b;
  --ink-secondary: #52514e;
  --ink-muted: #898781;
  --border: #e1e0d9;
  --border-strong: #c3c2b7;

  --accent: #2a78d6;
  --rep: #e34948;
  --dem: #2a78d6;
  --oth: #eda100;
  --good: #0ca30c;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 2px rgba(11, 11, 11, 0.04), 0 1px 8px rgba(11, 11, 11, 0.05);
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface-alt);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

hr { display: none; } /* replaced by card boundaries */

/* ---------- Ticker (statewide turnout strip) ---------- */
.ticker {
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  padding: 7px 20px;
  text-align: center;
  letter-spacing: 0.01em;
}
.ticker strong { font-weight: 600; }
.ticker .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin: 0 5px 0 14px;
  vertical-align: middle;
}
.ticker .dot:first-child { margin-left: 0; }
.ticker .dot--rep { background: var(--rep); }
.ticker .dot--dem { background: var(--dem); }
.ticker .dot--oth { background: var(--oth); }
.ticker .margin { margin-left: 10px; color: #c3c2b7; }

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.site-nav__brand {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  padding: 14px 16px 14px 0;
  margin-right: 8px;
  white-space: nowrap;
  border-right: 1px solid var(--border);
}
.site-nav__brand:hover { text-decoration: none; }
.site-nav__link {
  white-space: nowrap;
  padding: 14px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-secondary);
  border-bottom: 2px solid transparent;
}
.site-nav__link:hover { color: var(--ink); text-decoration: none; }
.site-nav__link.is-muted {
  display: none;
}
.site-nav__link.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---------- Layout ---------- */
.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 64px;
}

.county-picker {
  margin: 4px 0 20px;
}

.select-modern {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface) url('data:image/svg+xml;charset=UTF-8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="%2352514e" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpolyline points="6 9 12 15 18 9"%3E%3C/polyline%3E%3C/svg%3E') no-repeat right 14px center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 38px 10px 14px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}
.select-modern:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42, 120, 214, 0.15);
}

/* ---------- Card / section ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px 18px 14px;
  margin-bottom: 16px;
}
.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.callout__icon {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.callout__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 2px;
}
.callout__body {
  font-size: 13px;
  color: var(--ink-secondary);
  margin: 0;
  line-height: 1.5;
}
.card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 14px;
}
.card__chart {
  padding: 8px 4px 4px;
}

/* ---------- Toggle (numbers / percentages) ---------- */
.toggle-group {
  display: inline-flex;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 14px;
}
.toggle-group input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-group label {
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-secondary);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
}
.toggle-group input:checked + label {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(11, 11, 11, 0.08);
}

/* ---------- Table ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th, .data-table td {
  padding: 8px 6px;
  text-align: right;
}
.data-table th:first-child, .data-table td:first-child {
  text-align: left;
  color: var(--ink-secondary);
  font-weight: 500;
}
.data-table thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
.data-table thead th .legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.data-table tbody tr { border-bottom: 1px solid var(--border); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-alt); }
.data-table tbody tr.is-total td {
  font-weight: 700;
  border-top: 1px solid var(--border-strong);
}
.data-table td.col-rep { background: rgba(227, 73, 72, 0.06); }
.data-table td.col-dem { background: rgba(42, 120, 214, 0.06); }
.data-table td.col-oth { background: rgba(237, 161, 0, 0.06); }
.data-table td.col-total { font-weight: 600; }
.legend-dot--rep { background: var(--rep); }
.legend-dot--dem { background: var(--dem); }
.legend-dot--oth { background: var(--oth); }

.footnote {
  font-size: 12px;
  color: var(--ink-muted);
  margin: 12px 2px 0;
  line-height: 1.6;
}
.footnote i { font-style: normal; color: var(--ink-secondary); }

svg.line-chart { display: block; width: 100%; height: auto; }
.axis { font: 11px var(--font-sans); fill: var(--ink-muted); }
.axis path, .axis line { stroke: var(--border); }
.grid line { stroke: var(--border); stroke-dasharray: 2,2; }
.chart-legend text { font: 12px var(--font-sans); fill: var(--ink-secondary); }
