/* ============================================================
   InsuranceExit.us — Global Stylesheet
   ============================================================ */

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

/* ---- Design tokens ---- */
:root {
  /* Colors — OKLCH */
  --bg:             oklch(98.5% 0.005 75);
  --bg-subtle:      oklch(95.5% 0.010 75);
  --surface:        oklch(93%   0.012 75);
  --text:           oklch(15%   0.012 50);
  --text-muted:     oklch(50%   0.010 75);
  --text-subtle:    oklch(65%   0.008 75);
  --accent:         oklch(32%   0.080 162);   /* deep forest green */
  --accent-hover:   oklch(25%   0.072 162);
  --accent-faint:   oklch(92%   0.030 162);
  --warm:           oklch(54%   0.140  52);   /* amber — warnings */
  --warm-bg:        oklch(97.5% 0.022  75);
  --border:         oklch(88%   0.008  75);
  --border-strong:  oklch(76%   0.010  75);
  --shadow-sm:      0 1px 3px oklch(0% 0 0 / 0.07), 0 1px 2px oklch(0% 0 0 / 0.04);
  --shadow-md:      0 4px 12px oklch(0% 0 0 / 0.08), 0 2px 4px oklch(0% 0 0 / 0.04);

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Lora', Georgia, serif;
  --font-ui:      'DM Sans', system-ui, -apple-system, sans-serif;

  /* Layout */
  --width-content: 760px;
  --width-wide:    1100px;
}

/* ---- Base ---- */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.85vw, 1.125rem);
  line-height: 1.82;
}

/* ---- Links ---- */
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: oklch(32% 0.080 162 / 0.35);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}
a:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--accent-hover);
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
  text-decoration: none;
}

/* ============================================================
   HEADER & NAV
   ============================================================ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px oklch(0% 0 0 / 0.04);
}

nav {
  max-width: var(--width-wide);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.75rem;
  flex-wrap: wrap;
}

.site-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.015em;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  transition: color 120ms ease;
  padding: 0.5rem 0;
}
.site-name:hover { color: var(--accent-hover); text-decoration: none; }
.site-name:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.125rem;
}

nav ul li a {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.3125rem 0.6875rem;
  border-radius: 4px;
  display: block;
  white-space: nowrap;
  transition: color 120ms ease, background 120ms ease;
}
nav ul li a:hover {
  color: var(--accent);
  background: oklch(32% 0.080 162 / 0.08);
  text-decoration: none;
}
nav ul li a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
main {
  max-width: var(--width-content);
  margin: 2.5rem auto 4rem;
  padding: 0 1.5rem;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.4375rem;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--text-subtle);
  text-decoration: none;
  transition: color 100ms ease;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text); font-weight: 500; }

/* ---- Disclaimer ---- */
.disclaimer {
  background: var(--surface);
  border-left: 3px solid var(--border-strong);
  padding: 0.875rem 1.125rem;
  margin: 1.25rem 0;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-muted);
  border-radius: 0 4px 4px 0;
}
.disclaimer em { font-style: normal; }

/* ============================================================
   ARTICLE TYPOGRAPHY
   ============================================================ */
article h1 {
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 4.5vw, 2.625rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 1.5rem 0 1.25rem;
}

article h1.pillar-heading {
  border-left: 3px solid var(--border-strong);
  padding-left: 1rem;
  margin-top: 0;
}

article h2 {
  font-family: var(--font-display);
  font-size: clamp(1.1875rem, 2.5vw, 1.4375rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.015em;
  margin: 2.75rem 0 0.875rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text);
}

article h3 {
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 1.875rem 0 0.5rem;
  color: var(--text);
}

article p { margin: 1rem 0; }

article ul,
article ol {
  margin: 0.875rem 0 0.875rem 1.875rem;
}
article li { margin: 0.4375rem 0; padding-left: 0.1875rem; }
article strong { font-weight: 600; }

/* ============================================================
   TABLES
   ============================================================ */
article table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 1.875rem 0;
}

article th {
  background: var(--accent);
  color: oklch(97% 0.012 162);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  white-space: nowrap;
}

article td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

article tr:last-child td { border-bottom: none; }
article tbody tr:nth-child(even) td { background: var(--bg-subtle); }
article tbody tr:hover td {
  background: var(--accent-faint);
  transition: background 80ms ease;
}

/* ============================================================
   CALLOUT BOXES
   ============================================================ */
.fast-answer {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 1.125rem 1.375rem;
  margin: 1.875rem 0;
  font-family: var(--font-ui);
}
.fast-answer h2 {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  border: none;
  padding: 0;
  margin: 0 0 0.625rem;
}
.fast-answer p { margin: 0.5rem 0; font-size: 0.9375rem; }
.fast-answer p:first-of-type { margin-top: 0; }

/* Draft banner */
.draft-banner {
  background: oklch(96.5% 0.025 25);
  border-left: 4px solid oklch(55% 0.18 25);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: oklch(33% 0.12 25);
  border-radius: 0 4px 4px 0;
}

