/* ==========================================================================
   Unapologetic Advocacy - Accessible Design System (WCAG 2.2 AA / AAA)
   Palette: Deep Civic Navy, Warm Paper, Burnt Terracotta, Forest Teal
   Typography: Braille Institute Atkinson Hyperlegible + system fallbacks
   ========================================================================== */

:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --surface-alt: #f2eee6;
  --surface-tint: #edf4f4;
  --surface-warn: #fdf3ec;

  --ink: #1e293b;
  --ink-strong: #0f2942;
  --ink-muted: #475569;

  --navy: #0f2942;
  --navy-deep: #091b2d;
  --accent: #b44314;
  --accent-hover: #8f330d;
  --teal: #165b5b;
  --teal-hover: #0f4444;

  --border: #d6d1c7;
  --border-strong: #94a3b8;
  --focus-ring: #b44314;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 6px rgba(15, 41, 66, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 41, 66, 0.09);

  --font-sans: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --base-size: 100%;
  --line-height: 1.65;
  --letter-spacing: 0;
  --word-spacing: 0;

  --max-width: 1120px;
  --measure: 68ch;
}

/* Text size preferences */
html[data-text-size="lg"] {
  --base-size: 115%;
}

html[data-text-size="xl"] {
  --base-size: 130%;
}

/* Reading comfort / dyslexia-friendly spacing */
html[data-spacing="wide"] {
  --line-height: 1.9;
  --letter-spacing: 0.04em;
  --word-spacing: 0.14em;
}

/* High-contrast mode (15:1+ contrast ratios) */
html[data-contrast="high"] {
  --bg: #000000;
  --surface: #0b0b0b;
  --surface-alt: #141414;
  --surface-tint: #101c1c;
  --surface-warn: #1f1400;

  --ink: #ffffff;
  --ink-strong: #ffffff;
  --ink-muted: #e2e8f0;

  --navy: #000000;
  --navy-deep: #000000;
  --accent: #ffd700;
  --accent-hover: #ffea61;
  --teal: #5ef2f2;
  --teal-hover: #99ffff;

  --border: #ffffff;
  --border-strong: #ffd700;
  --focus-ring: #ffd700;
  --shadow-sm: none;
  --shadow-md: none;
}

html[data-contrast="high"] .btn-primary {
  background: #ffd700;
  color: #000000;
  border-color: #ffd700;
}

html[data-contrast="high"] .btn-primary:hover,
html[data-contrast="high"] .btn-primary:focus-visible {
  background: #ffea61;
  color: #000000;
}

html[data-contrast="high"] .btn-secondary {
  background: #000000;
  color: #ffd700;
  border: 2px solid #ffd700;
}

