/* Custom Mobile Navigation Styles for Portrait/Vertical Mobile */

/* Hide Observable Framework's default header */
.observablehq-header,
header[data-observablehq],
[data-observablehq-header] {
  display: none !important;
}

/* Remove border from Observable header div.
   display:block (Observable defaults to flex) so the homepage's countdown
   banner — relocated above .custom-header at render time — stacks on top of
   the nav instead of sitting beside it. */
#observablehq-header {
  border-bottom: none !important;
  left: 0 !important;
  right: 0 !important;
  position: static !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  /* Observable's theme fixes this at ~2.2rem, which made the banner + nav
     overflow it and paint over the top ~70px of every page's content */
  height: auto !important;
}

/* Site-wide election countdown banner — injected via the config header slot,
   above .custom-header on every page. Day count filled client-side by the
   config head script ([data-wmr-days]); coverage totals baked at build time. */
.wmr-banner {
  background: linear-gradient(90deg, #1e3a8a 0%, #6b21a8 50%, #991b1b 100%);
  color: #fff;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.wmr-banner-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-family: var(--wmr-mono, 'JetBrains Mono', monospace);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.wmr-banner-items {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.wmr-banner-sep {
  opacity: 0.5;
}

.wmr-banner a {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  white-space: nowrap;
}

.wmr-banner .wmr-live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.35);
  margin-right: 8px;
  vertical-align: middle;
}

@media (max-width: 768px) {
  /* Single compact line, padded clear of the fixed hamburger button */
  .wmr-banner-inner {
    justify-content: flex-start;
    font-size: 11px;
    padding-right: 64px;
  }
  .wmr-banner-items { gap: 8px; }
  .wmr-banner-items .wmr-banner-optional,
  .wmr-banner-items .wmr-banner-label { display: none; }
  .wmr-banner a { display: none; }
}

/* Style the Observable Framework header — light editorial bar (2026 redesign) */
.custom-header {
  background: var(--wmr-cream, #fbfaf7);
  border-bottom: 1px solid var(--wmr-border, #e7e3d9);
  padding: 0;
  margin-top: 0;
  margin-bottom: -1px;
  z-index: 1000;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.header-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.header-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.header-logo img {
  height: 46px !important;
  width: auto;
}


/* Desktop nav — visible ≥1024px, hamburger takes over below */
.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.header-link {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}

.header-link:hover {
  color: var(--wmr-ink, #0f172a);
}

.header-link--accent {
  color: #dc2626;
  font-weight: 600;
}

.header-link--accent:hover {
  color: #991b1b;
}

@media (max-width: 1023px) {
  .header-nav {
    display: none;
  }
}


/* Hamburger menu button - only show on mobile portrait (vertical) */
.mobile-nav-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1003;
  background: var(--theme-foreground-focus);
  border: none;
  border-radius: 4px;
  padding: 0.5rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
}

.mobile-nav-toggle:hover {
  background: var(--theme-foreground-muted);
}

.mobile-nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--theme-background);
  transition: all 0.3s;
  border-radius: 2px;
}


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

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

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

/* Mobile navigation menu */
.mobile-nav-menu {
  display: none;
  position: fixed;
  top: 0;
  right: -100%;
  width: 250px;
  height: 100vh;
  background: var(--theme-background);
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  z-index: 1002;
  transition: right 0.3s ease;
  overflow-y: auto;
  padding: 4rem 1rem 1rem;
  pointer-events: none;
}

/* Enable pointer events and show menu when active */
.mobile-nav-menu.active {
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  right: 0;
}

.mobile-nav-menu nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-nav-menu nav a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--theme-foreground);
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.2s;
  font-size: 16px;
}

.mobile-nav-menu nav a:hover {
  background: var(--theme-foreground-faintest);
}

.mobile-nav-menu nav a.active {
  background: var(--theme-foreground-fainter);
  font-weight: 600;
}

/* Overlay when menu is open */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.mobile-nav-overlay.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

/* Hide Observable Framework's TOC sidebar that blocks right side */
#observablehq-toc {
  display: none !important;
  pointer-events: none !important;
}

/* Show hamburger menu only below the desktop-nav breakpoint */
@media (max-width: 1023px) {
  .mobile-nav-toggle {
    display: flex;
  }
}

/* Ensure content doesn't get hidden behind the hamburger button and header */
main {
  padding-top: 0;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: none !important;
  width: 100% !important;
  overflow-x: clip;
}

