/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-serif: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* Brand Colors — derived from logo SVG */
  --color-navy: #1a2a4e;
  --color-dark: #0f1b33;
  --color-mid: #2a3a5e;
  --color-body: #3a3a5c;
  --color-muted: #5a6a8a;
  --color-light: #8a8a9a;
  --color-faint: #aaaaaa;
  --color-accent: #4a688e;
  --color-red: #a31930;
  --color-red-light: #c9364e;
  --color-gold: #c9a849;
  --color-gold-light: #e0c96e;
  --color-green: #2e7d32;
  --color-green-light: #e8f5e9;
  --color-amber: #f57f17;
  --color-amber-light: #fff8e1;
  --color-blue-light: #e3f2fd;

  /* Surfaces */
  --color-bg: #f0f2f5;
  --color-card: #ffffff;
  --color-border: #eceef2;

  /* Shadows & Radii */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.2s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-body);
  background: var(--color-card);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--color-navy);
  text-decoration: none;
}

a:hover {
  color: var(--color-red);
}

/* ===== Patriotic Top Bar ===== */
.patriotic-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--color-navy) 0%, var(--color-navy) 50%, var(--color-red) 50%, var(--color-red) 100%);
}

/* ===== Header ===== */
.site-header {
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 40px;
  width: auto;
}

.logo:hover {
  opacity: 0.85;
}

nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-body);
  transition: color var(--transition);
}

nav a:hover {
  color: var(--color-navy);
}

/* ===== Hamburger Menu ===== */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-navy);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle span + span {
  margin-top: 5px;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 8px 0;
  }

  nav.open {
    display: flex;
  }

  nav a {
    font-size: 0.95rem;
    padding: 12px 24px;
    width: 100%;
    box-sizing: border-box;
  }

  nav a:hover {
    background: var(--color-bg);
  }

  .nav-login {
    border: none;
    border-radius: 0;
    padding: 12px 24px;
    text-align: left;
  }

  .nav-login:hover {
    background: var(--color-bg);
    color: var(--color-navy);
  }
}

/* ===== Nav Login Button ===== */
.nav-login {
  border: 1.5px solid var(--color-navy);
  border-radius: 100px;
  padding: 5px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-navy);
  transition: background var(--transition), color var(--transition);
}

.nav-login:hover {
  background: var(--color-navy);
  color: var(--color-card);
}

.nav-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 0;
}

.nav-user-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-navy);
  color: var(--color-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.nav-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-navy);
}

.nav-user-chevron {
  font-size: 0.5rem;
  color: var(--color-light);
  transition: transform var(--transition);
}

.nav-user.open .nav-user-chevron {
  transform: rotate(180deg);
}

.nav-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
}

.nav-user.open .nav-user-dropdown {
  display: block;
}

.nav-user-dropdown a {
  display: block;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-body);
  transition: background var(--transition);
}

.nav-user-dropdown a:hover {
  background: var(--color-bg);
  color: var(--color-navy);
}

.nav-user-dropdown .dropdown-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0;
}

.nav-user-dropdown .dropdown-signout {
  color: var(--color-red);
}

.nav-user-dropdown .dropdown-signout:hover {
  background: #fef2f2;
  color: var(--color-red);
}

/* ===== Hero ===== */
.hero {
  background: var(--color-bg);
  color: var(--color-navy);
  padding: 80px 0 72px;
  text-align: center;
  border-bottom: 3px solid var(--color-gold);
}

/* Hero alignment variants */
.hero.hero-left {
  text-align: left;
}

.hero.hero-left .hero-subtitle {
  margin-left: 0;
  margin-right: auto;
}

.hero.hero-left .hero-cta-group {
  justify-content: flex-start;
}

.hero.hero-right {
  text-align: right;
}

.hero.hero-right .hero-subtitle {
  margin-left: auto;
  margin-right: 0;
}

.hero.hero-right .hero-cta-group {
  justify-content: flex-end;
}

/* ===== Hero Animations ===== */

/* Fade in */
.hero.hero-fade .hero-logo-svg,
.hero.hero-fade .hero-tagline,
.hero.hero-fade .hero-subtitle,
.hero.hero-fade .hero-cta-group {
  opacity: 0;
  animation: heroFadeIn 0.8s ease forwards;
}
.hero.hero-fade .hero-logo-svg  { animation-delay: 0s; }
.hero.hero-fade .hero-tagline   { animation-delay: 0.15s; }
.hero.hero-fade .hero-subtitle  { animation-delay: 0.3s; }
.hero.hero-fade .hero-cta-group { animation-delay: 0.45s; }

@keyframes heroFadeIn {
  to { opacity: 1; }
}

/* Rise — fade + slide up */
.hero.hero-rise .hero-logo-svg,
.hero.hero-rise .hero-tagline,
.hero.hero-rise .hero-subtitle,
.hero.hero-rise .hero-cta-group {
  opacity: 0;
  transform: translateY(24px);
  animation: heroRise 0.7s ease forwards;
}
.hero.hero-rise .hero-logo-svg  { animation-delay: 0s; }
.hero.hero-rise .hero-tagline   { animation-delay: 0.12s; }
.hero.hero-rise .hero-subtitle  { animation-delay: 0.24s; }
.hero.hero-rise .hero-cta-group { animation-delay: 0.36s; }

@keyframes heroRise {
  to { opacity: 1; transform: translateY(0); }
}

/* Slide in from left */
.hero.hero-slide-left .hero-logo-svg,
.hero.hero-slide-left .hero-tagline,
.hero.hero-slide-left .hero-subtitle,
.hero.hero-slide-left .hero-cta-group {
  opacity: 0;
  transform: translateX(-40px);
  animation: heroSlideLeft 0.6s ease forwards;
}
.hero.hero-slide-left .hero-logo-svg  { animation-delay: 0s; }
.hero.hero-slide-left .hero-tagline   { animation-delay: 0.1s; }
.hero.hero-slide-left .hero-subtitle  { animation-delay: 0.2s; }
.hero.hero-slide-left .hero-cta-group { animation-delay: 0.3s; }

@keyframes heroSlideLeft {
  to { opacity: 1; transform: translateX(0); }
}

/* Slide in from right */
.hero.hero-slide-right .hero-logo-svg,
.hero.hero-slide-right .hero-tagline,
.hero.hero-slide-right .hero-subtitle,
.hero.hero-slide-right .hero-cta-group {
  opacity: 0;
  transform: translateX(40px);
  animation: heroSlideRight 0.6s ease forwards;
}
.hero.hero-slide-right .hero-logo-svg  { animation-delay: 0s; }
.hero.hero-slide-right .hero-tagline   { animation-delay: 0.1s; }
.hero.hero-slide-right .hero-subtitle  { animation-delay: 0.2s; }
.hero.hero-slide-right .hero-cta-group { animation-delay: 0.3s; }

@keyframes heroSlideRight {
  to { opacity: 1; transform: translateX(0); }
}

