/* ============================================================================
   CareTransparency — Style System
   Clean, decision-focused design for healthcare data
   ============================================================================ */

/* ----------------------------------------------------------------------------
   1. DESIGN TOKENS
   ---------------------------------------------------------------------------- */

:root {
  /* Colors — Decision signals */
  --good: #10b981;
  --good-bg: #d1fae5;
  --good-border: #6ee7b7;
  
  --neutral: #6b7280;
  --neutral-bg: #f3f4f6;
  --neutral-border: #d1d5db;
  
  --caution: #f59e0b;
  --caution-bg: #fef3c7;
  --caution-border: #fcd34d;
  
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --danger-border: #fca5a5;
  
  /* Colors — UI */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-bg: #dbeafe;
  
  --text: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  
  --bg: #ffffff;
  --bg-alt: #f9fafb;
  --bg-section: #f3f4f6;
  
  --border: #e5e7eb;
  --border-dark: #d1d5db;
  
  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Typography */
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
  
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  
  /* Layout */
  --container-max: 1200px;
  --content-max: 42rem;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ----------------------------------------------------------------------------
   2. RESET & BASE
   ---------------------------------------------------------------------------- */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-base);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* ----------------------------------------------------------------------------
   3. TYPOGRAPHY
   ---------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  color: var(--text);
}

h1 { font-size: var(--text-3xl); margin-bottom: var(--space-sm); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { margin-bottom: var(--space-md); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover { color: var(--primary-hover); }
a:focus { outline: 2px solid var(--primary); outline-offset: 2px; }

strong { font-weight: 600; }

.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.small { font-size: var(--text-sm); }
.text-center { text-align: center; }

/* ----------------------------------------------------------------------------
   4. LAYOUT
   ---------------------------------------------------------------------------- */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.wrap {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

.section {
  margin-bottom: var(--space-2xl);
}

.section:last-child {
  margin-bottom: 0;
}

/* Grid system */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

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

/* ----------------------------------------------------------------------------
   5. HEADER & NAVIGATION (NEW WARM GRAY DESIGN)
   ---------------------------------------------------------------------------- */

.site-header {
  background: linear-gradient(to bottom, #f8f9fa 0%, #f1f3f5 100%);
  border-bottom: 1px solid #dee2e6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 16px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.header-brand {
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.brand-link:hover {
  opacity: 0.85;
}

.brand-logo {
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-name {
  font-size: 22px;
  font-weight: 700;
  color: #212529;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.brand-tagline {
  font-size: 13px;
  color: #6c757d;
  line-height: 1.2;
}

#primary-nav {
  display: flex;
  gap: 6px;
}

#primary-nav a {
  padding: 10px 18px;
  color: #495057;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
  background: transparent;
}

#primary-nav a:hover {
  background: rgba(255, 255, 255, 0.8);
  color: #212529;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.menu-button {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #495057;
  flex-direction: column;
  gap: 4px;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.menu-button span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.menu-button:hover {
  color: #212529;
}

@media (max-width: 768px) {
  .site-header {
    position: relative;
  }
  
  .site-header .container {
    padding: 12px 16px;
    flex-wrap: nowrap;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
  }

  .brand-name {
    font-size: 19px;
  }

  .brand-tagline {
    font-size: 12px;
  }

  .menu-button {
    display: flex;
  }

  #primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  #primary-nav.open {
    max-height: 300px;
  }

  #primary-nav a {
    padding: 16px 20px;
    border-radius: 0;
    border-bottom: 1px solid #e9ecef;
    background: transparent;
  }

  #primary-nav a:last-child {
    border-bottom: none;
  }
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--primary);
}

/* ----------------------------------------------------------------------------
   6. CARDS & CONTAINERS
   ---------------------------------------------------------------------------- */

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.card:last-child {
  margin-bottom: 0;
}

.card h3 {
  margin-bottom: var(--space-md);
}

/* ----------------------------------------------------------------------------
   7. DECISION HERO (nursing home / hospital pages)
   ---------------------------------------------------------------------------- */

.decision-hero {
  background: linear-gradient(135deg, var(--primary-bg) 0%, var(--bg) 100%);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  text-align: center;
}

