/* ==========================================================================
   POLITICAL PAYOLA - PROPUBLICA / BLOOMBERG INVESTIGATIVE DESIGN SYSTEM
   Typography: Newsreader (Editorial Serif) + Plus Jakarta Sans + JetBrains Mono
   ========================================================================== */

:root {
  --bg: #0a0e17;
  --bg-page: #0a0e17;
  --bg-card: #111726;
  --bg-card-hover: #162033;
  --bg-elev: #172033;
  --border: #233048;
  --border-subtle: #1c273a;
  --border-strong: #3b4e6d;
  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --muted: #94a3b8;
  --muted-dark: #64748b;
  --rep: #ef4444;
  --rep-bg: rgba(239, 68, 68, 0.12);
  --rep-border: rgba(239, 68, 68, 0.35);
  --dem: #3b82f6;
  --dem-bg: rgba(59, 130, 246, 0.12);
  --dem-border: rgba(59, 130, 246, 0.35);
  --gold: #f59e0b;
  --gold-bg: rgba(245, 158, 11, 0.12);
  --gold-border: rgba(245, 158, 11, 0.32);
  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.12);
  --font-serif: "Newsreader", Georgia, Cambria, "Times New Roman", serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a { color: #38bdf8; text-decoration: none; transition: color 0.15s ease; }
a:hover { color: #7dd3fc; text-decoration: underline; }

/* EDITORIAL MASTHEAD */
.topbar {
  background: rgba(10, 14, 23, 0.95);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 14px 28px 0;
}

.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 12px;
}

.brand { display: flex; align-items: center; gap: 18px; }

.brand-wordmark {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 18px;
  border-left: 1px solid var(--border);
}

.brand h1 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  line-height: 1.3;
}

.brand-sub { font-size: 0.76rem; color: var(--muted); font-weight: 400; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  max-width: 520px;
  justify-content: flex-end;
}

.search-wrap { position: relative; width: 100%; max-width: 380px; }

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-dark);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border-radius: 2px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  transition: all 0.15s ease;
}

.search-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-bg); }

.lang-switch-inline { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-family: var(--font-mono); }
.lang-btn { color: var(--muted); padding: 4px 6px; border-radius: 4px; font-weight: 600; }
.lang-btn.active { color: var(--gold); background: var(--gold-bg); }
.lang-sep { color: var(--border-strong); }

/* SINGLE-ROW EDITORIAL SUB-NAV */
.nav-tabs {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
  border-top: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 2px 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: #ffffff; border-bottom: 2px solid var(--gold); }

/* LAYOUT CONTAINER & HERO */
.container { max-width: 1440px; margin: 0 auto; padding: 32px 28px 80px; }

.hero-banner {
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(17, 23, 38, 0.6) 100%);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 36px 40px;
  margin-bottom: 32px;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 40px;
  align-items: center;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 8px;
}

.hero-content h2 {
  font-family: var(--font-serif);
  font-size: 2.15rem;
  font-weight: 600;
  line-height: 1.25;
  color: #ffffff;
  letter-spacing: -0.015em;
  margin-bottom: 14px;
}

.hero-content p { color: var(--text-secondary); font-size: 0.96rem; line-height: 1.68; max-width: 780px; }

.stat-pills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 24px;
}

.stat-pill {
  border-top: 2px solid var(--border-strong);
  padding-top: 10px;
  text-align: left;
}

.stat-pill .num {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-pill .lbl {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
}

/* FEATURED QUICK JUMP CARDS */
.quick-jump-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 40px; }

.jump-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 22px 24px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}
.jump-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.jb-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 6px;
}

.jb-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.3;
  margin-bottom: 8px;
}

.jb-sub { font-size: 0.84rem; color: var(--muted); line-height: 1.5; }

/* SECTION HEADERS */
.section-panel { display: none; }
.section-panel.active { display: block; }

.section-head {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  margin-top: 36px;
  margin-bottom: 24px;
}

.section-head h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.section-head p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-top: 6px;
  max-width: 980px;
}

/* Filter Controls */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 12px 18px;
  margin-bottom: 24px;
}

.select-ctrl {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}
.select-ctrl:focus { outline: none; border-color: var(--gold); }

/* Data Tables */
.data-table-wrap {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2px;
  margin-bottom: 32px;
}

.data-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; text-align: left; }

.data-table th {
  background: var(--bg-elev);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); }