/* Scale pop — subtle zoom in */
.hero.hero-pop .hero-logo-svg,
.hero.hero-pop .hero-tagline,
.hero.hero-pop .hero-subtitle,
.hero.hero-pop .hero-cta-group {
  opacity: 0;
  transform: scale(0.92);
  animation: heroPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.hero.hero-pop .hero-logo-svg  { animation-delay: 0s; }
.hero.hero-pop .hero-tagline   { animation-delay: 0.1s; }
.hero.hero-pop .hero-subtitle  { animation-delay: 0.2s; }
.hero.hero-pop .hero-cta-group { animation-delay: 0.3s; }

@keyframes heroPop {
  to { opacity: 1; transform: scale(1); }
}

/* Typewriter reveal — clip from left */
.hero.hero-reveal .hero-logo-svg,
.hero.hero-reveal .hero-tagline,
.hero.hero-reveal .hero-subtitle,
.hero.hero-reveal .hero-cta-group {
  clip-path: inset(0 100% 0 0);
  animation: heroReveal 0.8s ease forwards;
}
.hero.hero-reveal .hero-logo-svg  { animation-delay: 0s; }
.hero.hero-reveal .hero-tagline   { animation-delay: 0.2s; }
.hero.hero-reveal .hero-subtitle  { animation-delay: 0.4s; }
.hero.hero-reveal .hero-cta-group { animation-delay: 0.6s; }

@keyframes heroReveal {
  to { clip-path: inset(0 0 0 0); }
}

/* Drop — fall from above with bounce */
.hero.hero-drop .hero-logo-svg,
.hero.hero-drop .hero-tagline,
.hero.hero-drop .hero-subtitle,
.hero.hero-drop .hero-cta-group {
  opacity: 0;
  transform: translateY(-30px);
  animation: heroDrop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.hero.hero-drop .hero-logo-svg  { animation-delay: 0s; }
.hero.hero-drop .hero-tagline   { animation-delay: 0.12s; }
.hero.hero-drop .hero-subtitle  { animation-delay: 0.24s; }
.hero.hero-drop .hero-cta-group { animation-delay: 0.36s; }

@keyframes heroDrop {
  to { opacity: 1; transform: translateY(0); }
}

/* Shimmer — slow glowing highlight sweep */
.hero.hero-shimmer .hero-logo-svg,
.hero.hero-shimmer .hero-tagline,
.hero.hero-shimmer .hero-subtitle,
.hero.hero-shimmer .hero-cta-group {
  opacity: 0;
  animation: heroFadeIn 0.8s ease forwards;
}
.hero.hero-shimmer .hero-logo-svg  { animation-delay: 0s; }
.hero.hero-shimmer .hero-tagline   { animation-delay: 0.15s; }
.hero.hero-shimmer .hero-subtitle  { animation-delay: 0.3s; }
.hero.hero-shimmer .hero-cta-group { animation-delay: 0.45s; }

.hero.hero-shimmer .hero-tagline {
  background: linear-gradient(
    90deg,
    var(--color-navy) 0%,
    var(--color-navy) 40%,
    var(--color-gold) 50%,
    var(--color-navy) 60%,
    var(--color-navy) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: heroFadeIn 0.8s ease forwards, heroShimmer 4s ease-in-out 1s infinite;
}

.hero.hero-shimmer .hero-logo-svg {
  animation: heroFadeIn 0.8s ease forwards, heroShimmerGlow 4s ease-in-out 1s infinite;
}

@keyframes heroShimmer {
  0%, 100% { background-position: 200% 0; }
  50% { background-position: -200% 0; }
}

@keyframes heroShimmerGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15) drop-shadow(0 0 8px rgba(180, 140, 0, 0.25)); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero.hero-fade *,
  .hero.hero-rise *,
  .hero.hero-slide-left *,
  .hero.hero-slide-right *,
  .hero.hero-pop *,
  .hero.hero-reveal *,
  .hero.hero-drop * {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
}

.hero-logo {
  height: 80px;
  width: auto;
  margin-bottom: 24px;
}

.hero-logo-svg {
  max-width: 440px;
  width: 100%;
  height: auto;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.hero-tagline {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--color-body);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.state-selector-hero label {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 12px;
  opacity: 0.85;
}

/* ===== Select Wrapper ===== */
.select-wrapper {
  position: relative;
  display: inline-block;
  min-width: 280px;
}

.select-wrapper select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 14px 44px 14px 18px;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.12);
  color: var(--color-card);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.select-wrapper select:hover {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.18);
}

.select-wrapper select:focus {
  outline: none;
  border-color: var(--color-gold);
  background: rgba(255,255,255,0.2);
}

.select-wrapper select option {
  color: var(--color-body);
  background: var(--color-card);
}

.select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--color-card);
  pointer-events: none;
}

/* Guide section select styling */
.guide-controls .select-wrapper select {
  border-color: var(--color-border);
  background: var(--color-card);
  color: var(--color-body);
}

.guide-controls .select-wrapper select:hover {
  border-color: var(--color-navy);
}

.guide-controls .select-wrapper select:focus {
  border-color: var(--color-navy);
  box-shadow: 0 0 0 3px rgba(26,43,74,0.1);
}

.guide-controls .select-arrow {
  border-top-color: var(--color-muted);
}

/* ===== Star Divider ===== */
.star-divider {
  text-align: center;
  padding: 24px 0;
  color: var(--color-gold);
  font-size: 1.1rem;
  user-select: none;
}

/* ===== Quick Facts ===== */
.quick-facts {
  padding: 48px 0;
  background: var(--color-bg);
}

.quick-facts h2 {
  text-align: center;
  font-size: 1.8rem;
  color: var(--color-navy);
  margin-bottom: 36px;
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.fact-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--color-navy);
  transition: transform var(--transition), box-shadow var(--transition);
}

.fact-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.fact-number {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--color-navy);
  line-height: 1.1;
  margin-bottom: 8px;
}

.fact-label {
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.4;
}

/* ===== IL Battleground Section ===== */
.il-battleground {
  padding: 48px 0;
  background: var(--color-bg);
}

.il-battleground h2 {
  text-align: center;
  font-size: 1.8rem;
  color: var(--color-navy);
  margin-bottom: 8px;
}

.battleground-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.battleground-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  text-decoration: none;
  transition: box-shadow var(--transition), transform var(--transition);
  display: block;
}

.battleground-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}

.battleground-headline {
  border-left: 4px solid var(--color-gold);
}

.battleground-hot {
  border-left: 4px solid var(--color-red);
}

.battleground-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-navy);
  margin-bottom: 12px;
}

.battleground-matchup {
  display: flex;
  align-items: center;
  gap: 8px;
}

.battleground-candidate {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.battleground-candidate.rep {
  justify-content: flex-end;
  text-align: right;
}

.battleground-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-navy);
}

.battleground-candidate.dem .battleground-name {
  color: #2563eb;
}

.battleground-candidate.rep .battleground-name {
  color: var(--color-red);
}

.battleground-party {
  font-size: 0.8rem;
  color: var(--color-muted);
  font-weight: 500;
}

.battleground-detail {
  font-size: 0.75rem;
  color: var(--color-light);
}

.battleground-vs {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-light);
  text-transform: uppercase;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .battleground-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Registration Guide ===== */
.registration-guide {
  padding: 48px 0 64px;
}

.registration-guide h2 {
  text-align: center;
  font-size: 1.8rem;
  color: var(--color-navy);
  margin-bottom: 28px;
}

.guide-controls {
  text-align: center;
  margin-bottom: 36px;
}