.decision-hero__question {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-lg);
}

.decision-hero__score {
  font-size: 4rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.decision-hero__context {
  font-size: var(--text-lg);
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.decision-hero__signals {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  text-align: left;
  max-width: 600px;
  margin: 0 auto;
}

.decision-hero__signal {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: var(--text-base);
}

.decision-hero__signal-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-lg);
}

.decision-hero__signal--good .decision-hero__signal-icon { color: var(--good); }
.decision-hero__signal--caution .decision-hero__signal-icon { color: var(--caution); }

/* ----------------------------------------------------------------------------
   8. METRIC CARDS
   ---------------------------------------------------------------------------- */

.metric-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.metric-card:last-child {
  margin-bottom: 0;
}

.metric-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.metric-card__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.metric-card__value {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-sm);
}

.metric-card__comparison {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 600;
}

.metric-card__comparison--good {
  background: var(--good-bg);
  color: var(--good);
}

.metric-card__comparison--neutral {
  background: var(--neutral-bg);
  color: var(--neutral);
}

.metric-card__comparison--caution {
  background: var(--caution-bg);
  color: var(--caution);
}

.metric-card__detail {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

.metric-card__rank {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  margin-top: var(--space-md);
}

.metric-card__rank strong {
  color: var(--primary);
}

/* ----------------------------------------------------------------------------
   9. NEARBY / ALTERNATIVES LIST
   ---------------------------------------------------------------------------- */

.nearby {
  background: var(--bg);
  border: 2px solid var(--good-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.nearby__title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.nearby__intro {
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.nearby__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nearby__item {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-xs);
}

.nearby__item:last-child {
  border-bottom: none;
}

.nearby__link {
  font-weight: 600;
  color: var(--primary);
}

.nearby__meta {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.nearby__value {
  margin-left: auto;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

/* ----------------------------------------------------------------------------
   10. TABLES
   ---------------------------------------------------------------------------- */

.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-md);
}

.table th,
.table td {
  text-align: left;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.table th {
  font-weight: 600;
  color: var(--text);
  background: var(--bg-alt);
}

.table td {
  color: var(--text);
}

.table tr:last-child td {
  border-bottom: none;
}

/* Responsive tables */
@media (max-width: 640px) {
  .table thead {
    display: none;
  }
  
  .table tr {
    display: block;
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }
  
  .table td {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border);
  }
  
  .table td:last-child {
    border-bottom: none;
  }
  
  .table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
  }
}

/* ----------------------------------------------------------------------------
   11. BADGES & INDICATORS
   ---------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 600;
}

.badge--above {
  background: var(--good-bg);
  color: var(--good);
}

.badge--average {
  background: var(--neutral-bg);
  color: var(--neutral);
}

.badge--below {
  background: var(--caution-bg);
  color: var(--caution);
}

.badge__delta {
  font-size: var(--text-xs);
  opacity: 0.8;
}

/* ----------------------------------------------------------------------------
   12. HELP TOOLTIPS
   ---------------------------------------------------------------------------- */

.help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--neutral-bg);
  color: var(--text-muted);
  border: none;
  cursor: help;
  font-size: var(--text-xs);
  font-weight: 600;
  margin-left: var(--space-xs);
}

.help:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

/* ----------------------------------------------------------------------------
   13. CALLOUTS & ALERTS
   ---------------------------------------------------------------------------- */

.callout {
  padding: var(--space-md);
  border-radius: var(--radius);
  border-left: 4px solid;
  margin-bottom: var(--space-md);
}

.callout--info {
  background: var(--primary-bg);
  border-color: var(--primary);
  color: var(--text);
}

.callout--success {
  background: var(--good-bg);
  border-color: var(--good);
  color: var(--text);
}

.callout--caution {
  background: var(--caution-bg);
  border-color: var(--caution);
  color: var(--text);
}

.callout strong {
  color: inherit;
}

/* ----------------------------------------------------------------------------
   14. LISTS
   ---------------------------------------------------------------------------- */

ul, ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

li {
  margin-bottom: var(--space-sm);
}

li:last-child {
  margin-bottom: 0;
}