html[data-contrast="high"] .hero,
html[data-contrast="high"] .site-footer,
html[data-contrast="high"] .cta-banner {
  background: #000000;
  border-top: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

html[data-contrast="high"] a {
  color: #ffd700;
}

html[data-contrast="high"] .pill {
  background: #000000;
  color: #ffd700;
  border: 1px solid #ffd700;
}

/* Base Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: var(--base-size);
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: var(--line-height);
  letter-spacing: var(--letter-spacing);
  word-spacing: var(--word-spacing);
  background-color: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

a:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 3px;
}

h1,
h2,
h3,
h4 {
  color: var(--ink-strong);
  line-height: 1.22;
  margin-top: 0;
  font-weight: 700;
}

h1 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.15rem);
  margin-bottom: 0.85rem;
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.4rem);
  margin-bottom: 0.6rem;
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

.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;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -120px;
  left: 1rem;
  z-index: 1000;
  background: var(--accent);
  color: #ffffff;
  padding: 0.85rem 1.25rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 0.75rem;
}

/* Layout Containers */
.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.container-narrow {
  width: min(100% - 2rem, 800px);
  margin-inline: auto;
}

.section {
  padding-block: clamp(3rem, 6vw, 5rem);
}

.section-alt {
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Accessibility Utility Bar */
.a11y-bar {
  background: var(--navy-deep);
  color: #ffffff;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.a11y-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-block: 0.45rem;
}

.a11y-label {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.a11y-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.a11y-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.7rem;
  min-height: 36px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.a11y-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.a11y-btn[aria-pressed="true"] {
  background: #ffd700;
  color: #000000;
  border-color: #ffd700;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink-strong);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.15;
}

.brand:hover {
  color: var(--accent);
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.brand-sub {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--ink-muted);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  color: var(--ink-strong);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.9rem;
  min-height: 44px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.35rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.9rem;
  min-height: 44px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink-strong);
  font-weight: 700;
  font-size: 0.98rem;
}

.nav-link:hover {
  background: var(--surface-alt);
  color: var(--accent);
}

.nav-link[aria-current="page"] {
  background: var(--surface-tint);
  color: var(--teal);
  box-shadow: inset 0 -3px 0 var(--teal);
}

.nav-cta {
  background: var(--accent);
  color: #ffffff !important;
  margin-left: 0.35rem;
}

.nav-cta:hover {
  background: var(--accent-hover);
  color: #ffffff !important;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }

  .primary-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 1rem;
  }

  .primary-nav.is-open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }

  .nav-cta {
    margin-left: 0;
    justify-content: center;
  }
}

/* Buttons */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink-strong);
  border-color: var(--ink-strong);
}

.btn-secondary:hover {
  background: var(--surface-alt);
  color: var(--ink-strong);
}

.btn-hero-ghost {
  background: transparent;
  color: #ffffff;
  border-color: #ffffff;
}

.btn-hero-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.btn-teal {
  background: var(--teal);
  color: #ffffff;
  border-color: var(--teal);
}

.btn-teal:hover {
  background: var(--teal-hover);
  border-color: var(--teal-hover);
  color: #ffffff;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 62%, #143f59 100%);
  color: #ffffff;
  padding-block: clamp(3.5rem, 7vw, 6rem);
  border-bottom: 5px solid var(--accent);
}

.hero h1,
.hero h2 {
  color: #ffffff;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(224, 99, 42, 0.22);
  color: #ffd9c4;
  border: 1px solid rgba(255, 217, 196, 0.45);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 1.1rem;
}

.hero-lead {
  font-size: clamp(1.12rem, 2vw, 1.32rem);
  color: #e8eef5;
  max-width: 60ch;
  margin-bottom: 1.25rem;
}

.hero-pillars {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.4rem;
  list-style: none;
  padding: 1.4rem 0 0;
  margin: 2rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 700;
  color: #f1f5f9;
  font-size: 0.96rem;
}

.hero-pillars li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.hero-pillars .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f08a56;
  display: inline-block;
}

/* Page Header (Subpages) */
.page-banner {
  background: var(--navy);
  color: #ffffff;
  padding-block: clamp(2.5rem, 5vw, 3.75rem);
  border-bottom: 4px solid var(--accent);
}

.page-banner h1 {
  color: #ffffff;
  margin-bottom: 0.6rem;
}