/* ===== States Overview Grid ===== */
.states-overview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.state-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.state-card:hover {
  border-color: var(--color-navy);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.state-card-abbr {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-navy);
  margin-bottom: 2px;
}

.state-card-name {
  font-size: 0.8rem;
  color: var(--color-light);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.state-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ===== Badges ===== */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-green {
  background: var(--color-green-light);
  color: var(--color-green);
}

.badge-amber {
  background: var(--color-amber-light);
  color: var(--color-amber);
}

.badge-blue {
  background: var(--color-blue-light);
  color: var(--color-navy);
}

.badge-gray {
  background: var(--color-border);
  color: var(--color-muted);
}

/* ===== State Detail ===== */
.state-detail {
  max-width: 800px;
  margin: 0 auto;
}

.state-detail-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 8px;
}

.state-detail-header h3 {
  font-size: 2rem;
  color: var(--color-navy);
  font-weight: 800;
}

.state-detail-header .state-abbr {
  font-size: 1rem;
  color: var(--color-light);
  font-weight: 600;
}

.back-link {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-bottom: 20px;
  cursor: pointer;
}

.back-link:hover {
  color: var(--color-navy);
}

.register-cta {
  display: inline-block;
  background: var(--color-red);
  color: var(--color-card);
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: var(--radius);
  margin: 20px 0 32px;
  transition: background var(--transition), transform var(--transition);
}

.register-cta:hover {
  background: var(--color-red-light);
  color: var(--color-card);
  transform: translateY(-1px);
}

.register-cta-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0 32px;
}

.register-cta-group .register-cta {
  margin: 0;
}

.register-cta-va {
  background: var(--color-navy);
}

.register-cta-va:hover {
  background: var(--color-mid);
  color: var(--color-card);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.detail-section {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 24px;
}

.detail-section.full-width {
  grid-column: 1 / -1;
}

.detail-section h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-light);
  margin-bottom: 10px;
}

.detail-section p,
.detail-section ul {
  font-size: 0.95rem;
  color: var(--color-body);
  line-height: 1.6;
}

.detail-section ul {
  list-style: none;
  padding: 0;
}

.detail-section ul li {
  padding: 4px 0;
}

.detail-section ul li::before {
  content: "  ";
}

.detail-section .status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-indicator.available {
  background: var(--color-green);
}

.status-indicator.unavailable {
  background: var(--color-border);
}

.status-label {
  font-size: 0.9rem;
}

/* ===== Hero CTA ===== */
.hero-cta-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-cta {
  display: inline-block;
  background: var(--color-red);
  color: var(--color-card);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 16px 36px;
  border-radius: var(--radius);
  transition: background var(--transition), transform var(--transition);
}

.hero-cta:hover {
  background: var(--color-red-light);
  color: var(--color-card);
  transform: translateY(-1px);
}
/* ===== Compact Hero (sub-pages) ===== */
.hero-compact {
  padding: 56px 0 48px;
}

.hero-compact h1 {
  font-size: 2.4rem;
}

/* ===== Resources Section ===== */
.resources-section {
  padding: 48px 0 64px;
}

.resources-section h2 {
  text-align: center;
  font-size: 1.8rem;
  color: var(--color-navy);
  margin-bottom: 36px;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.resource-card {
  display: block;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.resource-card:not(.resource-card-soon) {
  cursor: pointer;
}

.resource-card:not(.resource-card-soon):hover {
  border-color: var(--color-navy);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: var(--color-body);
}

.resource-card-soon {
  opacity: 0.65;
}

.resource-card-featured {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #1e3a5f 0%, #2c4f7c 100%);
  color: #fff;
  border: none;
  position: relative;
  overflow: hidden;
}

.resource-card-featured::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 50%;
}

.resource-card-featured .resource-icon {
  font-size: 2.4rem;
}

.resource-card-featured .resource-link {
  color: #fbbf24;
  font-weight: 700;
  font-size: 1rem;
}

.resource-card-featured:hover {
  border-color: transparent;
  box-shadow: 0 8px 30px rgba(30, 58, 95, 0.4);
  transform: translateY(-3px);
  color: #fff;
}

.resource-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.resource-card h3 {
  font-size: 1.15rem;
  color: var(--color-navy);
  margin-bottom: 8px;
}
.resource-card-featured h3 {
  color: #fff;
  font-size: 1.5rem;
}

.resource-card p {
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}
.resource-card-featured p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
  line-height: 1.7;
}

.resource-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-red);
}

.resource-coming {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== States Highlight ===== */
.states-highlight {
  padding: 48px 0;
  background: var(--color-bg);
}

.states-highlight h2 {
  text-align: center;
  font-size: 1.8rem;
  color: var(--color-navy);
  margin-bottom: 12px;
}

.section-subtitle {
  text-align: center;
  font-size: 1rem;
  color: var(--color-muted);
  margin-bottom: 32px;
}

.state-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.state-chip {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 100px;
  text-decoration: none;
  border: 2px solid;
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.state-chip-red {
  background: rgba(196, 18, 48, 0.08);
  border-color: #c41230;
  color: #c41230;
}
.state-chip-red:hover {
  background: #c41230;
  color: #fff;
  box-shadow: 0 4px 12px rgba(196, 18, 48, 0.3);
  transform: translateY(-1px);
}

.state-chip-blue {
  background: rgba(26, 86, 219, 0.08);
  border-color: #1a56db;
  color: #1a56db;
}
.state-chip-blue:hover {
  background: #1a56db;
  color: #fff;
  box-shadow: 0 4px 12px rgba(26, 86, 219, 0.3);
  transform: translateY(-1px);
}

.state-chip-purple {
  background: rgba(124, 58, 237, 0.08);
  border-color: #7c3aed;
  color: #7c3aed;
}
.state-chip-purple:hover {
  background: #7c3aed;
  color: #fff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
  transform: translateY(-1px);
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-navy);
  color: rgba(255,255,255,0.8);
  padding: 48px 0;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.footer-about h3 {
  color: var(--color-card);
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.footer-about p {
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer-meta {
  text-align: right;
}

.disclaimer {
  font-size: 0.8rem;
  opacity: 0.7;
  line-height: 1.6;
  margin-bottom: 16px;
}

.last-updated {
  font-size: 0.8rem;
  opacity: 0.6;
  margin-bottom: 8px;
}

.footer-links {
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--color-accent);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.copyright {
  font-size: 0.8rem;
  opacity: 0.5;
}

/* ===== Serif / Editorial Type (Merriweather) ===== */
.body-serif {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--color-body);
}

.body-serif strong,
.body-serif-bold {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--color-body);
}

.body-serif-sm {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--color-body);
}

.deck {
  font-family: var(--font-serif);
  font-weight: 300;
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--color-muted);
}

.pullquote {
  font-family: var(--font-serif);
  font-weight: 700;
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.5;
  color: var(--color-accent);
  border-left: 4px solid var(--color-accent);
  padding-left: 1.5rem;
  margin: 2rem 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero {
    padding: 56px 0 48px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }


  .facts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-meta {
    text-align: left;
  }

  .states-overview {
    grid-template-columns: repeat(2, 1fr);
  }

  .resources-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {

  .hero h1 {
    font-size: 1.8rem;
  }

  .select-wrapper {
    min-width: 100%;
  }

  .facts-grid {
    grid-template-columns: 1fr;
  }

  .states-overview {
    grid-template-columns: 1fr;
  }

  .state-detail-header {
    flex-direction: column;
    gap: 4px;
  }

  .featured-states-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--color-light);
  margin-bottom: 0;
  padding: 12px 0;
}

