/* ============================================================
   Elections Site — Common Styles
   ============================================================ */

/* CSS Custom Properties */
:root {
  --ms-navy: #043858;
  --ms-gold: #d0ac60;
  --ms-pink: #e50963;
  --ms-dem-blue: #6cb3d2;
  --ms-rep-red: #e50963;
  --ms-purple: #8b567f;
  --ms-divided: #8b567f;
  --ms-tossup: #978f84;
  --ms-other: #978f84;
  --ms-vacant: #d9d9d9;
  --ms-bg: #ffffff;
  --ms-text: #043858;
  --ms-text-light: #666;
  --ms-border: #ddd;
  --ms-card-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --ms-radius: 6px;
}

/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Work Sans', sans-serif;
  background: var(--ms-bg);
  color: var(--ms-text);
  line-height: 1.5;
}

/* Focus styles for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--ms-navy);
  outline-offset: 2px;
}
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
details summary:focus-visible {
  outline: 2px solid var(--ms-navy);
  outline-offset: 2px;
}

/* Skip-to-content link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--ms-navy);
  color: #fff;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  z-index: 10000;
  text-decoration: none;
  border-radius: 0 0 6px 0;
}
.skip-link:focus {
  top: 0;
}

/* Typography */
.heading-xl {
  font-family: 'Work Sans', sans-serif;
  font-weight: 800;
  font-size: 38px;
  color: var(--ms-navy);
  line-height: 1.1;
}
.heading-lg {
  font-family: 'Work Sans', sans-serif;
  font-weight: 800;
  font-size: 28px;
  color: var(--ms-navy);
  line-height: 1.2;
}
.heading-md {
  font-family: 'Work Sans', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--ms-navy);
  line-height: 1.3;
}
.heading-sm {
  font-family: 'Work Sans', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--ms-navy);
  line-height: 1.4;
}
.body-text {
  font-family: 'Merriweather', serif;
  font-weight: 300;
  font-size: 14px;
  color: var(--ms-text-light);
  line-height: 1.6;
}
.separator { color: #9bb5c4; font-weight: 400; margin: 0 6px; }
.subtitle {
  font-size: 15px;
  font-weight: 400;
  color: var(--ms-text-light);
  margin-top: 4px;
}

/* Layout */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 40px 60px;
}
.section {
  margin-bottom: 48px;
}
.section-title {
  font-family: 'Work Sans', sans-serif;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ms-text-light);
  margin-bottom: 16px;
  border-bottom: 2px solid var(--ms-navy);
  padding-bottom: 6px;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ms-navy);
}
.section-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ms-navy);
  margin: 0;
}
.section-header .section-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--ms-navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* Party Badges */
.party-badge {
  display: inline-block;
  font-weight: 700;
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 3px;
  color: white;
}
.party-d { background: var(--ms-dem-blue); }
.party-r { background: var(--ms-rep-red); }
.party-i { background: var(--ms-purple); }
.party-g { background: #2e8b57; }
.party-np { background: #f5e6a3; color: #5a4e1a; }
.party-text-d { color: var(--ms-dem-blue); font-weight: 600; }
.party-text-r { color: var(--ms-rep-red); font-weight: 600; }

/* Cards */
.card {
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  padding: 20px;
  box-shadow: var(--ms-card-shadow);
  background: white;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* Forecast Tags */
.forecast-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 3px; }
.forecast-tossup { background: #fff3cd; color: #856404; }
.forecast-lean-d { background: #d1ecf1; color: #0c5460; }
.forecast-lean-r { background: #f8d7da; color: #721c24; }
.forecast-likely-d { background: #a8d8ea; color: #043858; }
.forecast-likely-r { background: #f5b7b1; color: #78281f; }
.forecast-solid-d { background: var(--ms-dem-blue); color: white; }
.forecast-solid-r { background: var(--ms-rep-red); color: white; }

/* Election Race Cards */
.election-card { border-left: 4px solid var(--ms-gold); }
.election-card .ec-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 6px; }
.election-card .ec-title { font-family: 'Work Sans', sans-serif; font-weight: 700; font-size: 15px; margin: 0; }
.election-card .ec-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.election-card .ec-context { font-size: 12px; color: #666; margin-top: 6px; font-family: 'Work Sans', sans-serif; }
.election-card .ec-candidates { list-style: none; padding: 0; margin: 10px 0 0; }
.election-card .ec-candidates li { padding: 3px 0; font-size: 14px; display: flex; align-items: center; gap: 6px; font-family: 'Work Sans', sans-serif; }
.election-card .ec-candidates .incumbent-marker { font-size: 11px; font-style: italic; color: #999; }
.election-card .ec-note { font-size: 12px; font-style: italic; color: #666; margin-top: 8px; border-top: 1px solid #f0f0f0; padding-top: 6px; }
.ec-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 10px; }
.ec-tag-open { background: #fff3e0; color: #e65100; }
.ec-tag-unopposed { background: #eee; color: #666; }
.ec-tag-featured { background: #e8f5e9; color: #2e7d32; }
.ec-tag-matchup { background: #ede7f6; color: #4527a0; cursor: help; position: relative; }
.ec-tag-matchup::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ms-navy);
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  width: 260px;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 200;
}
.ec-tag-matchup:hover::after { opacity: 1; }

/* Stat Cards */
.stat-card {
  text-align: center;
  padding: 24px 16px;
}
.stat-number {
  font-family: 'Work Sans', sans-serif;
  font-weight: 800;
  font-size: 42px;
  color: var(--ms-navy);
  line-height: 1;
}
.stat-label {
  font-family: 'Work Sans', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--ms-text-light);
  margin-top: 6px;
}

/* Navigation Cards */
.nav-card {
  display: block;
  padding: 20px;
  text-decoration: none;
  color: var(--ms-text);
  transition: transform 0.15s, box-shadow 0.15s;
}
.nav-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.nav-card-title {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 4px;
}
.nav-card-desc {
  font-size: 13px;
  color: var(--ms-text-light);
}

/* Data Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ms-text-light);
  padding: 8px 12px;
  border-bottom: 2px solid var(--ms-navy);
}
.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
}
.data-table tr:hover td {
  background: #f8f9fa;
}
.data-table .party-col {
  width: 40px;
  text-align: center;
}

/* Tooltip */
.tooltip {
  position: fixed;
  background: var(--ms-navy);
  color: white;
  padding: 12px 16px;
  border-radius: var(--ms-radius);
  font-family: 'Work Sans', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 1000;
  max-width: 300px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.tooltip.visible { opacity: 1; }
.tooltip .tt-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.tt-party-d { color: #6cb3d2; }
.tt-party-r { color: #EA9999; }

/* Accordion (details/summary) */
details {
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  margin-bottom: 8px;
}
details summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: '\25B8';
  font-size: 12px;
  transition: transform 0.15s;
}
details[open] summary::before { transform: rotate(90deg); }
details .details-content {
  padding: 0 16px 16px;
}

/* Legacy Header (kept for pages not yet migrated) */
.site-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}
.site-header img {
  width: 40px;
  height: auto;
}
.site-header .site-title {
  font-weight: 800;
  font-size: 20px;
  color: var(--ms-navy);
  text-decoration: none;
}
.breadcrumb {
  font-size: 14px;
  color: var(--ms-text-light);
  margin-bottom: 8px;
}
.breadcrumb a {
  color: var(--ms-navy);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }

/* Legacy Footer (kept for pages not yet migrated) */
.site-footer {
  border-top: 1px solid var(--ms-border);
  padding-top: 24px;
  margin-top: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-footer img { width: 32px; height: auto; }
.site-footer .footer-text {
  font-size: 13px;
  color: var(--ms-text-light);
}

/* ============================================================
   Global Navigation System
   ============================================================ */

/* Corporate Utility Bar */
.utility-bar {
  background: var(--ms-navy);
  color: white;
  font-size: 12px;
  line-height: 1;
}
.utility-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.utility-brand {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.utility-brand:hover { color: white; }
.utility-links {
  display: flex;
  gap: 16px;
}
.utility-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color 0.15s;
}
.utility-links a:hover { color: white; }

/* Main Elections Nav */
.elections-nav {
  background: white;
  border-bottom: 2px solid var(--ms-navy);
  position: sticky;
  top: 0;
  z-index: 900;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 56px;
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ms-navy);
  font-weight: 800;
  font-size: 18px;
  white-space: nowrap;
  margin-right: 24px;
  flex-shrink: 0;
}
.nav-brand img {
  width: 32px;
  height: auto;
}

/* Nav Items */
.nav-item {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ms-text-light);
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.nav-item:hover {
  color: var(--ms-navy);
  background: #f0f4f7;
}
.nav-item.active {
  color: var(--ms-navy);
  background: #e8eef3;
}
.nav-caret {
  font-size: 10px;
  margin-left: 3px;
  opacity: 0.6;
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  border: none;
  background: none;
  cursor: pointer;
  margin-left: auto;
}
.nav-hamburger span {
  display: block;
  height: 2px;
  background: var(--ms-navy);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Dropdowns */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 200px;
  padding: 6px 0;
  z-index: 950;
}
.nav-dropdown:hover > .nav-dropdown-menu,
.nav-dropdown.open > .nav-dropdown-menu {
  display: block;
}
.nav-dropdown:hover > .nav-state-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 8px;
  min-width: 280px;
}
.nav-dropdown-menu a {
  display: block;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ms-text);
  text-decoration: none;
  transition: background 0.1s;
}
.nav-dropdown-menu a:hover { background: #f0f4f7; }
.nav-dropdown-menu a.active { color: var(--ms-navy); font-weight: 700; }

/* State Picker Grid */
.nav-dropdown.open > .nav-state-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 8px;
  min-width: 280px;
}
.nav-state-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ms-navy);
  text-decoration: none;
  border-radius: 3px;
  transition: background 0.1s;
}
.nav-state-link:hover { background: #e8eef3; }

/* Topic Subnav (three-tab: Overview / 2026 / Trends) */
.topic-subnav {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.topic-subnav a {
  display: inline-block;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ms-text-light);
  text-decoration: none;
  border: 1px solid var(--ms-border);
  border-radius: 20px;
  transition: all 0.15s;
}
.topic-subnav a:hover {
  border-color: var(--ms-navy);
  color: var(--ms-navy);
}
.topic-subnav a.active {
  background: var(--ms-navy);
  border-color: var(--ms-navy);
  color: white;
}

/* Global Footer */
.global-footer {
  border-top: 2px solid var(--ms-navy);
  margin-top: 48px;
  padding: 32px 0 24px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.footer-brand img { width: 36px; height: auto; }
.footer-title {
  font-weight: 800;
  font-size: 16px;
  color: var(--ms-navy);
}
.footer-subtitle {
  font-size: 12px;
  color: var(--ms-text-light);
}
.footer-links {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
}
.footer-links a {
  font-size: 13px;
  font-weight: 600;
  color: var(--ms-navy);
  text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; }
.footer-attribution {
  font-size: 12px;
  color: var(--ms-text-light);
  margin-bottom: 8px;
}
.footer-cta {
  font-size: 13px;
  color: var(--ms-text-light);
}
.footer-cta a {
  color: var(--ms-navy);
  font-weight: 600;
  text-decoration: none;
}
.footer-cta a:hover { text-decoration: underline; }
.footer-feedback {
  font-size: 12px;
  color: var(--ms-text-light);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--ms-border);
}
.footer-feedback a {
  color: var(--ms-navy);
  font-weight: 600;
  text-decoration: none;
}
.footer-feedback a:hover { text-decoration: underline; }

/* Map download button — right-aligned below the map */
.map-download-btn {
  display: block;
  width: fit-content;
  margin: 10px 0 0 auto;
  padding: 7px 16px;
  background: #ffffff;
  border: 1.5px solid var(--ms-navy);
  border-radius: 4px;
  color: var(--ms-navy);
  font-family: 'Work Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  transition: background 0.15s, color 0.15s;
}
.map-download-btn:hover {
  background: var(--ms-navy);
  color: #ffffff;
}
body.embed .map-download-btn { display: none; }

/* Per-page feedback bar */
.feedback-bar {
  text-align: right;
  font-size: 12px;
  color: var(--ms-text-light);
  padding: 10px 0 4px;
  border-top: 1px solid var(--ms-border);
  margin-top: 32px;
}
.feedback-bar a {
  color: var(--ms-navy);
  font-weight: 600;
  text-decoration: none;
}
.feedback-bar a:hover { text-decoration: underline; }

/* ============================================================
   MapRenderer Component
   ============================================================ */
.map-renderer {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}
.map-renderer-title {
  font-family: 'Work Sans', sans-serif;
  font-weight: 800;
  font-size: 24px;
  color: var(--ms-navy);
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.1;
}
.map-renderer-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin-top: 16px;
  margin-bottom: 0;
  justify-content: center;
}
.map-renderer-legend .legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.map-renderer-legend .legend-label {
  font-family: 'Work Sans', sans-serif;
  font-weight: 600;
  font-size: 17px;
  color: var(--ms-navy);
  white-space: nowrap;
}
.map-renderer-legend .legend-swatch {
  width: 26px;
  height: 26px;
  border-radius: 2px;
  flex-shrink: 0;
}
.map-renderer-svg {
  width: 100%;
  margin-top: -52px;
}
.map-renderer .us-map .state-group:hover .state-fill path {
  filter: brightness(0.85);
}
.map-renderer .us-map .state-label {
  font-family: 'Work Sans', sans-serif;
  font-weight: 800;
  font-size: 28px;
  fill: white;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}
.map-renderer-source {
  text-align: center;
  font-family: 'Work Sans', sans-serif;
  font-size: 13px;
  color: var(--ms-text-light);
  margin-top: 8px;
}

/* Case Study Cards (101 pages) */
.case-study {
  background: white;
  border: 1px solid var(--ms-border);
  border-top: 3px solid var(--ms-navy);
  border-radius: 0 0 var(--ms-radius) var(--ms-radius);
  padding: 24px 28px 20px;
  margin: 32px 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
.case-study-label {
  font-family: 'Work Sans', sans-serif;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ms-gold);
  margin-bottom: 6px;
}
.case-study-title {
  font-family: 'Work Sans', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--ms-navy);
  margin-bottom: 12px;
}
.case-study h3 {
  margin-top: 0;
  margin-bottom: 14px;
}
.case-study p:last-child { margin-bottom: 0; }

/* Chart/card header titles (used inside .card wrappers for charts) */
.chart-title {
  font-family: 'Work Sans', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--ms-navy);
  margin: 0 0 4px;
  line-height: 1.3;
}
.chart-subtitle {
  font-family: 'Work Sans', sans-serif;
  font-weight: 400;
  font-size: 13px;
  color: var(--ms-text-light);
  margin: 0 0 16px;
  line-height: 1.5;
}

/* Office Overview Callout */
.office-overview {
  background: #f0f5f8;
  border-left: 4px solid var(--ms-navy);
  padding: 20px 24px;
  border-radius: 0 var(--ms-radius) var(--ms-radius) 0;
  margin: 0 0 32px;
}
.office-overview-title {
  font-family: 'Work Sans', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--ms-navy);
  margin-bottom: 10px;
}
.office-overview ul {
  margin: 0;
  padding-left: 20px;
}
.office-overview li {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ms-text);
  margin-bottom: 6px;
}
.office-overview li:last-child { margin-bottom: 0; }
.office-overview-updated {
  font-size: 12px;
  font-style: italic;
  color: var(--ms-text-light);
  margin-top: 10px;
}

/* Inline tags */
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
  background: #f0f0f0;
  color: var(--ms-text-light);
}
.tag-tossup { background: #d0ac60; color: white; }
.tag-lean-d { background: #6CB3D2; color: white; }
.tag-lean-r { background: #EA9999; color: white; }
.tag-likely-d { background: #498AA9; color: white; }
.tag-likely-r { background: #E86987; color: white; }
.tag-solid-d { background: #043858; color: white; }
.tag-solid-r { background: #e50963; color: white; }

/* Utility */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--ms-text-light); }
.text-sm { font-size: 13px; }

/* Reporting percentage (election night) */
.reporting-pct {
  display: block;
  font-size: 11px;
  color: var(--ms-text-light);
  font-style: italic;
}

/* Two-column layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

/* Responsive */
@media (max-width: 768px) {
  .page-container { padding: 20px 16px 40px; }
  .heading-xl { font-size: 28px; }
  .heading-lg { font-size: 22px; }
  .two-col { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .stat-number { font-size: 32px; }
  .site-header { flex-wrap: wrap; }

  /* Nav responsive */
  .utility-inner { padding: 6px 16px; }
  .utility-links { gap: 12px; }
  .nav-inner { padding: 0 16px; }
  .nav-hamburger { display: flex; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 2px solid var(--ms-navy);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    padding: 8px 0;
    flex-direction: column;
  }
  .nav-menu.open { display: flex; }
  .nav-item { padding: 10px 24px; justify-content: flex-start; }
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 24px;
  }
  .nav-state-grid {
    min-width: auto;
    grid-template-columns: repeat(5, 1fr);
  }
  .footer-inner { padding: 0 16px; }
  .footer-links { flex-wrap: wrap; gap: 12px; }
}

@media (max-width: 480px) {
  .utility-links a:nth-child(n+3) { display: none; }
  .nav-brand span { font-size: 15px; }
}

/* ============================================================
   101 PAGES — Shared article/content styles
   ============================================================ */

/* Article body typography */
.article-body p {
  font-family: 'Merriweather', serif;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ms-text);
  margin-bottom: 20px;
}
.article-body strong, .article-body b {
  font-weight: 900;
}
.article-body h2 {
  font-family: 'Work Sans', sans-serif;
  font-weight: 800;
  font-size: 26px;
  color: var(--ms-navy);
  margin-top: 48px;
  margin-bottom: 16px;
  line-height: 1.2;
}
.article-body h3 {
  font-family: 'Work Sans', sans-serif;
  font-weight: 700;
  font-size: 19px;
  color: var(--ms-navy);
  margin-top: 32px;
  margin-bottom: 12px;
  line-height: 1.3;
}
.article-body ul, .article-body ol {
  font-family: 'Merriweather', serif;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ms-text);
  margin-bottom: 20px;
  padding-left: 24px;
}
.article-body li { margin-bottom: 8px; }
.article-body a {
  color: var(--ms-dem-blue);
  text-decoration: none;
  font-weight: 400;
}
.article-body a:hover { text-decoration: underline; }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-family: 'Work Sans', sans-serif;
  font-size: 14px;
}
.article-body th {
  background: var(--ms-navy);
  color: white;
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
}
.article-body td {
  padding: 8px 14px;
  border-bottom: 1px solid #eee;
}
.article-body tr:hover td { background: #f8f9fa; }

/* Lead paragraph */
.lead {
  font-size: 17px !important;
  font-weight: 400 !important;
  color: var(--ms-text) !important;
  line-height: 1.7 !important;
  margin-bottom: 32px !important;
}

/* Topic subnav */
.subnav {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.subnav a {
  display: inline-block;
  padding: 8px 18px;
  border: 2px solid var(--ms-border);
  border-radius: var(--ms-radius);
  font-family: 'Work Sans', sans-serif;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  color: var(--ms-text-light);
  transition: all 0.15s;
}
.subnav a:hover { border-color: var(--ms-navy); color: var(--ms-navy); }
.subnav a.active { background: var(--ms-navy); border-color: var(--ms-navy); color: white; }

/* Stats grid (unified across all 101 pages) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}

/* Table of contents (unified across all 101 pages) */
.toc {
  background: #f8f9fa;
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius);
  padding: 20px 24px;
  margin: 24px 0 40px;
}
.toc-title {
  font-family: 'Work Sans', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--ms-navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.toc ol {
  font-family: 'Work Sans', sans-serif;
  font-size: 14px;
  padding-left: 20px;
  margin: 0;
}
.toc li { margin-bottom: 6px; line-height: 1.4; }
.toc a { color: var(--ms-dem-blue); text-decoration: none; font-weight: 600; }
.toc a:hover { text-decoration: underline; }

/* Callout box */
.callout {
  background: #f0f5f8;
  border-left: 4px solid var(--ms-navy);
  padding: 20px 24px;
  border-radius: 0 var(--ms-radius) var(--ms-radius) 0;
  margin: 28px 0;
}
.callout p {
  margin-bottom: 8px;
  font-size: 15px !important;
  font-weight: 400 !important;
}
.callout strong, .callout b {
  font-weight: 900 !important;
}
.callout p:last-child { margin-bottom: 0; }

/* Pullquote */
.pullquote {
  border-left: 4px solid var(--ms-gold);
  padding: 16px 24px;
  margin: 32px 0;
  background: #faf8f4;
  border-radius: 0 var(--ms-radius) var(--ms-radius) 0;
}
.pullquote p {
  font-style: italic !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.7 !important;
  margin-bottom: 8px !important;
}
.pullquote .attribution {
  font-family: 'Work Sans', sans-serif !important;
  font-style: normal !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  color: var(--ms-text-light) !important;
  margin-bottom: 0 !important;
}

/* Selection table */
.selection-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-family: 'Work Sans', sans-serif;
  font-size: 14px;
}
.selection-table th {
  background: var(--ms-navy);
  color: white;
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
}
.selection-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--ms-border);
  color: var(--ms-text);
}
.selection-table tr:nth-child(even) td { background: #f8f9fa; }
.selection-table .state-list { font-size: 13px; line-height: 1.6; }

/* Image placeholder */
.img-placeholder {
  background: #f4f6f8;
  border: 2px dashed var(--ms-border);
  border-radius: var(--ms-radius);
  padding: 40px 24px;
  margin: 32px 0;
  text-align: center;
}
.img-placeholder p {
  font-family: 'Work Sans', sans-serif !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  color: var(--ms-text-light) !important;
  margin-bottom: 4px !important;
}
.img-placeholder .img-caption {
  font-weight: 400 !important;
  font-size: 12px !important;
  color: #999 !important;
  margin-bottom: 0 !important;
}

/* Placeholder notice (for incomplete pages) */
.placeholder-notice {
  background: #fff8e1;
  border: 2px dashed #d0ac60;
  border-radius: var(--ms-radius);
  padding: 24px;
  margin: 32px 0;
  text-align: center;
}
.placeholder-notice p {
  font-family: 'Work Sans', sans-serif !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  color: #856404 !important;
  margin-bottom: 8px !important;
}
.placeholder-notice p:last-child { margin-bottom: 0 !important; }

/* MM source line */
.mm-source {
  font-family: 'Work Sans', sans-serif;
  font-size: 12px;
  color: var(--ms-text-light);
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--ms-border);
}
.mm-source a { color: var(--ms-dem-blue); text-decoration: none; }
.mm-source a:hover { text-decoration: underline; }

/* What's Next navigation */
.whats-next {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}
.whats-next a {
  flex: 1;
  display: block;
  padding: 20px 24px;
  border: 2px solid var(--ms-border);
  border-radius: var(--ms-radius);
  text-decoration: none;
  transition: all 0.15s;
}
.whats-next a:hover {
  border-color: var(--ms-navy);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.whats-next .next-label {
  font-family: 'Work Sans', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--ms-navy);
  margin-bottom: 4px;
}
.whats-next .next-desc {
  font-family: 'Work Sans', sans-serif;
  font-weight: 400;
  font-size: 13px;
  color: var(--ms-text-light);
}

/* Inline map components (101 pages) */
.inline-map-section { width: 100%; }
.inline-map-title {
  font-family: 'Work Sans', sans-serif;
  font-weight: 800;
  font-size: 24px;
  color: var(--ms-navy);
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.1;
}
.inline-map-title .separator { color: #9bb5c4; font-weight: 400; margin: 0 6px; }
.inline-tab {
  padding: 8px 16px;
  border: 2px solid var(--ms-border);
  border-radius: var(--ms-radius);
  font-family: 'Work Sans', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  background: white;
  color: var(--ms-text-light);
  transition: all 0.15s;
}
.inline-tab:hover { border-color: var(--ms-navy); color: var(--ms-navy); }
.inline-tab.active { background: var(--ms-navy); border-color: var(--ms-navy); color: white; }
.inline-map-wrapper { display: flex; flex-direction: column; }
.inline-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-bottom: 12px;
  justify-content: center;
}
.inline-map-main { margin-top: -30px; width: 100%; }
.inline-map-main svg { width: 100%; height: auto; display: block; }
.inline-legend-row { display: flex; align-items: center; gap: 8px; }
.inline-legend-swatch { width: 20px; height: 20px; border-radius: 2px; flex-shrink: 0; }
.inline-legend-label {
  font-family: 'Work Sans', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--ms-navy);
  line-height: 1.3;
  white-space: nowrap;
}
.inline-map-source {
  font-family: 'Merriweather', serif;
  font-weight: 300;
  font-size: 12px;
  color: #666;
  margin-top: 8px;
}
.inline-tooltip {
  position: fixed;
  background: #043858;
  color: white;
  padding: 12px 16px;
  border-radius: 6px;
  font-family: 'Work Sans', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 1000;
  max-width: 300px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.inline-tooltip.visible { opacity: 1; }
.inline-tt-state { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.inline-tt-type { font-weight: 400; opacity: 0.9; }

/* 101 pages responsive */
@media (max-width: 768px) {
  .article-body h2 { font-size: 22px; margin-top: 36px; }
  .lead { font-size: 15px !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .whats-next { flex-direction: column; }
  .inline-legend-label { font-size: 12px; }
  .selection-table { font-size: 12px; }
  .selection-table th, .selection-table td { padding: 6px 10px; }
}