.page-banner p {
  color: #e2e8f0;
  max-width: 64ch;
  font-size: 1.1rem;
  margin-bottom: 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.breadcrumb a {
  color: #ffd9c4;
}

/* Grids & Cards */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.4rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.65rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.card-accent {
  border-top: 5px solid var(--accent);
}

.card-teal {
  border-top: 5px solid var(--teal);
}

.card-navy {
  border-top: 5px solid var(--navy);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--surface-tint);
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.card-icon.accent {
  background: var(--surface-warn);
  color: var(--accent);
}

.section-header {
  max-width: 68ch;
  margin-bottom: 2rem;
}

.section-kicker {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.4rem;
  display: block;
}

.lead-muted {
  color: var(--ink-muted);
  font-size: 1.08rem;
}

/* Comparison Block ("Enrolled Is Not the Same as Served") */
.reality-box {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.reality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.reality-col {
  padding: 2rem;
}

.reality-col.paper {
  background: var(--surface-alt);
  border-right: 1px solid var(--border);
}

.reality-col.lived {
  background: var(--surface);
}

.reality-list {
  padding-left: 1.25rem;
  margin: 0.75rem 0 0;
}

.reality-list li {
  margin-bottom: 0.65rem;
}

/* Pills & Tags */
.pill {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--surface-tint);
  color: var(--teal);
  letter-spacing: 0.02em;
}

.pill-accent {
  background: var(--surface-warn);
  color: var(--accent);
}

/* Articles Hub & Cards */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  margin-bottom: 2rem;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  background: var(--surface-alt);
  color: var(--ink-strong);
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  min-height: 44px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.filter-btn:hover {
  border-color: var(--teal);
}

.filter-btn[aria-pressed="true"] {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
}

.search-wrap {
  flex: 1 1 240px;
  max-width: 340px;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 0.9rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.textarea {
  min-height: 140px;
  resize: vertical;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.article-card:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow-md);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.9rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.article-card h3 {
  margin-bottom: 0.25rem;
}

.article-card h3 a {
  color: var(--ink-strong);
  text-decoration: none;
}

.article-card h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.article-card-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.featured-article {
  background: var(--surface);
  border: 2px solid var(--navy);
  border-left: 8px solid var(--accent);
  border-radius: var(--radius-md);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

/* Single Article Reader */
.article-prose {
  max-width: var(--measure);
  font-size: 1.08rem;
}

.article-prose h2 {
  margin-top: 2.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.article-prose h3 {
  margin-top: 1.5rem;
}

.article-prose ul,
.article-prose ol {
  padding-left: 1.4rem;
  margin-bottom: 1.25rem;
}

.article-prose li {
  margin-bottom: 0.55rem;
}

.callout {
  background: var(--surface-tint);
  border-left: 5px solid var(--teal);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.4rem;
  margin-block: 1.5rem;
}

.callout-warn {
  background: var(--surface-warn);
  border-left-color: var(--accent);
}

.callout-title {
  font-weight: 700;
  color: var(--ink-strong);
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-block: 1.5rem;
  padding-block: 1rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Forms */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field label {
  display: block;
  font-weight: 700;
  color: var(--ink-strong);
  margin-bottom: 0.4rem;
}

.field-hint {
  display: block;
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin-bottom: 0.45rem;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.checkbox-row input[type="checkbox"] {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 0.1rem;
  accent-color: var(--teal);
}

.checkbox-row label {
  margin: 0;
  font-weight: 400;
  cursor: pointer;
}

.status-banner {
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--teal);
  background: var(--surface-tint);
  color: var(--ink-strong);
}

.status-banner.error {
  border-color: var(--accent);
  background: var(--surface-warn);
}

/* Privacy Trust Strip & CTA Banner */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.trust-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.trust-item strong {
  display: block;
  color: var(--ink-strong);
  margin-bottom: 0.35rem;
}

.cta-banner {
  background: var(--navy);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 4vw, 3.25rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.cta-banner h2 {
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.cta-banner p {
  color: #e2e8f0;
  max-width: 54ch;
  margin-bottom: 0;
}

/* Footer */
.site-footer {
  background: var(--navy-deep);
  color: #e2e8f0;
  padding-block: 3rem 2rem;
  border-top: 4px solid var(--accent);
}

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

.site-footer h2,
.site-footer h3 {
  color: #ffffff;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.site-footer a {
  color: #ffd9c4;
}

.site-footer a:hover {
  color: #ffffff;
}

.footer-bottom {
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.88rem;
  color: #cbd5e1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

/* Print Stylesheet */
@media print {
  .a11y-bar,
  .site-header,
  .article-actions,
  .cta-banner,
  .site-footer,
  .filter-bar {
    display: none !important;
  }
  body {
    background: #ffffff;
    color: #000000;
    font-size: 12pt;
  }
  a::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
}
