/* ============================================================
   MyHealthPlanUSA — Website Theme
   Brand palette + type system + component library
   ============================================================ */

/* -----------------------------
   0. Self-hosted font faces
   ----------------------------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/inter-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/inter-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/inter-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/inter-800.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/fraunces-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/fraunces-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/fraunces-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/fraunces-700.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-500.woff2') format('woff2');
}

/* -----------------------------
   1. Design Tokens
   ----------------------------- */
:root {
  --brand-green:        #0F6B57;
  --brand-green-700:    #0B533F;
  --brand-green-100:    #DDEFE8;
  --brand-navy:         #1D2E4A;
  --brand-navy-700:     #142036;
  --brand-sky:          #DCEEF7;
  --brand-warm:         #B85F28;
  --brand-warm-100:     #F3DDCC;

  --paper:              #FBFAF6;
  --surface:            #FFFFFF;
  --ink:                #0E1626;
  --ink-2:              #2A3548;
  --mute:               #6B7280;
  --mute-2:             #98A0AB;
  --line:               #E6E2D8;
  --line-2:             #F0EDE3;

  --link:               var(--brand-green);
  --link-hover:         var(--brand-green-700);
  --focus-ring:         color-mix(in oklab, var(--brand-green) 35%, transparent);

  --font-display:       'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:          'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:          'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  --radius-sm:          6px;
  --radius:             10px;
  --radius-lg:          18px;
  --maxw:               1180px;
  --gutter:             clamp(20px, 4vw, 48px);

  --shadow-sm:          0 1px 2px rgba(14, 22, 38, 0.04), 0 1px 1px rgba(14, 22, 38, 0.03);
  --shadow:             0 6px 24px -8px rgba(14, 22, 38, 0.10), 0 2px 6px rgba(14, 22, 38, 0.04);
  --shadow-lg:          0 24px 60px -20px rgba(14, 22, 38, 0.18);
}

/* -----------------------------
   2. Reset + base
   ----------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 3px; }

/* Skip link (a11y) */
.skip-link {
  position: absolute; top: -100px; left: 8px;
  background: var(--brand-navy); color: var(--paper);
  padding: 10px 14px; border-radius: var(--radius-sm);
  z-index: 100;
}
.skip-link:focus { top: 8px; }

/* -----------------------------
   3. Typography
   ----------------------------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(36px, 5vw, 60px); letter-spacing: -0.025em; }
h2 { font-size: clamp(28px, 3.4vw, 40px); }
h3 { font-size: clamp(22px, 2.4vw, 28px); }
h4 { font-size: 20px; }

p { margin: 0 0 1em; text-wrap: pretty; }
small, .small { font-size: 13px; color: var(--mute); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-warm);
  font-weight: 500;
}
.lede { font-size: 19px; color: var(--ink-2); line-height: 1.55; }

/* -----------------------------
   4. Layout
   ----------------------------- */
.container, .site-shell { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.site-shell.narrow { max-width: 760px; }

/* -----------------------------
   5. Header / Nav
   ----------------------------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(8px);
}
.header-inner, .nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding-block: 16px;
}
.brand-lockup, .brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
}
.brand-mark { width: 36px; height: 36px; flex: none; display: block; }
.brand-name {
  font-family: var(--font-body);
  font-weight: 800; font-size: 17px; letter-spacing: -0.01em;
  color: var(--brand-navy); line-height: 1; white-space: nowrap;
}
.brand-name-accent { color: var(--brand-green); margin-left: 4px; }

nav[aria-label="Main navigation"] {
  display: flex; gap: 28px; list-style: none; margin: 0; padding: 0;
}
nav[aria-label="Main navigation"] a {
  color: var(--ink-2); font-weight: 500; font-size: 15px; padding: 6px 2px;
  text-decoration: none;
}
nav[aria-label="Main navigation"] a:hover { color: var(--brand-green); text-decoration: none; }

@media (max-width: 760px) {
  nav[aria-label="Main navigation"] { display: none; }
}

/* -----------------------------
   6. Buttons
   ----------------------------- */
.button, .btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 80ms ease, background 120ms ease, border-color 120ms ease, color 120ms ease;
  text-decoration: none;
  background: var(--brand-green);
  color: var(--paper);
}
.button:hover, .btn:hover {
  text-decoration: none; transform: translateY(-1px);
  background: var(--brand-green-700); color: var(--paper);
}
.button.secondary, .btn--ghost {
  background: transparent; color: var(--ink); border-color: var(--line);
}
.button.secondary:hover, .btn--ghost:hover { border-color: var(--brand-navy); background: transparent; color: var(--ink); }