.breadcrumb a {
  color: var(--color-light);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--color-navy);
}

.breadcrumb .sep {
  margin: 0 6px;
}

/* ===== Featured States Grid (states index) ===== */
.featured-states-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.featured-state-card {
  display: block;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  color: inherit;
}

.featured-state-card:hover {
  border-color: var(--color-navy);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}

.featured-state-card .state-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 4px;
}

.featured-state-card .state-abbr {
  font-size: 0.8rem;
  color: var(--color-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.featured-state-card .state-stats {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 12px;
}

.featured-state-card .level-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.featured-state-card .card-link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-red);
  margin-top: 12px;
}

/* ===== All States Mini Grid (states index) ===== */
.all-states-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.all-states-grid .state-card {
  padding: 16px;
  text-decoration: none;
  color: inherit;
  display: block;
}

.all-states-grid .state-card:hover {
  color: inherit;
}

/* ===== Key Dates List ===== */
.key-dates-list {
  list-style: none;
  padding: 0;
  position: relative;
}

.key-dates-list li {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0 14px 24px;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.key-dates-list li:last-child {
  border-bottom: none;
}

.key-date-date {
  min-width: 100px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-navy);
  white-space: nowrap;
}

.key-date-type {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--color-blue-light);
  color: var(--color-navy);
  white-space: nowrap;
}

.key-date-desc {
  font-size: 0.9rem;
  color: var(--color-muted);
  flex: 1;
}

.key-date-star {
  color: var(--color-gold);
  font-size: 1rem;
  position: absolute;
  left: 0;
  top: 14px;
}

/* Collapsible Key Dates */
.key-dates-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.key-dates-collapsible .key-dates-full {
  display: none;
}
.key-dates-collapsible.expanded .key-dates-full {
  display: block;
}
.key-dates-collapsible.expanded .key-dates-preview {
  display: none;
}
.key-dates-collapsible.expanded .key-dates-header {
  display: none;
}
.key-dates-expand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 16px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  color: var(--color-accent);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.key-dates-expand:hover {
  background: var(--color-blue-light);
  border-color: var(--color-accent);
}

/* ===== Race Card ===== */
.race-section {
  margin-bottom: 48px;
}

.race-section h3 {
  font-size: 1.4rem;
  color: var(--color-navy);
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-navy);
}

.race-cards {
  display: grid;
  gap: 16px;
}

.race-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  transition: box-shadow var(--transition);
}

.race-card:hover {
  box-shadow: var(--shadow-sm);
}

/* Favorite star */
.fav-star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: #d1d5db;
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.15s, transform 0.15s;
  flex-shrink: 0;
}
.fav-star:hover {
  color: #fbbf24;
  transform: scale(1.15);
}
.fav-star.active {
  color: #f59e0b;
}

.race-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.race-card-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.race-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-navy);
  text-decoration: none;
}

a.race-card-title:hover {
  text-decoration: underline;
}

.race-card-district {
  font-size: 0.85rem;
  color: var(--color-light);
  font-weight: 400;
}

.race-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.candidate-list {
  list-style: none;
  padding: 0;
}

.candidate-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.candidate-row:first-child {
  border-top: none;
}