/* Clean lists (no bullets) */
.list-clean {
  list-style: none;
  padding: 0;
}

/* ----------------------------------------------------------------------------
   15. FOOTER
   ---------------------------------------------------------------------------- */

.site-footer {
  background: var(--bg-section);
  border-top: 1px solid var(--border);
  padding: var(--space-2xl) 0 var(--space-xl) 0;
  margin-top: var(--space-2xl);
}

.site-footer .container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Mission statement */
.footer-mission {
  margin-bottom: var(--space-xl);
  max-width: 720px;
}

.footer-mission__text {
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.footer-mission__update {
  margin: 0;
}

/* Footer navigation grid */
.footer-nav {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

@media (min-width: 640px) {
  .footer-nav {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
  }
}

.footer-nav > div {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-nav strong {
  display: block;
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: var(--text-xs);
}

.footer-nav a {
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.footer-nav a:hover {
  color: var(--primary);
}

/* Ad policy notice */
.footer-ad-notice {
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  text-align: center;
  margin: 0;
}

/* ----------------------------------------------------------------------------
   16. UTILITIES
   ---------------------------------------------------------------------------- */

.mt-0 { margin-top: 0 !important; }
.mt-sm { margin-top: var(--space-sm) !important; }
.mt-md { margin-top: var(--space-md) !important; }
.mt-lg { margin-top: var(--space-lg) !important; }
.mt-xl { margin-top: var(--space-xl) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-sm { margin-bottom: var(--space-sm) !important; }
.mb-md { margin-bottom: var(--space-md) !important; }
.mb-lg { margin-bottom: var(--space-lg) !important; }
.mb-xl { margin-bottom: var(--space-xl) !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ----------------------------------------------------------------------------
   17. RESPONSIVE
   ---------------------------------------------------------------------------- */

@media (max-width: 640px) {
  :root {
    --text-3xl: 1.5rem;
    --text-2xl: 1.25rem;
  }
  
  h1 { font-size: var(--text-2xl); }
  
  .decision-hero__score {
    font-size: 3rem;
  }
  
  .metric-card__value {
    font-size: var(--text-2xl);
  }
}

/* ----------------------------------------------------------------------------
   18. PRINT
   ---------------------------------------------------------------------------- */

@media print {
  .site-header,
  .breadcrumbs,
  footer,
  .menu-button {
    display: none;
  }
  
  .wrap {
    padding: 0;
  }
  
  a {
    color: var(--text);
    text-decoration: underline;
  }
}

/* ----------------------------------------------------------------------------
   STATE PAGE COMPONENTS
   ---------------------------------------------------------------------------- */

.state-summary {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.state-summary__title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.state-summary__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-lg);
}

.state-summary__stat {
  text-align: center;
}

.state-summary__stat-value {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.state-summary__stat-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.expandable {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  background: var(--bg);
}

.expandable__toggle {
  cursor: pointer;
  list-style: none;
  user-select: none;
  position: relative;
  padding-left: var(--space-lg);
}

.expandable__toggle::-webkit-details-marker {
  display: none;
}

.expandable__toggle::before {
  content: '▶';
  position: absolute;
  left: 0;
  top: 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.expandable[open] .expandable__toggle::before {
  transform: rotate(90deg);
}

.expandable__toggle:hover {
  color: var(--primary);
}

.expandable__toggle:hover::before {
  color: var(--primary);
}

.expandable__content {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.facility-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.facility-list__letter {
  margin-top: var(--space-lg);
  padding: var(--space-sm) 0;
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--text);
  border-bottom: 2px solid var(--primary);
}

.facility-list__item {
  margin: var(--space-sm) 0 var(--space-sm) var(--space-md);
  padding: var(--space-sm) 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-xs);
  border-bottom: 1px solid #f3f4f6;
}

.facility-list__item:last-child {
  border-bottom: none;
}

.facility-list__item a {
  font-weight: 500;
  color: var(--primary);
}

.facility-list__item a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.facility-list__meta {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

@media (max-width: 640px) {
  .state-summary__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .state-summary__stat-value {
    font-size: var(--text-2xl);
  }
  
  .facility-list__item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .facility-list__meta {
    margin-left: 0;
  }
}

/* ----------------------------------------------------------------------------
   HOME PAGE COMPONENTS
   ---------------------------------------------------------------------------- */

.hero {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0f9ff 100%);
  padding: var(--space-2xl) var(--space-lg);
  margin: calc(var(--space-xl) * -1) calc(var(--space-lg) * -1) var(--space-2xl);
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero__content {
  max-width: 800px;
  margin: 0 auto;
}

.hero__headline {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: var(--space-md);
}

.hero__subheadline {
  font-size: var(--text-lg);
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}

.hero__cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.hero__trust-line {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.hero__trust-item {
  white-space: nowrap;
}

.button {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--text-base);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.5;
}

.button--primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.button--primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: white;
}

.button--secondary {
  background: white;
  color: var(--primary);
  border-color: var(--primary);
}

.button--secondary:hover {
  background: var(--primary-bg);
  color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.button--large {
  padding: var(--space-md) var(--space-xl);
  font-size: var(--text-lg);
}

.button:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.path-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all 0.3s ease;
}

.path-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
}

.path-card__icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.path-card__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--text);
}

.path-card__description {
  font-size: var(--text-base);
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

.path-card__features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-lg) 0;
}

.path-card__features li {
  padding: var(--space-sm) 0;
  padding-left: var(--space-lg);
  position: relative;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--text);
}

.path-card__features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--good);
  font-weight: 700;
}

