:root {
  --ink: #1a1a1a;
  --muted: #5a5a5a;
  --line: #e2e2e2;
  --bg: #ffffff;
  --bg-alt: #f7f6f4;
  --accent: #2c3e50;
  --accent-2: #c0392b;
  --max: 760px;
  /* Categorical palette shared with the charts (see js/utils.js PALETTE) —
     kept in sync manually since chart colors are JS and these are CSS. */
  --series-victim: #2a78d6;
  --series-perp: #eb6834;
}

* { box-sizing: border-box; }

/* Suppress pandoc/rmarkdown's auto-generated title block (from the .Rmd's YAML
   title, used only to populate <title>) — the page supplies its own <h1>. */
h1.title { display: none; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.dashboard-section .wrap { max-width: 920px; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  max-width: 920px;
  margin: 0 auto;
  padding: 16px 24px;
  font-size: 0.88rem;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a.active {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--accent-2);
}

.site-header {
  padding: 56px 0 32px;
}
.kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-2);
  margin: 0 0 12px;
}
.site-header h1 {
  font-size: 2.1rem;
  line-height: 1.2;
  margin: 0 0 16px;
  text-align: left;
}
.byline { color: var(--muted); font-size: 0.95rem; margin: 0; }
.byline a { color: inherit; }

/* Lighter title bar for sub-pages (Takeaways/Dashboard/About), vs. Home's full hero */
.site-header.page-header { padding: 32px 0 28px; }
.site-header.page-header h1 { font-size: 1.6rem; margin: 0; }

.link-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 40px 0 16px;
}
.link-cards .card {
  display: block;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.link-cards .card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.link-cards .card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--accent);
}
.link-cards .card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
}
.link-cards .card .card-cta {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-2);
}

/* Infographic stat cards — a designed callout for a fixed set of headline
   numbers, as distinct from the live charts elsewhere on this page. */
.stat-cards-intro {
  margin: 28px 0 4px;
}
.stat-cards-intro p {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
}
.stat-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 16px 0 8px;
}
.stat-card {
  background: var(--bg-alt);
  border-radius: 12px;
  border-left: 5px solid var(--line);
  padding: 24px 26px 26px;
}
.stat-card.is-victim { border-left-color: var(--series-victim); }
.stat-card.is-perp { border-left-color: var(--series-perp); }
.stat-card .eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 10px;
}
.stat-card .figure {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.stat-card.is-victim .figure { color: var(--series-victim); }
.stat-card.is-perp .figure { color: var(--series-perp); }
.stat-card .statement {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px;
  line-height: 1.3;
}
.stat-card .detail {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}
.stat-cards-source {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 4px 0 8px;
}
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
  .stat-card { padding: 20px 20px 22px; }
  .stat-card .figure { font-size: 2.4rem; }
  .stat-card .statement { font-size: 1rem; }
}

.article { padding: 40px 0 8px; }
.article h2 { font-size: 1.4rem; margin-top: 48px; }
.article p { font-size: 1.08rem; }
.article em { color: var(--accent-2); font-style: normal; font-weight: 600; }

figure.chart {
  margin: 24px 0 8px;
  overflow-x: auto;
}
figure.chart figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 8px;
}

.chart-controls {
  margin: 20px 0 4px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  cursor: pointer;
  user-select: none;
}
.toggle input { width: 16px; height: 16px; cursor: pointer; }

.dashboard-section {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  padding: 40px 0 64px;
  margin-top: 24px;
}
.dashboard-section h2 { margin-top: 0; }
.dashboard-note {
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 760px;
}

.dashboard-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 20px 0;
  align-items: end;
}
.control { display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.control label { font-size: 0.82rem; font-weight: 600; color: var(--accent); }
.control select {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.92rem;
  background: white;
}
.comparison-control { flex: 1; min-width: 240px; }
.comparison-control select { min-height: 84px; }
.clear-control { min-width: auto; }
.clear-control button {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.85rem;
  background: white;
  color: var(--accent);
  cursor: pointer;
}
.clear-control button:hover { background: var(--bg-alt); }
.hint { font-size: 0.78rem; color: var(--muted); margin: 4px 0 0; }
.toggle-control { justify-content: flex-end; padding-bottom: 8px; }

#dash-map svg { max-width: 100%; height: auto; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 48px;
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer a { color: inherit; }

@media (max-width: 640px) {
  .site-header h1 { font-size: 1.6rem; }
  .site-header { padding: 40px 0 24px; }
}