.candidate-row-photo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #9ca3af;
}
.candidate-row-photo.dem { border-color: #2563eb; }
.candidate-row-photo.rep { border-color: #dc2626; }
.candidate-row-photo.lib { border-color: #f59e0b; }
.candidate-row-photo.grn { border-color: #16a34a; }
.candidate-row-photo.ind { border-color: #6b7280; }

.party-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.party-dot.dem { background: #2563eb; }
.party-dot.rep { background: #dc2626; }
.party-dot.lib { background: #f59e0b; }
.party-dot.grn { background: #16a34a; }
.party-dot.ind { background: #6b7280; }
.party-dot.other { background: #9ca3af; }

.candidate-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-body);
}

.candidate-party {
  font-size: 0.8rem;
  color: var(--color-light);
}

.candidate-badges {
  display: flex;
  gap: 4px;
}

.badge-incumbent {
  background: var(--color-amber-light);
  color: var(--color-amber);
}

.badge-green {
  background: #e6f4ea;
  color: #1e7e34;
}

.candidate-votes {
  font-size: 0.8rem;
  color: var(--color-navy);
  font-weight: 600;
  margin-left: auto;
  white-space: nowrap;
}

/* ===== Ballot Vote Checkmarks ===== */
.ballot-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  background: #f9fafb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}

.ballot-check:hover {
  border-color: #9ca3af;
  background: #f3f4f6;
  transform: scale(1.1);
}

.ballot-check.checked {
  border-color: #16a34a;
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

.ballot-check.checked:hover {
  background: #15803d;
  border-color: #15803d;
}

.ballot-check .check-icon {
  display: none;
  width: 16px;
  height: 16px;
}

.ballot-check.checked .check-icon {
  display: block;
}

.ballot-check-seats-hint {
  font-size: 0.75rem;
  color: var(--color-muted);
  text-align: right;
  margin-top: 4px;
  padding-right: 4px;
}

/* ===== Candidate Page Ballot Action ===== */
.candidate-ballot-action {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
}

.candidate-ballot-action .ballot-check {
  width: 32px;
  height: 32px;
}

.candidate-ballot-action .ballot-check .check-icon {
  width: 18px;
  height: 18px;
}

.candidate-ballot-label {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.85);
}

/* ===== Sentiment (Thumbs Up/Down) ===== */
.sentiment-btns {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.sentiment-btn {
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  opacity: 0.4;
  filter: grayscale(100%);
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.sentiment-btn:hover {
  opacity: 0.7;
  filter: grayscale(0%);
  transform: scale(1.15);
}

.sentiment-btn.active {
  opacity: 1;
  filter: grayscale(0%);
  transform: scale(1.1);
}

.candidate-positions-toggle {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--color-navy);
  cursor: pointer;
  font-weight: 500;
  margin-left: auto;
}

.candidate-positions-toggle:hover {
  color: var(--color-red);
}

.candidate-positions {
  display: none;
  padding: 8px 0 4px 20px;
}

.candidate-positions.open {
  display: block;
}

.position-item {
  padding: 6px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--color-border);
}

.position-item:last-child {
  border-bottom: none;
}

.position-topic {
  font-weight: 600;
  color: var(--color-body);
}

.position-stance {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 100px;
  text-transform: uppercase;
  margin-left: 6px;
}

.stance-support { background: var(--color-green-light); color: var(--color-green); }
.stance-oppose { background: #fce4ec; color: #c62828; }
.stance-mixed { background: var(--color-amber-light); color: var(--color-amber); }

.position-summary {
  color: var(--color-muted);
  margin-top: 2px;
}

/* ===== Legislature Group ===== */
.legislature-group {
  margin-bottom: 12px;
}

.legislature-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--color-bg);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-navy);
  transition: background var(--transition);
}

.legislature-group-header:hover {
  background: var(--color-border);
}

.legislature-group-header .chevron {
  font-size: 0.7rem;
  transition: transform var(--transition);
}

.legislature-group-header.open .chevron {
  transform: rotate(90deg);
}

.legislature-group-body {
  display: none;
  padding: 8px 0;
}

.legislature-group-body.open {
  display: block;
}

/* ===== How to Vote Section ===== */
.how-to-vote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.how-to-vote-card {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 24px;
}

.how-to-vote-card h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-light);
  margin-bottom: 10px;
}

.how-to-vote-card p,
.how-to-vote-card ul {
  font-size: 0.9rem;
  color: var(--color-body);
  line-height: 1.6;
}

.how-to-vote-card ul {
  list-style: none;
  padding: 0;
}

.how-to-vote-card ul li {
  padding: 4px 0;
}

/* ===== State Page Sections ===== */
.state-page-section {
  padding: 32px 0;
}

.state-page-section + .state-page-section {
  border-top: 1px solid var(--color-border);
}

.state-page-section h2 {
  font-size: 1.5rem;
  color: var(--color-navy);
  margin-bottom: 20px;
}

.state-at-glance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.glance-stat {
  text-align: center;
  padding: 20px 12px;
  background: var(--color-bg);
  border-radius: var(--radius);
}

.glance-stat .number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-navy);
  line-height: 1.1;
}

.glance-stat .label {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 4px;
}

/* ===== Party Breakdown ===== */
.party-breakdown {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.party-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}

.party-bar-seg {
  min-width: 2px;
  transition: width 0.3s ease;
}

.party-bar-seg.party-dem, .party-dot.party-dem { background: #2563eb; }
.party-bar-seg.party-rep, .party-dot.party-rep { background: #dc2626; }
.party-bar-seg.party-other, .party-dot.party-other { background: #9ca3af; }

.party-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.party-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--color-body);
}

.party-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

/* ===== Responsive additions ===== */
@media (max-width: 768px) {
  .race-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .candidate-row {
    flex-wrap: wrap;
  }

  .key-dates-list li {
    flex-direction: column;
    gap: 6px;
  }

  .how-to-vote-grid {
    grid-template-columns: 1fr;
  }

  .all-states-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .all-states-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .state-at-glance {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== Battleground Races ===== */
.battleground-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.battleground-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-red);
  border-radius: var(--radius);
  padding: 20px;
  transition: box-shadow var(--transition), transform var(--transition);
}

.battleground-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

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

.battleground-card-header .race-card-title {
  display: block;
  margin-bottom: 2px;
}

.battleground-candidates {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.battleground-candidate {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--color-border);
}

.battleground-candidate:first-child {
  border-top: none;
}

@media (max-width: 768px) {
  .battleground-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Candidate Name Links ===== */
a.candidate-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-body);
  text-decoration: none;
}

a.candidate-name:hover {
  color: var(--color-red);
}

/* ===== Candidate Detail Page ===== */
.candidate-hero {
  background: linear-gradient(to bottom right, #374151 0%, #6b7280 100%);
  color: var(--color-card);
  padding: 48px 0 40px;
}
.candidate-hero.dem { background: linear-gradient(to bottom right, #1e3a5f 0%, #2563eb 100%); }
.candidate-hero.rep { background: linear-gradient(to bottom right, #7f1d1d 0%, #dc2626 100%); }
.candidate-hero.lib { background: linear-gradient(to bottom right, #78350f 0%, #d97706 100%); }
.candidate-hero.grn { background: linear-gradient(to bottom right, #14532d 0%, #16a34a 100%); }
.candidate-hero.ind { background: linear-gradient(to bottom right, #1f2937 0%, #6b7280 100%); }

.candidate-hero-layout {
  display: flex;
  align-items: center;
  gap: 28px;
}

.candidate-hero-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.7);
  flex-shrink: 0;
}

.candidate-hero-content h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.candidate-hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.candidate-hero-party {
  font-size: 1rem;
  opacity: 0.9;
}

.candidate-hero-meta .badge-incumbent {
  background: rgba(255,255,255,0.2);
  color: var(--color-card);
}

.candidate-hero-meta .badge-green {
  background: rgba(255,255,255,0.2);
  color: var(--color-card);
}

.candidate-hero-votes {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-card);
  margin-bottom: 8px;
}

.candidate-hero .fav-star {
  font-size: 1.6rem;
  color: rgba(255,255,255,0.4);
}
.candidate-hero .fav-star:hover {
  color: #fbbf24;
}
.candidate-hero .fav-star.active {
  color: #f59e0b;
}

.candidate-website-link {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-gold-light);
  margin-top: 4px;
}

.candidate-website-link:hover {
  color: var(--color-card);
}

/* Campaign Info section — card grid */
.campaign-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.campaign-info-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.campaign-info-card-icon {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.campaign-info-card-body {
  flex: 1;
  min-width: 0;
}

.campaign-info-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.campaign-info-link {
  display: block;
  color: var(--color-accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  word-break: break-all;
  line-height: 1.4;
}

.campaign-info-link:hover {
  text-decoration: underline;
}

.campaign-info-card-donate {
  border-color: var(--color-green, #2e7d32);
  border-width: 1.5px;
}

.campaign-info-donate-btn {
  display: inline-block;
  padding: 8px 20px;
  background: var(--color-green, #2e7d32);
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  transition: opacity 0.15s;
}

.campaign-info-donate-btn:hover {
  opacity: 0.9;
}

.campaign-info-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.campaign-social-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  color: var(--color-body);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
}

.campaign-social-chip:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.campaign-social-icon {
  font-size: 0.9rem;
}

.campaign-info-card-status {
  border-color: var(--color-red);
  border-width: 1.5px;
}

/* Unclaimed CTA — always visible */
.campaign-unclaimed {
  margin-top: 4px;
}

.campaign-unclaimed-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
}

.campaign-unclaimed-text {
  font-size: 0.88rem;
  color: var(--color-muted);
  line-height: 1.5;
}

.campaign-unclaimed-text strong {
  color: var(--color-body);
}

.campaign-unclaimed-btn {
  flex-shrink: 0;
  padding: 8px 18px;
  background: var(--color-navy);
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.campaign-unclaimed-btn:hover {
  opacity: 0.9;
}

@media (max-width: 600px) {
  .campaign-info-grid {
    grid-template-columns: 1fr;
  }
  .campaign-unclaimed-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* Race context cards */
.candidate-races {
  display: grid;
  gap: 12px;
}

.candidate-race-card {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 20px;
}

.candidate-race-card-header {
  margin-bottom: 8px;
}

/* Opponent rows */
.opponent-list {
  display: grid;
  gap: 0;
}

.opponent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}

.opponent-row:last-child {
  border-bottom: none;
}

/* Position cards grid */
.candidate-positions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.candidate-position-card {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 20px;
}

.candidate-position-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.candidate-position-summary {
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.6;
}

/* District section: 2-column grid */
.district-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.district-map {
  width: 100%;
  height: 380px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}

.district-info {
  padding: 4px 0;
}

.district-info-title {
  font-family: var(--font-sans);
  color: var(--color-navy);
  font-size: 1.15rem;
  margin-bottom: 16px;
}

.district-info-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.district-info-dl dt {
  color: var(--color-muted);
  font-weight: 500;
}

.district-info-dl dd {
  color: var(--color-navy);
  font-weight: 600;
}

.district-info-scope {
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.6;
  border-top: 1px solid var(--color-border);
  padding-top: 12px;
}

@media (max-width: 768px) {
  .district-grid {
    grid-template-columns: 1fr;
  }
  .district-map {
    height: 280px;
  }
}

/* Social media links */
.candidate-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.candidate-social-link {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 16px 24px;
  min-width: 160px;
  text-decoration: none;
  transition: box-shadow var(--transition), transform var(--transition);
}

.candidate-social-link:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.candidate-social-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-light);
  margin-bottom: 2px;
}

.candidate-social-handle {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-navy);
}

.candidate-social-link:hover .candidate-social-handle {
  color: var(--color-red);
}

/* ===== Local Area Navigation ===== */
.local-area-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.local-area-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-navy);
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
}

.local-area-chip:hover {
  background: var(--color-navy);
  border-color: var(--color-navy);
  color: var(--color-card);
}

.local-area-chip:hover .local-area-chip-count {
  background: rgba(255,255,255,0.2);
  color: var(--color-card);
}

.local-area-chip-count {
  display: inline-block;
  background: var(--color-border);
  color: var(--color-muted);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 100px;
  min-width: 20px;
  text-align: center;
}

@media (max-width: 768px) {
  .local-area-nav {
    gap: 6px;
  }

  .local-area-chip {
    font-size: 0.8rem;
    padding: 5px 12px;
  }
}

/* ===== Election Spotlight (Homepage) ===== */
.election-spotlight {
  padding: 48px 0;
  background: var(--color-card);
}

.election-spotlight h2 {
  text-align: center;
  font-size: 1.8rem;
  color: var(--color-navy);
  margin-bottom: 12px;
}

.spotlight-subtitle {
  text-align: center;
  font-size: 1rem;
  color: var(--color-muted);
  margin-bottom: 36px;
}

/* Election night state block */
.spotlight-state {
  margin-bottom: 40px;
}

.spotlight-state:last-child {
  margin-bottom: 0;
}

.spotlight-state-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.spotlight-state-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-navy);
}

.spotlight-state-name a {
  color: inherit;
  text-decoration: none;
}

.spotlight-state-name a:hover {
  color: var(--color-red);
}

.reporting-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--color-green-light);
  color: var(--color-green);
}

.reporting-badge-live {
  background: #fef2f2;
  color: var(--color-red);
}

.reporting-badge-live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-red);
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.reporting-badge-recent {
  background: #fff7ed;
  color: #c2410c;
}

.reporting-badge-recent::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f97316;
}

.reporting-badge-upcoming {
  background: var(--color-blue-light);
  color: var(--color-navy);
}

/* Spotlight race grid */
.spotlight-races {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.spotlight-race {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  transition: box-shadow var(--transition), transform var(--transition);
}

.spotlight-race:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.spotlight-race.is-battleground {
  border-left: 4px solid var(--color-red);
}

.spotlight-race-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 4px;
}

.spotlight-race-district {
  font-size: 0.8rem;
  color: var(--color-light);
  margin-bottom: 12px;
}

.spotlight-race-badges {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

/* Candidate — single row: photo/dot | name | pct | bar */
.spotlight-candidate {
  display: grid;
  grid-template-columns: auto 1fr auto 60px;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid var(--color-border);
}

.spotlight-candidate .candidate-row-photo {
  width: 28px;
  height: 28px;
  object-fit: cover;
}

.spotlight-candidate .party-dot {
  width: 10px;
  height: 10px;
}

.spotlight-candidate:first-child {
  border-top: none;
}

.spotlight-candidate-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-body);
}

.spotlight-candidate-name a {
  color: inherit;
  text-decoration: none;
}

.spotlight-candidate-name a:hover {
  color: var(--color-red);
}

.spotlight-candidate-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.spotlight-candidate-votes {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 400;
}

.spotlight-candidate-pct {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-navy);
  text-align: right;
  white-space: nowrap;
}