.data-table tr:hover td { background: rgba(255, 255, 255, 0.02); color: #ffffff; }

/* Chips & Badges */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.chip-R { background: var(--rep-bg); color: #fca5a5; border: 1px solid var(--rep-border); }
.chip-D { background: var(--dem-bg); color: #93c5fd; border: 1px solid var(--dem-border); }
.chip-Divided, .chip-I { background: var(--gold-bg); color: #fcd34d; border: 1px solid var(--gold-border); }

.chip-src {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 8px;
  border-radius: 3px;
}
.chip-src:hover { background: rgba(56, 189, 248, 0.16); text-decoration: none; }

/* CARDS & GRIDS */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 24px;
  transition: all 0.15s ease;
}
.card:hover { background: var(--bg-card-hover); border-color: var(--border-strong); }
.card.rep-card { border-left: 3px solid var(--rep); }
.card.dem-card { border-left: 3px solid var(--dem); }

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.35;
}

.big-num { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }

.bar-track { width: 100%; height: 12px; background: #1e293b; border-radius: 999px; overflow: hidden; display: flex; }
.bar-fill-R { background: var(--rep); height: 100%; }
.bar-fill-D { background: var(--dem); height: 100%; }
.bar-fill-G { background: var(--gold); height: 100%; }

/* Flowcharts & Dual Vote Bars */
.flowchart-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 24px 28px;
  margin-bottom: 28px;
}

.flow-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; margin-bottom: 20px; }

.flow-tab-btn {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.flow-tab-btn.active { background: var(--gold-bg); color: var(--gold); border-color: var(--gold-border); }

.flow-display, .flow-pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }

.flow-node {
  background: var(--bg-elev);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.fn-step {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.fn-title { font-weight: 700; font-size: 0.92rem; color: #ffffff; margin-bottom: 6px; }
.fn-desc { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }

.mini-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin: 10px 0; }

.mini-flow-step {
  background: var(--bg-elev);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 0.79rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.dual-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--bg-elev); border: 1px solid var(--border-subtle); margin: 6px 0; }
.dual-bar-r { background: var(--rep); height: 100%; }
.dual-bar-d { background: var(--dem); height: 100%; }
.dual-bar-o { background: var(--muted-dark); height: 100%; }

.impact-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: 2px;
  padding: 10px 14px;
  font-size: 0.84rem;
  color: var(--text);
  margin: 8px 0;
}
.impact-box.relief { background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.28); }
.impact-box.mixed { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.28); }

/* Editorial Buttons */
.editorial-btn {
  background: var(--gold);
  color: #000000;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.86rem;
  padding: 9px 18px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.editorial-btn:hover { background: #fbbf24; }

.editorial-btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.86rem;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.editorial-btn-secondary:hover { background: var(--bg-elev); text-decoration: none; }

.petition-sign-btn {
  width: 100%;
  background: var(--bg-elev);
  color: var(--gold);
  border: 1px solid var(--gold-border);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.petition-sign-btn:hover { background: var(--gold-bg); }

/* Member Portraits Grid */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }

.member-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.member-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.member-card.party-R { border-top: 3px solid var(--rep); }
.member-card.party-D { border-top: 3px solid var(--dem); }
.member-card.party-I { border-top: 3px solid var(--gold); }

.member-photo-wrap { position: relative; width: 100%; height: 180px; background: #0f172a; }
.member-photo-wrap img { width: 100%; height: 100%; object-fit: cover; }

.member-badges { position: absolute; top: 6px; left: 6px; right: 6px; display: flex; justify-content: space-between; }

.member-body { padding: 10px 12px; font-size: 0.82rem; display: flex; flex-direction: column; gap: 4px; flex: 1; }

.member-actions { display: flex; gap: 4px; margin-top: auto; padding-top: 6px; }

.member-actions a {
  flex: 1;
  text-align: center;
  padding: 5px 8px;
  border-radius: 4px;
  background: var(--bg-elev);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.member-actions a:hover { background: var(--bg-card-hover); color: #ffffff; text-decoration: none; }

.mosaic-showcase { width: 100%; border-radius: 2px; border: 1px solid var(--border); margin: 14px 0 24px; }

/* Responsive */
@media (max-width: 1024px) {
  .hero-banner { grid-template-columns: 1fr; gap: 28px; }
  .quick-jump-bar { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .topbar-inner { flex-direction: column; align-items: flex-start; }
  .topbar-right { width: 100%; max-width: 100%; }
}