/* Override Observable Framework's main container to allow full-width content */
#observablehq-main {
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Remove margins from Observable Framework center container so the header
   (and the homepage countdown banner above it) sits flush with the top edge */
#observablehq-center {
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-top: 0 !important;
}

/* ===== INDEX PAGE STYLES (moved from index.md) ====== */
:root {
  --primary-blue: #2563eb;
  --primary-blue-dark: #1d4ed8;
  --navy-blue: rgba(25, 46, 81, 0.8);
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-card: #ffffff;
  --border-light: #e5e7eb;
  --border-medium: #d1d5db;
  --red-500: #ef4444;
  --green-500: #10b981;
  --orange-500: #f59e0b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);

  /* 2026 homepage redesign tokens (wmr- prefix) */
  --wmr-cream: #fbfaf7;
  --wmr-ink: #0f172a;
  --wmr-border: #e7e3d9;
  --wmr-slate: #475569;
  --wmr-muted: #64748b;
  --wmr-dark: #0b1220;
  --wmr-d: #2a6fdb;
  --wmr-r: #d13a4b;
  --wmr-i: #8b5cf6;
  --wmr-blue: #1d4ed8;
  --wmr-serif: 'Fraunces', Georgia, serif;
  --wmr-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

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

html {
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  margin: 0 !important;
  padding: 0 !important;
  width: 100%;
  box-sizing: border-box;
  overflow-x: clip;
}


.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
}

/* Bigger side margins on large screens */
@media (min-width: 769px) {
  .container {
    max-width: none;
    padding: 0 20rem;
  }
}

/* Narrower max-width for member page content for better readability */
.content-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}


.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.trending-badge {
  display: inline-block;
  background: var(--red-500);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

h2.section-title, .section-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  text-align: center !important;
  display: block;
  width: 100%;
}

/* Additional targeting for section titles in trending sections */
.trending-section h2.section-title,
.section-header h2.section-title,
.container h2.section-title,
.trending-section .section-header h2.section-title,
.trending-section .container .section-header h2.section-title,
section.trending-section .container .section-header h2.section-title,
div.section .trending-section .container .section-header h2.section-title {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.section-description {
  font-size: 1rem;
  color: var(--text-secondary);
  text-align: center !important;
}

/* Additional specific targeting for district description */
.trending-section .section-header .section-description,
.section-header p.section-description {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}


/* District Newsletter Signup - inherits from .signup-section but with slight variation */
.district-signup {
  border-top: 1px solid var(--border-light);
  margin-top: 2rem;
}

.district-signup .mc-field-group {
  margin-bottom: 0.5rem;
}

.district-signup .mc-field-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: #9fb3c8;
  font-weight: 500;
}

.district-signup .input {
  margin-bottom: 0;
}

.contact-btn {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  background: var(--bg-primary);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.contact-btn.primary {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
}

.contact-btn:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

.contact-btn.primary:hover {
  background: var(--primary-blue-dark);
  color: white;
}

.contact-btn.financial-details {
  background: #16a34a;
  color: white;
  border-color: #16a34a;
}

.contact-btn.financial-details:hover {
  background: #15803d;
  color: white;
  border-color: #15803d;
}

.contact-btn.fec-btn {
  background: white;
  color: #16a34a;
  border-color: #16a34a;
}

.contact-btn.fec-btn:hover {
  background: white;
  color: #16a34a;
  border-color: #16a34a;
}

/* Representatives Contact Section */
.representatives-contact-section {
  padding: 2rem 0 4rem 0;
  background: linear-gradient(135deg, rgba(232, 234, 238, 0.3) 0%, rgba(110, 141, 190, 0.3) 100%);
  border-top: 1px solid var(--border-light);
}

.representatives-contact-section .section-header {
  text-align: center !important;
}

.representatives-contact-section .section-header .contact-section-title,
.representatives-contact-section .contact-section-title,
section.representatives-contact-section .section-header .contact-section-title,
h3.contact-section-title {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
  display: block !important;
  width: 100% !important;
}

.contact-section-title {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  text-align: center !important;
}

.representatives-contact-section .section-header .contact-section-subtitle,
.representatives-contact-section .contact-section-subtitle,
section.representatives-contact-section .section-header .contact-section-subtitle,
p.contact-section-subtitle {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
  display: block !important;
  width: 100% !important;
}

.contact-section-subtitle {
  color: var(--text-secondary);
  margin: 0 0 2rem 0;
  text-align: center !important;
  font-size: 0.95rem;
}

.representatives-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  justify-content: center;
  align-items: stretch;
}