.winner-check {
  color: var(--color-green);
  font-weight: 700;
  font-size: 0.85rem;
}

.winner-trophy {
  font-size: 1.1rem;
  line-height: 1;
}

.primary-winner-star {
  color: #9ca3af;
  font-size: 1.1rem;
  line-height: 1;
}

.runoff-flag {
  font-size: 1rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(180, 140, 0, 0.3));
}

.vote-bar {
  width: 100%;
  height: 6px;
  background: var(--color-bg);
  border-radius: 3px;
  overflow: hidden;
}

.vote-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.vote-bar-fill.dem { background: #2563eb; }
.vote-bar-fill.rep { background: #dc2626; }
.vote-bar-fill.lib { background: #f59e0b; }
.vote-bar-fill.grn { background: #16a34a; }
.vote-bar-fill.ind { background: #6b7280; }
.vote-bar-fill.other { background: #9ca3af; }

/* See all link */
.spotlight-see-all {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-red);
}

.spotlight-see-all:hover {
  color: var(--color-red-light);
}

/* Upcoming states grid */
.spotlight-upcoming-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.spotlight-upcoming-card {
  display: block;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  color: inherit;
}

.spotlight-upcoming-card:hover {
  border-color: var(--color-navy);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}

.spotlight-upcoming-state {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 6px;
}

.spotlight-upcoming-date {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 8px;
}

.spotlight-upcoming-summary {
  font-size: 0.85rem;
  color: var(--color-light);
  margin-bottom: 12px;
}

.spotlight-upcoming-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-red);
}

@media (max-width: 768px) {
  .spotlight-races {
    grid-template-columns: 1fr;
  }

  .spotlight-upcoming-grid {
    grid-template-columns: 1fr;
  }

  .spotlight-state-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .vote-bar {
    width: 60px;
  }
}

/* ===== Candidate Detail Responsive ===== */
@media (max-width: 768px) {
  .candidate-hero-content h1 {
    font-size: 1.8rem;
  }

  .candidate-hero-photo {
    width: 90px;
    height: 90px;
  }

  .candidate-hero-layout {
    gap: 20px;
  }

  .candidate-positions-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Race Detail Page ===== */
.race-detail-candidates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.race-detail-candidate-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border-top: 4px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}

.race-detail-candidate-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.race-detail-candidate-card.dem { border-top-color: #2563eb; }
.race-detail-candidate-card.rep { border-top-color: #dc2626; }
.race-detail-candidate-card.lib { border-top-color: #f59e0b; }
.race-detail-candidate-card.grn { border-top-color: #10b981; }
.race-detail-candidate-card.ind { border-top-color: #8b5cf6; }

.race-detail-candidate-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.race-detail-candidate-header .candidate-row-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.race-detail-candidate-header .party-dot {
  width: 56px !important;
  height: 56px !important;
}

.race-detail-endorsements {
  margin-top: 12px;
}

.race-detail-positions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  flex: 1;
}

@media (max-width: 700px) {
  .race-detail-candidates {
    grid-template-columns: 1fr;
  }
}

/* ===== Election Authority Page ===== */
.authority-hero {
  background: linear-gradient(to bottom right, #1f2937 0%, #9ca3af 100%);
  color: var(--color-card);
  padding: 48px 0 40px;
}
.authority-hero-layout {
  display: flex;
  align-items: center;
  gap: 24px;
}
.authority-hero-icon {
  font-size: 3.5rem;
  flex-shrink: 0;
  line-height: 1;
}
.authority-hero-content h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
.authority-hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.authority-hero-title {
  font-size: 1rem;
  opacity: 0.85;
}
.authority-hero-state {
  font-size: 0.9rem;
  opacity: 0.7;
}
.authority-official-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 4px;
}
.authority-official-party {
  font-weight: 400;
  opacity: 0.8;
}
.authority-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.authority-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
}
.authority-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 16px;
}
.authority-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
}
.authority-dl dt {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-muted);
}
.authority-dl dd {
  font-size: 0.9rem;
  margin: 0;
  word-break: break-word;
}
.authority-dl dd a {
  color: var(--color-red);
}
.authority-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.authority-stat {
  text-align: center;
  padding: 12px 8px;
  background: var(--color-bg);
  border-radius: 8px;
}
.authority-stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--color-navy);
  letter-spacing: -0.5px;
}
.authority-stat-label {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 4px;
}
.authority-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.authority-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  text-decoration: none;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.authority-link-card:hover {
  border-color: var(--color-navy);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.authority-link-icon {
  font-size: 1.8rem;
  line-height: 1;
}
.authority-link-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-navy);
}
.authority-link-url {
  font-size: 0.75rem;
  color: var(--color-muted);
  word-break: break-all;
}
.authority-infra-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.authority-infra-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px;
}
.authority-infra-card h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.authority-infra-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 4px;
}
.authority-infra-detail {
  font-size: 0.85rem;
  color: var(--color-muted);
}
.authority-infra-detail a {
  color: var(--color-red);
}
.authority-official-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
  max-width: 480px;
}
.authority-official-info h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 8px;
}
.authority-official-role {
  font-size: 0.95rem;
  color: var(--color-muted);
  margin-bottom: 4px;
}
.authority-official-detail {
  font-size: 0.9rem;
  color: var(--color-body);
}
.authority-county-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.authority-county-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px;
}
.authority-county-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 8px;
}
.authority-county-detail {
  font-size: 0.85rem;
  color: var(--color-body);
  margin: 3px 0;
}
.authority-county-detail a {
  color: var(--color-red);
}
.authority-county-voters {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-navy);
  margin-top: 6px;
}

