/* ============================================================
   Vermont Legislative Leaderboard — shared theme
   Loaded AFTER each page's inline <style>, so equal-specificity
   rules here win. Refines the palette, typography, and shared
   components without touching page-specific layout.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;0,8..60,700;1,8..60,400&display=swap');

:root {
  --green-dark: #173b28;
  --green-mid: #266048;
  --green-light: #3f8a67;
  --gold: #c99b2f;
  --gold-light: #ecd48b;
  --bg: #f7f4ee;
  --card-bg: #ffffff;
  --text: #21201c;
  --text-muted: #6b675f;
  --border: #e3ddd2;
  --shadow-sm: 0 1px 2px rgba(23, 59, 40, 0.06), 0 1px 6px rgba(23, 59, 40, 0.04);
  --shadow-md: 0 2px 6px rgba(23, 59, 40, 0.08), 0 8px 24px rgba(23, 59, 40, 0.08);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---- Page hero (the per-page <header>) ------------------- */
/* Backgrounds stay page-specific (finance blue, lobbying red,
   etc.) — only typography and rhythm are unified here. */
header {
  padding: 2.4rem 1.5rem 2.1rem;
  border-bottom: 3px solid var(--gold);
}

header h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.9rem;
  letter-spacing: 0.01em;
  margin-bottom: 0.4rem;
}

header p {
  font-size: 0.95rem;
  font-style: italic;
  opacity: 0.82;
}

/* ---- Controls row ---------------------------------------- */
.controls {
  gap: 0.8rem;
  padding: 1.1rem 1.5rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.controls select,
.controls input,
.search-box input,
input.search-box,
select {
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.controls select:hover,
select:hover {
  border-color: var(--green-light);
}

.controls select:focus,
.controls input:focus,
select:focus,
input:focus {
  outline: none;
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(38, 96, 72, 0.14);
}

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

/* ---- Tab bar --------------------------------------------- */
.tab-bar {
  background: var(--card-bg);
  border-bottom: 2px solid var(--border);
}

.tab-bar button {
  font-family: var(--font-body);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.tab-bar button.active {
  color: var(--green-dark);
  border-bottom-color: var(--gold);
  font-weight: 700;
}

.tab-bar button:hover {
  color: var(--green-dark);
}

/* ---- Cards ----------------------------------------------- */
.committee-card,
.card-row,
.sector-card,
.gift-card,
.archive-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.committee-card:hover,
.card-row:hover,
.sector-card:hover,
.gift-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: #d5cec1;
}

.committee-card.podium {
  background: linear-gradient(135deg, #fdf9ef, #fffdf7);
  border: 1.5px solid var(--gold);
  box-shadow: 0 2px 10px rgba(201, 155, 47, 0.16);
}

.committee-card.top10 {
  background: linear-gradient(135deg, #f2f8f4, #f8fcf9);
  border: 1px solid #a9cbb4;
}

.card-info h3,
.leg-info h3,
.gift-info h3,
.sector-name {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--green-dark);
}

.rank {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--green-dark);
}

.rank.gold { color: #a97e14; }
.rank.silver { color: #64748b; }
.rank.bronze { color: #8a4a12; }

.meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* Count chip (index and shared) */
.bill-count,
.number {
  font-variant-numeric: tabular-nums;
}

.bill-count {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.bill-count .label {
  letter-spacing: 0.1em;
}

/* ---- Progress bars --------------------------------------- */
.bar-bg,
.progress-bar-bg {
  background: #ebe6dd;
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}

.bar-fill,
.progress-bar-fill {
  border-radius: 99px;
  background: linear-gradient(90deg, var(--green-light), var(--gold));
}

/* ---- Buttons --------------------------------------------- */
.inline-vote-btn,
button.vote-btn {
  font-family: var(--font-body);
  border-radius: 8px;
  transition: background 0.15s, transform 0.1s;
}

.inline-vote-btn:active,
button.vote-btn:active {
  transform: scale(0.97);
}

/* ---- Misc shared ----------------------------------------- */
.back-link {
  font-family: var(--font-body);
  color: var(--green-mid);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.back-link:hover {
  border-bottom-color: var(--green-mid);
}

.no-data {
  color: var(--text-muted);
  font-style: italic;
}

.footer-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  border-top: 1px solid var(--border);
  padding: 1.4rem 1rem;
}

.footer-note a {
  color: var(--green-mid);
}

::selection {
  background: rgba(201, 155, 47, 0.28);
}

/* ---- Rookie of the Year badge ---------------------------- */
.rookie-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.45rem;
  padding: 0.14rem 0.6rem;
  border-radius: 99px;
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #173b28;
  background: linear-gradient(120deg, var(--gold-light), var(--gold));
  border: 1px solid rgba(23, 59, 40, 0.18);
  box-shadow: 0 1px 3px rgba(201, 155, 47, 0.35);
}

@media (max-width: 600px) {
  header { padding: 1.7rem 1.2rem 1.5rem; }
  header h1 { font-size: 1.35rem; }
  header p { font-size: 0.85rem; }
}