/* -----------------------------
   7. Hero
   ----------------------------- */
.home-hero, .hero {
  padding-block: clamp(56px, 9vw, 120px);
  background:
    radial-gradient(circle at 88% 8%, var(--brand-sky) 0%, transparent 42%),
    var(--paper);
  border-bottom: 1px solid var(--line);
}
.hero-content {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
@media (max-width: 880px) { .hero-content { grid-template-columns: 1fr; } }
.hero-content h1 { margin-top: 18px; margin-bottom: 18px; }
.hero-content p { font-size: 19px; color: var(--ink-2); line-height: 1.55; max-width: 52ch; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

.hero-lockup {
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  position: relative;
}
.hero-lockup::before {
  content: '';
  position: absolute; top: -1px; left: 24px; right: 24px; height: 3px;
  background: linear-gradient(90deg, var(--brand-green) 0 40%, var(--brand-warm) 40% 60%, var(--brand-navy) 60% 100%);
  border-radius: 0 0 3px 3px;
}
.hero-lockup img { width: 100%; max-width: 360px; height: auto; }

/* -----------------------------
   8. Section wrappers
   ----------------------------- */
.section, .section-tight { padding-block: clamp(56px, 8vw, 96px); }
.section-tight { padding-block: clamp(28px, 4vw, 48px); }
.section-header {
  display: flex; justify-content: space-between; align-items: end; gap: 24px;
  margin-bottom: 36px; flex-wrap: wrap;
}
.section-header h2 { margin: 0; }
.section-header > a { font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }

/* Trust strip */
.trust-strip { background: var(--surface); border-block: 1px solid var(--line); }
.trust-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
}
@media (max-width: 880px) { .trust-grid { grid-template-columns: 1fr; gap: 20px; } }
.trust-grid > div { display: flex; flex-direction: column; gap: 6px; }
.trust-grid strong { color: var(--ink); font-weight: 600; font-size: 15px; }
.trust-grid span { font-size: 14px; color: var(--mute); line-height: 1.5; }

/* -----------------------------
   9. Article cards (grid)
   ----------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
@media (max-width: 880px) { .grid { grid-template-columns: 1fr; } }

.article-card, .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.article-card:hover, .card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand-green-100); }
/* The search/filter script toggles the [hidden] attribute. Because cards use
   display:flex, we must explicitly re-assert display:none or hidden cards stay
   visible. Same for the empty-state message. */
.article-card[hidden], .card[hidden], .empty-state[hidden] { display: none !important; }
.card-link {
  display: flex; flex-direction: column; gap: 10px;
  padding: 22px 22px 12px; text-decoration: none; color: inherit; flex: 1;
}
.card-link:hover { text-decoration: none; }
.article-card .category {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--brand-warm);
}
.article-card h3 {
  font-family: var(--font-display);
  font-weight: 600; font-size: 22px; color: var(--ink);
  letter-spacing: -0.015em; margin: 0; line-height: 1.2;
}
.article-card p {
  color: var(--mute); font-size: 14.5px; line-height: 1.55; margin: 0;
}
.article-card .meta {
  margin-top: auto;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--mute);
  padding-top: 14px;
}
.category-link {
  display: block; padding: 12px 22px 18px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brand-green-700);
  border-top: 1px solid var(--line-2);
}
.category-link:hover { background: var(--brand-green-100); text-decoration: none; }

/* -----------------------------
   10. Category tiles (topic-band)
   ----------------------------- */