.representatives-grid > * {
  flex: 0 0 380px;
  min-height: 100%;
}

@media (max-width: 1024px) {
  .representatives-grid {
    flex-wrap: wrap;
    max-width: 1000px;
  }

  .representatives-grid > * {
    flex: 1 1 300px;
  }
}

.fec-disclaimer {
  text-align: center;
  margin-top: 2rem;
}

.fec-disclaimer p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.7;
  margin: 0;
}

.fec-disclaimer-inline {
  text-align: center;
  margin-top: 0.05rem;
  margin-bottom: 1rem;
}

.fec-disclaimer-inline p {
  font-size: 0.65rem;
  color: var(--text-secondary);
  opacity: 0.6;
  margin: 0;
  font-style: italic;
}

.rep-contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--border-light);
  border-radius: 12px;
  padding: 1.5rem;
  position: relative;
  transition: all 0.2s ease;
  display: flex !important;
  flex-direction: column !important;
}

.rep-contact-card .rep-main {
  display: flex !important;
  flex-direction: row !important;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 12px;
}

.rep-contact-card .rep-photo {
  flex-shrink: 0 !important;
  width: 80px;
}

.rep-contact-card .rep-content {
  flex: 1 !important;
  min-width: 0;
}

.rep-contact-card .rep-footer {
  width: 100%;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  text-align: center;
}

.rep-contact-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.rep-contact-card.republican-contact {
  border-left-color: #ef4444;
}

.rep-contact-card.democrat-contact {
  border-left-color: #3b82f6;
}

.rep-contact-card.independent-contact {
  border-left-color: #8b5cf6;
}

