/* Garden State Cash — NJ 2025 campaign spending
   Framework-free. Just CSS. */

:root {
  --ink: #14181d;
  --muted: #5c6670;
  --paper: #faf7f0;
  --card: #ffffff;
  --line: #e4ded2;
  --navy: #0c2340;
  --navy-soft: #1c3a5e;
  --money: #2f8c5a;
  --gold: #d99a00;
  --dem: #2563eb;
  --rep: #c63d2e;
  --ind: #7a5cc4;
  --shadow: 0 1px 2px rgba(12, 35, 64, 0.06), 0 8px 24px rgba(12, 35, 64, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--navy-soft); }

/* ---------- Header ---------- */
.header {
  background: var(--navy);
  color: #fff;
  padding: 56px 0 48px;
  border-bottom: 4px solid var(--gold);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: #f4d35e;
  margin: 0 0 14px;
}
.header h1 {
  font-size: clamp(2rem, 6vw, 3.1rem);
  font-weight: 900;
  line-height: 1.05;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}
.header h1 .cash { color: #46a06b; }
.header .lede {
  font-size: 1.12rem;
  max-width: 620px;
  margin: 0 0 28px;
  color: #d6dde6;
}
.bignum {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.bignum .figure {
  font-size: clamp(2.6rem, 9vw, 4.4rem);
  font-weight: 900;
  color: #f4d35e;
  letter-spacing: -0.03em;
  line-height: 1;
}
.bignum .figure-label {
  font-size: 1rem;
  color: #aebbc9;
  max-width: 280px;
}

/* ---------- Nav ---------- */
.section-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 247, 240, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.section-nav .container {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-top: 10px;
  padding-bottom: 10px;
}
.section-nav a {
  white-space: nowrap;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
}
.section-nav a:hover { background: #efe9dc; color: var(--navy); }

/* ---------- Sections ---------- */
section { padding: 52px 0; border-bottom: 1px solid var(--line); }
.section-tag {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--money);
  margin: 0 0 8px;
}
h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  line-height: 1.15;
}
h3 {
  font-size: 1.12rem;
  font-weight: 700;
  margin: 36px 0 12px;
}
p { margin: 0 0 16px; }
.dek { font-size: 1.05rem; color: var(--muted); max-width: 640px; }

/* ---------- Stat grid ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 28px 0;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.stat .n {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat .l { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }

/* ---------- Bar charts ---------- */
.chart { margin: 24px 0 8px; }
.bar-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 9px;
}
.bar-label { font-size: 0.85rem; font-weight: 700; color: var(--navy); text-align: right; }
.bar-track {
  background: #ece6da;
  border-radius: 6px;
  overflow: hidden;
  height: 26px;
  position: relative;
}
.bar-fill {
  height: 100%;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  min-width: 4px;
}
.bar-fill.navy { background: linear-gradient(90deg, #1c3a5e, #0c2340); }
.bar-fill.money { background: linear-gradient(90deg, #46a06b, #2f8c5a); }
.bar-fill.gold { background: linear-gradient(90deg, #e6ab1f, #cf8d00); color: #2a1d00; }
.bar-fill.dem { background: linear-gradient(90deg, #4a7fe8, #2563eb); }
.bar-fill.rep { background: linear-gradient(90deg, #d4574a, #c63d2e); }
.bar-fill.outside { color: var(--navy); justify-content: flex-start; padding-left: 10px; background: linear-gradient(90deg, #1c3a5e, #0c2340); }

/* split (D vs R) stacked bar */
.split {
  display: flex;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  margin: 14px 0;
  box-shadow: var(--shadow);
}
.split > div {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
}
.split .s-dem { background: var(--dem); }
.split .s-rep { background: var(--rep); }
.split .s-ind { background: var(--ind); }
.split .s-money { background: var(--money); }
.split .s-navy { background: var(--navy); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); margin: 0 0 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 20px 0; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; background: var(--card); }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: var(--navy); color: #fff; font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f7f3ea; }
tr.total-row td { font-weight: 800; background: #f0ebe0; border-top: 2px solid var(--navy); }

/* ---------- Callout ---------- */
.callout {
  background: #fff;
  border-left: 4px solid var(--gold);
  border-radius: 0 10px 10px 0;
  padding: 18px 20px;
  margin: 24px 0;
  box-shadow: var(--shadow);
}
.callout strong { color: var(--navy); }

/* ---------- Takeaways ---------- */
.takeaways { display: grid; gap: 16px; margin-top: 24px; }
.takeaway {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.takeaway h3 { margin: 0 0 8px; color: var(--navy); }
.takeaway p { margin: 0; color: var(--muted); }

/* ---------- Sources ---------- */
.sources { font-size: 0.9rem; }
.sources ul { padding-left: 20px; }
.sources li { margin-bottom: 8px; }

/* ---------- Footer ---------- */
footer {
  background: var(--navy);
  color: #aebbc9;
  padding: 40px 0;
  font-size: 0.9rem;
}
footer a { color: #f4d35e; }
footer .container > p { margin: 0 0 10px; }

.muted-note { font-size: 0.85rem; color: var(--muted); font-style: italic; }

@media (max-width: 560px) {
  .bar-row { grid-template-columns: 48px 1fr; }
  .header { padding: 40px 0 36px; }
}