.topic-band { background: var(--surface); border-top: 1px solid var(--line); }
.topic-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
@media (max-width: 880px) { .topic-grid { grid-template-columns: repeat(2, 1fr); } }
.topic-grid > a {
  display: block; padding: 24px 22px;
  background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none;
  transition: border-color 120ms ease, transform 120ms ease;
}
.topic-grid > a:hover { border-color: var(--brand-green); transform: translateY(-2px); text-decoration: none; }
.topic-grid > a span {
  display: block; font-family: var(--font-display); font-size: 22px;
  font-weight: 600; margin-bottom: 6px; letter-spacing: -0.01em; color: var(--ink);
}
.topic-grid > a small { color: var(--mute); font-size: 13.5px; }

/* -----------------------------
   11. Article page
   ----------------------------- */
.article-page { padding-block: 0; }
.article-hero {
  padding-block: clamp(40px, 6vw, 72px);
  background:
    radial-gradient(circle at 90% 10%, var(--brand-sky) 0%, transparent 38%),
    var(--paper);
  border-bottom: 1px solid var(--line);
}
.article-hero-inner { max-width: 820px; margin: 0 auto; padding-inline: var(--gutter); }
.article-hero h1 {
  font-size: clamp(32px, 4.2vw, 48px);
  margin-top: 12px; margin-bottom: 18px;
}
.article-hero p { font-size: 18px; color: var(--ink-2); max-width: 60ch; }
.crumb { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.crumb:hover { color: var(--brand-green); text-decoration: none; }
.article-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 18px; margin: 28px 0 0; padding: 22px 0 0;
  border-top: 1px solid var(--line);
}
.article-meta > div { display: flex; flex-direction: column; gap: 2px; }
.article-meta dt { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.article-meta dd { margin: 0; font-size: 14px; color: var(--ink); font-weight: 500; }
.article-meta a { color: var(--brand-green-700); }

.two-column {
  display: grid; grid-template-columns: minmax(0, 1fr) 280px;
  gap: 56px; padding-block: clamp(40px, 6vw, 64px);
}
@media (max-width: 880px) { .two-column { grid-template-columns: 1fr; gap: 36px; } }

.article-content {
  font-size: 17px; line-height: 1.7; color: var(--ink-2);
  max-width: 70ch;
}
.article-content h2 {
  font-size: clamp(24px, 2.6vw, 30px); margin-top: 2em; margin-bottom: 0.6em;
  border-top: 1px solid var(--line); padding-top: 1.5em;
}
.article-content h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 1em; }
.article-content h3 { font-size: 20px; margin-top: 1.6em; margin-bottom: 0.4em; }
.article-content p { margin: 0 0 1.1em; }
.article-content ul, .article-content ol { margin: 0 0 1.2em 1.3em; padding: 0; }
.article-content li { margin-bottom: 0.5em; }
.article-content a {
  color: var(--brand-green); text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--brand-green-100); text-decoration-thickness: 2px;
}
.article-content a:hover { color: var(--brand-green-700); text-decoration-color: var(--brand-green); }
.article-content table {
  width: 100%; border-collapse: collapse; margin: 1.5em 0;
  font-size: 14.5px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.article-content thead { background: var(--brand-green-100); }
.article-content th, .article-content td {
  text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.article-content th { color: var(--brand-green-700); font-weight: 600; font-size: 13px; letter-spacing: .02em; }
.article-content tbody tr:last-child td { border-bottom: 0; }
.article-content code {
  font-family: var(--font-mono); background: var(--brand-green-100);
  color: var(--brand-green-700); padding: 1px 6px; border-radius: 4px; font-size: 0.92em;
}
.article-content blockquote {
  margin: 1.5em 0; padding: 0.8em 1.2em;
  border-left: 4px solid var(--brand-green);
  background: var(--brand-green-100); border-radius: 0 var(--radius) var(--radius) 0;
}
.article-content blockquote p { margin: 0; }
.article-content em { font-family: var(--font-display); font-style: italic; color: var(--ink); }

.disclaimer {
  background: var(--brand-warm-100);
  border: 1px solid color-mix(in oklab, var(--brand-warm) 30%, var(--brand-warm-100));
  border-left: 4px solid var(--brand-warm);
  padding: 14px 18px; border-radius: var(--radius);
  font-size: 14px; color: var(--ink); margin-bottom: 24px;
}
.disclaimer strong { color: var(--brand-warm); }

.source-list { margin-top: 3em; padding-top: 1.5em; border-top: 1px solid var(--line); }
.source-list h2 { font-size: 22px; margin-bottom: 0.6em; }
.source-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.source-list li { font-size: 14.5px; }
.source-list a { color: var(--brand-navy); }

.faq { margin-top: 3em; padding-top: 1.5em; border-top: 1px solid var(--line); }
.faq h2 { font-size: 22px; margin-bottom: 0.8em; }
.faq details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 10px; overflow: hidden;
}
.faq details[open] { border-color: var(--brand-green-100); }
.faq summary {
  padding: 14px 18px; cursor: pointer; font-weight: 500; color: var(--ink);
  list-style: none; font-size: 15px; transition: background 120ms ease;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--brand-green); font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq summary:hover { background: var(--brand-green-100); }
.faq p { padding: 0 18px 14px; margin: 0; font-size: 14.5px; color: var(--mute); line-height: 1.6; }

.article-sidebar { display: flex; flex-direction: column; gap: 18px; }
.sidebar-box {
  padding: 22px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 14.5px; line-height: 1.55;
}
.sidebar-box h2 { font-size: 16px; margin: 0 0 10px; font-family: var(--font-body); font-weight: 600; color: var(--ink); letter-spacing: 0; }
.sidebar-box p { margin: 0 0 12px; color: var(--mute); }
.sidebar-box a { color: var(--brand-green-700); font-weight: 500; font-size: 14px; }

.related { background: var(--paper); border-top: 1px solid var(--line); }

/* -----------------------------
   12. Articles index, filters
   ----------------------------- */
.filters {
  display: grid; grid-template-columns: 1fr 240px; gap: 16px;
  margin-bottom: 28px; padding: 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
@media (max-width: 760px) { .filters { grid-template-columns: 1fr; } }
.filters label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--mute); }
.filters span { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.filters input, .filters select {
  font: inherit; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink);
}
.filters input:focus, .filters select:focus { outline: 3px solid var(--focus-ring); border-color: var(--brand-green); }
.empty-state { text-align: center; padding: 40px; color: var(--mute); }