.rep-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.rep-role {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rep-info {
  margin-bottom: 0.75rem;
}

.rep-content {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.rep-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
}

.rep-district {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}


.rep-actions {
  display: flex;
  gap: 0.375rem;
  flex-wrap: nowrap;
  padding-bottom: 0.5rem;
}

/* Stats Section */
.stats-section {
  padding: 3rem 0;
  background: var(--bg-primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  text-align: center;
}

.stat-item {
  padding: 1.5rem;
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary-blue);
  display: block;
}

.stat-label {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Legacy support for existing elements */
.section {
  margin: 1.5rem 0;
}

/* The homepage's district-results mount is a .section that starts empty —
   no margin until a ZIP lookup fills it, so it can't open a gap between
   the hero and the midterms band. */
.section:empty {
  margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  /* Compact header on mobile */
  .header-container {
    height: 56px;
    padding: 0 1rem;
  }

  .header-logo img {
    height: 38px !important;
  }

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

}

@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }

  .section-title {
    font-size: 2rem;
  }

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

/* Map Showcase Section */
.map-showcase-section {
  padding: 4rem 0;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-top: 1px solid var(--border-light);
}

/* Newsletter Signup Section */
.signup-section {
  padding: 2rem 0;
  background: linear-gradient(135deg, rgba(232, 234, 238, 0.3) 0%, rgba(110, 141, 190, 0.3) 100%);
}

.signup-box {
  background: #121a2f;
  border: 1px solid #26365f;
  border-radius: 12px;
  padding: 0.5rem;
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
  color: #e9eef7;
  font-family: system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.signup-box h2 {
  margin: 0 0 0.15rem !important;
  font-size: 1.1rem !important;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
}

.signup-box p {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  color: #9fb3c8;
  line-height: 1.5;
}

.signup-box .input {
  width: 100%;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #2b3a5e;
  background: #0f1730;
  color: #e9eef7;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.signup-box .input:focus {
  outline: none;
  border-color: #3b82f6;
}

.signup-box .input::placeholder {
  color: #9fb3c8;
}

.signup-box .btn {
  width: 100%;
  padding: 0.4rem;
  border-radius: 6px;
  border: none;
  background: #3b82f6;
  color: #ffffff;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.signup-box .btn:hover {
  background: #2563eb;
}

.signup-box .btn:active {
  background: #1d4ed8;
}

.signup-box small {
  display: block;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: #9fb3c8;
}

@media (max-width: 768px) {
  .signup-box {
    max-width: 400px;
    padding: 0.5rem;
  }
}

@media (max-width: 480px) {
  .signup-section {
    padding: 3rem 0;
  }
  
  .signup-box {
    max-width: 300px;
    padding: 1.25rem;
  }
  
  .signup-box h2 {
    font-size: 1.375rem;
  }
  
  .signup-box p {
    font-size: 0.9rem;
  }
}


/* Stats Section */
.stats-section {
  background: #f8fafc;
  padding: 2rem 0;
  border-top: 1px solid #e2e8f0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  padding: 1.5rem 1rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-blue);
  margin-bottom: 0.25rem;
  line-height: 1;
}

.stat-label {
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-period {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.5rem;
  font-weight: 500;
}


@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .stat-card {
    padding: 1.5rem 1rem;
  }

  .stat-number {
    font-size: 2rem;
  }
  
}

/* Footer padding */
footer {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

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

  .representatives-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .rep-contact-card {
    padding: 1.25rem;
    flex-direction: column;
    align-items: center;
  }

  .rep-contact-card .rep-photo {
    margin-bottom: 0.5rem;
  }

  .rep-actions {
    padding-bottom: 1.5rem;
  }
  
  
  .rep-name {
    font-size: 0.85rem !important;
  }

  .rep-role {
    font-size: 0.6rem !important;
  }

  .rep-header {
    margin-bottom: 0.3rem !important;
  }

  .rep-info {
    margin-bottom: 0.3rem !important;
  }
  
  .rep-actions {
    flex-direction: row;
    gap: 0.5rem;
    justify-content: flex-start;
  }

  .contact-btn {
    text-align: center;
  }

  .rep-district {
    font-size: 0.7rem !important;
  }
  
  .stats-section {
    padding: 2rem 0;
  }
}


/* ===== TEXAS 2026 PAGE STYLES ===== */

.page-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem 1rem;
}

@media (max-width: 768px) {
  .page-container {
    padding: 0.5rem 1rem;
  }
}

/* Hero Section Styles */
.hero-section {
  background: linear-gradient(135deg, #3b4d8f 0%, #4a5399 50%, #5459a3 100%);
  color: white;
  padding: 3rem 2rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  /* Flex-center the children: Observable's theme puts a max-width on bare
     h1/p elements, so text-align alone leaves the title block off-center.
     (These two properties used to come from the deleted homepage .hero rules.) */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.hero-title {
  font-size: 48px;
  font-weight: 900;
  margin: 0 0 0.5rem 0;
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  /* Explicit — the theme styles bare h1 (dark color, max-width) with higher
     precedence than inheritance from .hero-section */
  color: #ffffff;
  max-width: none;
}

.hero-subtitle {
  font-size: 20px;
  margin: 0 0 2.5rem 0;
  opacity: 0.95;
  font-weight: 500;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
  align-items: start;
}

@media (max-width: 768px) {
  .hero-stats {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-subtitle {
    font-size: 16px;
  }
}

.hero-stat {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  transition: transform 0.2s;
  height: 180px;
  text-align: center;
  box-sizing: border-box;
}

.hero-stat:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.3);
}

.hero-stat.shock {
  background: rgba(251, 191, 36, 0.15);
  border-color: #fbbf24;
  border-width: 3px;
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.4);
}

.hero-stat.urgent {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  border-width: 3px;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
}

.hero-stat.stat-orange {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
  border-width: 3px;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.4);
}

.stat-number {
  font-size: 56px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.25rem;
  color: white;
}

.stat-label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 1;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: white;
}

.stat-desc {
  font-size: 13px;
  opacity: 0.95;
  line-height: 1.3;
  color: white;
}

/* Takeaway Banner Styles */
.takeaway-banner {
  background: #fefce8;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #fbbf24;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.takeaway-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.takeaway-content {
  font-size: 15px;
  color: #4b5563;
  line-height: 1.5;
}

.takeaway-content strong {
  color: #1f2937;
  font-weight: 700;
}

/* Maps Comparison Styles */
#maps-comparison {
  background: linear-gradient(135deg, rgba(110, 141, 190, 0.3) 0%, rgba(232, 234, 238, 0.3) 100%);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 3rem auto 2rem auto;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  text-align: center;
  width: 100vw;
  max-width: 1400px;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