.search-hero {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.search-hero__title {
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.search-hero__subtitle {
  font-size: var(--text-lg);
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

.search-hero__input-wrapper {
  position: relative;
  margin-bottom: var(--space-md);
}

.search-hero__input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--text-lg);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
}

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

.how-it-works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.how-it-works-step {
  text-align: center;
}

.how-it-works-step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: var(--primary);
  color: white;
  font-size: var(--text-2xl);
  font-weight: 700;
  border-radius: 50%;
  margin-bottom: var(--space-md);
}

.how-it-works-step__title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.how-it-works-step__description {
  font-size: var(--text-base);
  color: var(--text-muted);
  line-height: 1.6;
}

.quick-stats {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.quick-stats__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.quick-stats__subtitle {
  font-size: var(--text-lg);
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-xl);
}

.trust-badge {
  text-align: center;
  padding: var(--space-lg);
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.trust-badge__icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.trust-badge__title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text);
}

.trust-badge__description {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-sm);
  list-style: none;
  padding: 0;
  margin: 0;
}

.state-grid__item {
  display: block;
  padding: var(--space-md);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  font-weight: 500;
  color: var(--text);
  transition: all 0.2s ease;
  text-decoration: none;
}

.state-grid__item:hover {
  background: var(--primary-bg);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.reports-section {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.reports-section__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.reports-section__subtitle {
  font-size: var(--text-lg);
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

@media (max-width: 768px) {
  .hero {
    padding: var(--space-xl) var(--space-md);
  }
  
  .hero__cta-group {
    flex-direction: column;
  }
  
  .hero__cta-group .button {
    width: 100%;
  }
  
  .path-card {
    padding: var(--space-lg);
  }
  
  .how-it-works-grid {
    grid-template-columns: 1fr;
  }
  
  .trust-grid {
    grid-template-columns: 1fr;
  }
  
  .state-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 480px) {
  .hero__headline {
    font-size: 1.75rem;
  }
  
  .hero__subheadline {
    font-size: var(--text-base);
  }
  
  .state-grid {
    grid-template-columns: 1fr;
  }
  
  .search-hero__input {
    font-size: var(--text-base);
  }
}

/* ----------------------------------------------------------------------------
   OWNER/REPORT PAGE COMPONENTS
   ---------------------------------------------------------------------------- */

.metric-value {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.download-link {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  background: var(--primary);
  color: white !important;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.download-link:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.report-header {
  margin-bottom: var(--space-xl);
}

.report-header h1 {
  margin-bottom: var(--space-sm);
}

/* ----------------------------------------------------------------------------
   TRUST PAGES (About, Methodology, Privacy, etc.)
   ---------------------------------------------------------------------------- */

.trust-page {
  max-width: 48rem;
  margin: 0 auto;
}

.trust-page h1 {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--border);
}

.trust-page h2 {
  font-size: var(--text-2xl);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  color: var(--text);
}

.trust-page h3 {
  font-size: var(--text-xl);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  color: var(--text);
}

.trust-page p {
  font-size: var(--text-base);
  line-height: 1.7;
  margin-bottom: var(--space-md);
  color: var(--text);
}

.trust-page ul, .trust-page ol {
  margin-bottom: var(--space-lg);
  padding-left: var(--space-xl);
}

.trust-page li {
  margin-bottom: var(--space-sm);
  line-height: 1.7;
}

.trust-page a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: var(--primary-bg);
  text-decoration-thickness: 2px;
  transition: all 0.15s ease;
}

.trust-page a:hover {
  color: var(--primary-hover);
  text-decoration-color: var(--primary);
}

.trust-page .callout {
  background: var(--bg-alt);
  border-left: 4px solid var(--primary);
  padding: var(--space-lg);
  margin: var(--space-xl) 0;
  border-radius: var(--radius);
}

.trust-page .callout h3 {
  margin-top: 0;
  margin-bottom: var(--space-sm);
  font-size: var(--text-lg);
}

.trust-page .callout p:last-child {
  margin-bottom: 0;
}

.trust-page .callout--success {
  background: var(--good-bg);
  border-left-color: var(--good);
}

.trust-page .callout--warning {
  background: var(--caution-bg);
  border-left-color: var(--caution);
}

.trust-page .highlight-box {
  background: var(--primary-bg);
  border: 1px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin: var(--space-xl) 0;
}

.trust-page .highlight-box h3 {
  margin-top: 0;
  color: var(--primary);
}

.trust-page .contact-info {
  background: var(--bg-section);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  margin: var(--space-xl) 0;
  text-align: center;
}

.trust-page .contact-info a {
  font-weight: 600;
  font-size: var(--text-lg);
}

.trust-page .toc {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.trust-page .toc h2 {
  margin-top: 0;
  font-size: var(--text-xl);
}

.trust-page .toc ul {
  margin-bottom: 0;
  padding-left: var(--space-lg);
}

.trust-page .toc li {
  margin-bottom: var(--space-xs);
}

/* ----------------------------------------------------------------------------
   FIX BURGER MENU ON MOBILE DRIFTING INTO GUTTER ON THE RIGHT
   ---------------------------------------------------------------------------- */
/* --- Mobile nav: minimal, robust, no gutter --- */
html, body { overflow-x: hidden; }

.site-header .container { display: flex; align-items: center; position: relative; min-height: 56px; gap: 8px; }
.header-brand { flex: 1 1 auto; min-width: 0; }
.brand-text  { min-width: 0; }

/* Desktop: inline nav */
@media (min-width: 769px) {
  .menu-button { display: none; }
  #primary-nav { display: flex; position: static; height: auto; overflow: visible; box-shadow: none; }
}

/* Mobile: pinned burger + fixed drawer */
@media (max-width: 768px) {
  .brand-tagline { display: none; }               /* avoid crowding */
  .menu-button {
    position: absolute; right: 12px; top: 50%;
    transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 36px; z-index: 1600; flex: 0 0 auto;
  }
  .header-brand { padding-right: 56px; }          /* reserve space for burger */

  :root { --nav-top: 56px; }                      /* JS will set exact height */

  /* Drawer sits below header, always visible when open */
  #primary-nav[aria-label="Primary"] {
    position: fixed; top: var(--nav-top);
    left: 0; right: 0;
    height: 0; overflow: hidden;
    background: #fff; color: #111;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 12px 24px rgba(0,0,0,.12);
    z-index: 1550; transition: height .25s ease;
  }
  #primary-nav[aria-label="Primary"].open {
    height: calc(100vh - var(--nav-top));
  }

  /* Touch-friendly items */
  #primary-nav[aria-label="Primary"] a {
    display: block; padding: 14px 16px; border-top: 1px solid #f1f5f9; text-decoration: none;
  }

  /* Optional: lock background scroll when open (needs tiny JS below) */
  body.nav-open { overflow: hidden; }
}