/* -----------------------------
   13. Footer
   ----------------------------- */
.site-footer {
  background: var(--paper); border-top: 1px solid var(--line);
  padding-block: 56px 32px; color: var(--mute); font-size: 14px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 2fr;
  gap: 40px; margin-bottom: 40px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }
.footer-title {
  font-family: var(--font-display); font-size: 18px; font-weight: 600;
  color: var(--ink); margin: 0 0 8px;
}
.site-footer p { font-size: 14px; max-width: 50ch; line-height: 1.55; }
nav[aria-label="Footer navigation"] {
  display: flex; flex-wrap: wrap; gap: 14px 24px;
}
nav[aria-label="Footer navigation"] a {
  color: var(--ink-2); text-decoration: none; font-size: 14px;
}
nav[aria-label="Footer navigation"] a:hover { color: var(--brand-green); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid var(--line); padding-top: 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 12px; color: var(--mute);
}

/* -----------------------------
   14. Utility
   ----------------------------- */
.tag {
  display: inline-block; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase; padding: 4px 10px;
  border-radius: 999px; background: var(--brand-green-100); color: var(--brand-green-700);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Per-article hero images --- */
.card-cover {
  width: 100%; height: auto; aspect-ratio: 1200/630;
  object-fit: cover; display: block;
  background: var(--brand-green-100);
  border-bottom: 1px solid var(--line);
}
.card-body { padding: 22px 22px 12px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.article-hero-image {
  margin: 0 0 2em;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.article-hero-image img {
  width: 100%; height: auto; aspect-ratio: 1200/630;
  object-fit: cover; display: block;
}
/* Tighten the card-link padding now that the image bleeds to the edges */
.article-card .card-link { padding: 0; }

/* All site styles are now in global.css. This file is intentionally empty
   so the build script can concatenate both without errors. */