.two-maps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .two-maps-grid {
    grid-template-columns: 1fr;
  }
}

.map-box {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.map-box h3 {
  margin: 0 0 0.25rem 0;
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
  text-align: center;
}

.map-subtitle {
  margin: 0 0 0.5rem 0;
  font-size: 11px;
  color: #6b7280;
  text-align: center;
  font-style: italic;
}

.map-stats {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 12px;
  flex-wrap: wrap;
}

.stat-item {
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  background: #f9fafb;
}

.stat-red {
  color: #dc2626;
}

.stat-blue {
  color: #2563eb;
}

.stat-purple {
  color: #9333ea;
}

.district-path {
  transition: all 0.2s ease;
}

/* Stats Cards Styles */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

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

/* Section Styles */
.texas-section {
  margin: 3rem auto;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-title {
  margin: 0 0 1.5rem 0;
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e5e7eb;
}

/* Districts Grid Styles */
.districts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (max-width: 1200px) {
  .districts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

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

.district-card:hover > div {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

/* Specific candidate image positioning */
img[alt="WARE, TJ"] {
  object-position: center 25% !important;
}

/* Senate Section Styles - Compact Card Layout */
.senate-section {
  width: 100%;
  margin: 2rem auto 3rem auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.senate-header {
  width: 100%;
  text-align: center;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.senate-badge {
  display: block;
  width: fit-content;
  margin: 0 auto 0.75rem auto;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.senate-cards-container {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.senate-cards-container:hover {
  transform: translateY(-2px);
}

.senate-cards-container:hover .senate-card {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.senate-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .senate-cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .senate-title {
    font-size: 24px;
  }

  .senate-subtitle {
    font-size: 14px;
  }
}

.senate-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.senate-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
  border-color: #d1d5db;
}

.senate-card.democrat-card {
  border-left: 6px solid #3b82f6;
}

.senate-card.republican-card {
  border-left: 6px solid #ef4444;
}

.senate-card.runoff-card {
  background: linear-gradient(to bottom, #fef3c7 0%, white 15%);
}

.senate-card-inner {
  padding: 1.25rem;
}

.senate-card-header-row {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.senate-card-party-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
}

.senate-card-party-label.democrat {
  background: #dbeafe;
  color: #1e40af;
}

.senate-card-party-label.republican {
  background: #fee2e2;
  color: #991b1b;
}

.runoff-date {
  font-size: 11px;
  font-weight: 700;
  color: #f59e0b;
  background: #fef3c7;
  padding: 4px 10px;
  border-radius: 12px;
  letter-spacing: 0.3px;
}

.senate-candidate-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  transition: background 0.2s;
  text-decoration: none;
  color: inherit;
}

.senate-candidate-row:hover {
  background: #f9fafb;
}

.senate-candidate-row.leader {
  background: #fffbeb;
}

.senate-candidate-row.leader:hover {
  background: #fef3c7;
}

.senate-candidate-row + .senate-candidate-row {
  margin-top: 0.5rem;
  border-top: 1px solid #f3f4f6;
  padding-top: 1rem;
}

.senate-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  flex-shrink: 0;
  border: 2px solid #f3f4f6;
}

.senate-photo-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: white;
  border: 2px solid #f3f4f6;
}

.senate-photo-placeholder.democrat {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

.senate-photo-placeholder.republican {
  background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
}

.senate-candidate-details {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.senate-name-with-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.senate-name {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.25rem 0;
  line-height: 1.2;
}

.incumbent-mini,
.leader-mini {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.incumbent-mini {
  background: #fef3c7;
  color: #92400e;
}

.leader-mini {
  background: #dbeafe;
  color: #1e40af;
}

.senate-votes {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.votes-number {
  font-size: 15px;
  font-weight: 700;
  color: #374151;
}

.votes-label {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 500;
}

@media (max-width: 768px) {
  .senate-card-inner {
    padding: 1rem;
  }

  .senate-name {
    font-size: 14px;
  }

  .votes-number {
    font-size: 13px;
  }

  .votes-label {
    font-size: 10px;
  }
}

/* ============================================================
   Kept from the retired About-page styles (about.md now carries
   its own page-scoped wmr- styles) — these two rules are generic
   and other pages rely on them.
   ============================================================ */
main > :first-child {
  margin-top: 0 !important;
}

@media (max-width: 640px) {
  .section-title {
    font-size: 28px;
  }
}