@media (max-width: 768px) {
  .authority-hero-layout {
    flex-direction: column;
    text-align: center;
  }
  .authority-hero-meta {
    justify-content: center;
  }
  .authority-hero-content h1 {
    font-size: 1.5rem;
  }
  .authority-grid {
    grid-template-columns: 1fr;
  }
  .authority-infra-grid {
    grid-template-columns: 1fr;
  }
  .authority-stats {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== Endorsements ===== */

/* Candidate page — endorsement list */
.endorsement-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.endorsement-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.endorsement-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-heading);
}
.endorsement-name a {
  color: var(--color-heading);
  text-decoration: none;
}
.endorsement-name a:hover {
  color: var(--color-accent);
}
.endorsement-type {
  font-size: 0.8rem;
  color: var(--color-muted);
  background: var(--color-surface-alt, var(--color-bg));
  padding: 2px 8px;
  border-radius: 4px;
}
.endorsement-source {
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
  margin-left: auto;
}
.endorsement-source:hover {
  color: var(--color-red);
}

/* Race page — inline endorsement badges */
.race-detail-endorsements {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.endorsement-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--color-green-light);
  border: 1px solid #c8e6c9;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-green);
}
.endorsement-badge a {
  color: inherit;
  text-decoration: none;
}
.endorsement-badge a:hover {
  text-decoration: underline;
}

/* Organization directory */
.org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.org-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: box-shadow 0.2s;
}
.org-card:hover {
  box-shadow: var(--shadow-md);
}
.org-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.org-card-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  object-fit: contain;
  background: var(--color-bg);
  flex-shrink: 0;
}
.org-card-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-heading);
}
.org-card-name a {
  color: inherit;
  text-decoration: none;
}
.org-card-name a:hover {
  color: var(--color-accent);
}
.org-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.org-card-desc {
  font-size: 0.9rem;
  color: var(--color-body);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.org-card-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--color-muted);
}
.org-card-stat {
  font-weight: 600;
  color: var(--color-heading);
}

/* Organization profile */
.org-profile-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
}
.org-profile-logo {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  object-fit: contain;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}
.org-profile-info h1 {
  font-size: 1.8rem;
  margin-bottom: 6px;
}
.org-profile-info .org-type-label {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-bottom: 12px;
}
.org-profile-desc {
  font-size: 0.95rem;
  color: var(--color-body);
  line-height: 1.6;
  margin-bottom: 16px;
}
.org-profile-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.org-profile-links a {
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.org-profile-links a:hover {
  color: var(--color-red);
}

/* Org dashboard */
.org-dash-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}
.org-dash-section h3 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}
.org-member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}
.org-member-row:last-child {
  border-bottom: none;
}
.org-member-name {
  font-weight: 600;
  color: var(--color-heading);
  flex: 1;
}
.org-member-role {
  font-size: 0.8rem;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 600;
}
.org-member-role.owner { background: #fff3e0; color: #e65100; }
.org-member-role.staff { background: var(--color-blue-light); color: var(--color-accent); }
.org-member-role.committee { background: var(--color-green-light); color: var(--color-green); }
.org-member-role.member { background: var(--color-bg); color: var(--color-muted); }

.org-poll-card {
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.org-poll-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-heading);
  margin-bottom: 6px;
}
.org-poll-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--color-muted);
}

@media (max-width: 600px) {
  .endorsement-list {
    grid-template-columns: 1fr;
  }
  .org-grid {
    grid-template-columns: 1fr;
  }
  .org-profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .org-profile-links {
    justify-content: center;
  }
}