/* ============================================================
   ARTICLE FOOTER & SOURCES
   ============================================================ */
.article-footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--border);
}

.sources {
  margin-top: 2.5rem;
  padding-top: 1.375rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-muted);
}
.sources ul { list-style: none; margin-left: 0; }
.sources li { margin: 0.5rem 0; padding-left: 0; }
.sources p { margin: 0.5rem 0; }
.sources em { font-style: italic; }

.last-updated {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 1.375rem 0 0.5rem;
}

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  margin-top: 5rem;
  padding: 2rem 1.5rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ============================================================
   HOME PAGE
   ============================================================ */
.home-hero {
  margin: 3rem 0 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.home-dateline {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.875rem;
}
.home-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1rem;
  border-left: 3px solid var(--border-strong);
  padding-left: 1rem;
}
.home-hero p {
  font-family: var(--font-ui);
  font-size: clamp(1rem, 2vw, 1.1rem);
  color: var(--text-muted);
  max-width: 580px;
  line-height: 1.7;
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
  margin: 2rem auto;
  max-width: var(--width-content);
  padding: 0 1.5rem;
}

.pillar-card {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 1.625rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  background: var(--bg);
  transition: border-color 140ms ease;
}
.pillar-card:hover {
  border-color: var(--accent);
  text-decoration: none;
  color: inherit;
}
.pillar-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.pillar-card-icon {
  color: var(--accent);
  opacity: 0.8;
  flex-shrink: 0;
  display: flex;
}
.pillar-card h2 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.375rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.pillar-card p {
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}
.pillar-card-text { display: flex; flex-direction: column; }

/* ============================================================
   SEVERITY BAND — state pages signature element
   ============================================================ */
.severity-band {
  border-left: 4px solid var(--severity-color, var(--border-strong));
  padding-left: 1.25rem;
  margin-left: -1.25rem;
}

.severity-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.625rem;
  border-radius: 2px;
  margin-bottom: 1rem;
}
.severity-badge--critical {
  background: oklch(96% 0.025 25);
  color: oklch(40% 0.18 25);
  border: 1px solid oklch(84% 0.06 25);
  --severity-dot-color: oklch(50% 0.18 25);
  --severity-color: oklch(50% 0.18 25);
}
.severity-badge--high {
  background: oklch(96.5% 0.028 52);
  color: oklch(40% 0.16 52);
  border: 1px solid oklch(84% 0.07 55);
  --severity-dot-color: oklch(55% 0.18 52);
  --severity-color: oklch(55% 0.18 52);
}
.severity-badge--elevated {
  background: oklch(97% 0.020 70);
  color: oklch(38% 0.12 65);
  border: 1px solid oklch(86% 0.05 68);
  --severity-dot-color: oklch(56% 0.14 68);
  --severity-color: oklch(56% 0.14 68);
}
.severity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--severity-dot-color);
  flex-shrink: 0;
}

/* ============================================================
   PILLAR / INDEX PAGE LISTS
   ============================================================ */
.state-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.state-list li {
  padding: 0.9375rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
  line-height: 1.55;
}
.state-list li:first-child { border-top: 1px solid var(--border); }
.state-list a {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1rem;
  color: var(--accent);
  text-decoration: none;
}
.state-list a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ============================================================
   GLOSSARY
   ============================================================ */
.glossary-letter-nav {
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 1.5rem 0 2.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-subtle);
  border-radius: 4px;
  border: 1px solid var(--border);
}
.glossary-letter-nav a {
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 0.25rem 0.5625rem;
  border-radius: 3px;
  transition: background 100ms ease, color 100ms ease;
}
.glossary-letter-nav a:hover {
  background: var(--accent-faint);
  color: var(--accent-hover);
  text-decoration: none;
}

.glossary-section { margin-top: 1rem; }

.glossary-letter-heading {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 2px solid var(--accent-faint);
  border-top: none;
  padding: 0 0 0.3125rem;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.02em;
}

.glossary dl { margin: 0; }

.glossary dt {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-top: 1.375rem;
}

.glossary dd {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
  font-size: 0.9375rem;
  line-height: 1.75;
  margin-top: 0.3125rem;
  color: var(--text);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  nav {
    padding: 0.5rem 1rem;
    min-height: auto;
    gap: 0.25rem;
  }
  .site-name {
    font-size: 1.125rem;
    padding: 0.25rem 0;
  }
  nav ul { gap: 0; }
  nav ul li a {
    font-size: 0.8125rem;
    padding: 0.25rem 0.4375rem;
  }
  main {
    margin: 1.5rem auto 3rem;
    padding: 0 1rem;
  }
  article th,
  article td {
    padding: 0.625rem 0.75rem;
  }
  article th { font-size: 0.75rem; }
  article table { font-size: 0.875rem; }
}