/* ===== Alignment Badge & Breakdown ===== */
.alignment-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.alignment-high { background: rgba(22,163,74,0.12); color: #16a34a; }
.alignment-mid { background: rgba(217,119,6,0.12); color: #d97706; }
.alignment-low { background: rgba(220,38,38,0.12); color: #dc2626; }

.alignment-breakdown {
  margin-bottom: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.alignment-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
}
.alignment-summary.alignment-high { background: rgba(22,163,74,0.06); }
.alignment-summary.alignment-mid { background: rgba(217,119,6,0.06); }
.alignment-summary.alignment-low { background: rgba(220,38,38,0.06); }
.alignment-score-big {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
}
.alignment-summary.alignment-high .alignment-score-big { color: #16a34a; }
.alignment-summary.alignment-mid .alignment-score-big { color: #d97706; }
.alignment-summary.alignment-low .alignment-score-big { color: #dc2626; }
.alignment-score-label {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.alignment-detail-grid {
  padding: 8px 16px 12px;
}
.alignment-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--color-border);
}
.alignment-detail-row:last-child { border-bottom: none; }
.alignment-detail-topic {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-heading);
}
.alignment-detail-you,
.alignment-detail-cand {
  min-width: 72px;
  text-align: center;
}
.alignment-detail-icon {
  width: 20px;
  text-align: center;
  font-size: 0.85rem;
}

.alignment-cta {
  padding: 16px 20px;
  background: var(--color-surface-alt);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--color-muted);
  line-height: 1.5;
}
.alignment-cta a {
  color: var(--color-accent);
  font-weight: 600;
}

/* Stance pills (shared) */
.stance-pill { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.stance-pill.stance-support { background: rgba(22,163,74,0.12); color: #16a34a; }
.stance-pill.stance-oppose { background: rgba(220,38,38,0.12); color: #dc2626; }
.stance-pill.stance-mixed { background: rgba(217,119,6,0.12); color: #d97706; }
.stance-pill.stance-noopinion,
.stance-pill.stance-noposition { background: rgba(107,114,128,0.1); color: #6b7280; }

/* Alignment on opponent rows */
.opponent-alignment {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 100px;
  margin-left: 4px;
  white-space: nowrap;
}
.opponent-alignment.alignment-high { background: rgba(22,163,74,0.1); color: #16a34a; }
.opponent-alignment.alignment-mid { background: rgba(217,119,6,0.1); color: #d97706; }
.opponent-alignment.alignment-low { background: rgba(220,38,38,0.1); color: #dc2626; }

/* ===== Campaign Finance (OpenSecrets/FEC) ===== */
.finance-section {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.finance-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.finance-header h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--color-navy);
}

.finance-os-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
  white-space: nowrap;
}

.finance-os-link:hover {
  text-decoration: underline;
}

/* Loading skeleton */
.finance-loading {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.finance-skeleton {
  height: 20px;
  background: linear-gradient(90deg, var(--color-border) 25%, #e8eaee 50%, var(--color-border) 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: finSkeleton 1.4s ease-in-out infinite;
}

@keyframes finSkeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Metric tiles */
.finance-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.finance-metrics-4 {
  grid-template-columns: repeat(4, 1fr);
}

.finance-metric {
  text-align: center;
  padding: 16px 8px 12px;
  background: var(--color-card);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.finance-metric-value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.finance-metric-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.finance-metric-full {
  font-size: 0.72rem;
  color: var(--color-light);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* Funding breakdown */
.finance-breakdown {
  margin-bottom: 16px;
}

.finance-breakdown-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.finance-stacked-bar {
  display: flex;
  height: 26px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-border);
}

.finance-bar-segment {
  height: 100%;
  min-width: 3px;
  transition: width 0.6s ease;
  cursor: default;
  position: relative;
}

.finance-bar-segment:first-child {
  border-radius: 6px 0 0 6px;
}

.finance-bar-segment:last-child {
  border-radius: 0 6px 6px 0;
}

.finance-bar-segment:only-child {
  border-radius: 6px;
}

/* Legend */
.finance-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 10px;
}

.finance-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}

.finance-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.finance-legend-label {
  color: var(--color-body);
  font-weight: 500;
}

.finance-legend-pct {
  color: var(--color-muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.finance-legend-amt {
  color: var(--color-light);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

/* Spend rate */
.finance-burn {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.finance-burn-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.finance-burn-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.finance-burn-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-body);
}

.finance-burn-track {
  height: 8px;
  background: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

.finance-burn-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Footer */
.finance-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  font-size: 0.75rem;
  color: var(--color-light);
}

.finance-footer-links {
  display: flex;
  gap: 12px;
}

.finance-footer-links a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
}

.finance-footer-links a:hover {
  text-decoration: underline;
}

/* Empty/no data state */
.finance-empty {
  text-align: center;
  padding: 20px 16px;
}

.finance-empty-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  opacity: 0.6;
}

.finance-empty-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 6px;
}

.finance-empty-note {
  font-size: 0.82rem;
  color: var(--color-muted);
  max-width: 440px;
  margin: 0 auto 14px;
  line-height: 1.5;
}

.finance-empty-inline {
  text-align: center;
  padding: 12px;
  color: var(--color-muted);
  font-size: 0.88rem;
}

.finance-search-btn {
  display: inline-block;
  padding: 8px 20px;
  background: var(--color-navy);
  color: #fff !important;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
}

.finance-search-btn:hover {
  opacity: 0.9;
  color: #fff !important;
}

.finance-empty-links {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.finance-search-btn-alt {
  background: var(--color-muted);
}

/* $ badge on candidate lists */
.finance-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: rgba(201, 168, 73, 0.18);
  color: #8b6914;
  font-size: 0.7rem;
  font-weight: 800;
  margin-left: 5px;
  vertical-align: middle;
  cursor: default;
  flex-shrink: 0;
}

.finance-badge:hover {
  background: rgba(201, 168, 73, 0.35);
}

/* Inline finance bars (opponent rows) */
.fin-inline {
  width: 50%;
  margin-top: 6px;
  margin-left: auto;
}

.fin-inline-track {
  height: 24px;
  background: var(--color-border);
  border-radius: 6px;
  overflow: hidden;
}

.fin-inline-bar {
  height: 100%;
  border-radius: 6px;
  min-width: 48px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  transition: width 0.6s ease;
}

.fin-inline-raised {
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.fin-inline-detail {
  display: block;
  font-size: 0.7rem;
  color: var(--color-light);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  .fin-inline-detail { display: none; }
}

/* Responsive */
@media (max-width: 600px) {
  .finance-section {
    padding: 16px;
  }
  .finance-metrics {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .finance-metrics-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .finance-metric {
    padding: 12px 4px 10px;
  }
  .finance-metric-value {
    font-size: 1.1rem;
  }
  .finance-metric-full {
    display: none;
  }
  .finance-legend {
    flex-direction: column;
    gap: 6px;
  }
  .finance-footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* ===== Coming 2028 Ribbon ===== */
.resource-card-ribbon {
  position: relative;
  overflow: hidden;
}

.ribbon-2028 {
  position: absolute;
  top: 28px;
  right: -35px;
  background: var(--color-red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 40px;
  transform: rotate(45deg);
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  pointer-events: none;
}

/* ===== Special Elections ===== */
.special-election-card {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.filter-btn {
  padding: 6px 16px;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  background: var(--color-card);
  color: var(--color-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}
.filter-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-navy);
}
.filter-btn.active {
  background: var(--color-navy);
  color: #fff;
  border-color: var(--color-navy);
}

.badge-red {
  background: #fee2e2;
  color: var(--color-red);
}

/* ===== Candidate News ===== */
.candidate-news-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.candidate-news-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--color-bg);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--color-body);
  transition: box-shadow var(--transition), transform var(--transition);
}
.candidate-news-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.candidate-news-img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.candidate-news-body {
  flex: 1;
  min-width: 0;
}

.candidate-news-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-navy);
  line-height: 1.4;
  margin-bottom: 4px;
}

.candidate-news-summary {
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.candidate-news-meta {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--color-light);
}

.candidate-news-category {
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
}

.candidate-news-more {
  display: inline-block;
  padding: 8px 24px;
  border: 1px solid var(--color-navy);
  border-radius: 20px;
  color: var(--color-navy);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
}
.candidate-news-more:hover {
  background: var(--color-navy);
  color: #fff;
}

@media (max-width: 600px) {
  .candidate-news-img {
    width: 80px;
    height: 60px;
  }
}
