/* ==========================================================================
   ARPBA (arfire.org) — Main Stylesheet
   ========================================================================== */

/* ---------- 1. Design Tokens ---------- */
:root {
  /* Colors */
  --color-bg:          rgb(22, 22, 22);
  --color-bg-header:   rgba(22, 22, 22, 0.25);
  --color-bg-scrolled: rgba(22, 22, 22, 0.9);
  --color-surface:     rgb(30, 30, 30);
  --color-border:      rgb(42, 42, 42);
  --color-text:        rgb(247, 247, 247);
  --color-text-muted:  rgb(164, 164, 164);
  --color-accent:      rgb(235, 62, 52);
  --color-accent-hover:rgb(248, 171, 169);
  --color-overlay:     rgba(0, 0, 0, 0.25);
  --color-overlay-dark:rgba(0, 0, 0, 0.55);

  /* Typography */
  --font-display: 'League Spartan', 'Helvetica Neue', Arial, sans-serif;
  --font-body:    'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Spacing */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2rem;
  --space-xl:  3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Layout */
  --container-max: 1200px;
  --header-height: 70px;

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow:   500ms ease;

  /* Borders */
  --radius-sm: 4px;
  --radius-md: 8px;
}


/* ---------- 2. Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

ul, ol {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

hr {
  border: none;
  border-top: 2px solid var(--color-accent);
  width: 60px;
  margin: var(--space-md) auto;
}


/* ---------- 3. Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

h4 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

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

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


/* ---------- 4. Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  padding: var(--space-2xl) 0;
}

.section--dark {
  background-color: var(--color-surface);
}

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


/* ---------- 5. Header & Navigation ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--color-bg-header);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background-color var(--transition-normal);
  height: var(--header-height);
}

.site-header.scrolled {
  background-color: var(--color-bg-scrolled);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

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

.site-logo img {
  height: 50px;
  width: auto;
}

/* Desktop navigation */
.desktop-nav {
  display: none;
}

.desktop-nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.desktop-nav__item {
  position: relative;
}

.desktop-nav__link {
  display: block;
  padding: var(--space-xs) 0.75rem;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 0.85rem;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.desktop-nav__link:hover,
.desktop-nav__link:focus-visible,
.desktop-nav__link--active {
  color: var(--color-accent);
}

/* Dropdown */
.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.dropdown-toggle .chevron {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform var(--transition-fast);
}

.desktop-nav__item.open .dropdown-toggle .chevron {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background-color: var(--color-bg-scrolled);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-xs) 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--transition-fast),
              visibility var(--transition-fast),
              transform var(--transition-fast);
}

.desktop-nav__item.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 0.4rem 1rem;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 0.85rem;
}

.dropdown-menu a:hover,
.dropdown-menu a:focus-visible {
  color: var(--color-accent);
  background-color: rgba(255, 255, 255, 0.05);
}


/* ---------- 6. Mobile Navigation ---------- */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 30px;
  height: 30px;
  padding: 0;
  z-index: 1100;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-text);
  transition: transform var(--transition-normal), opacity var(--transition-fast);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(320px, 85vw);
  height: 100vh;
  height: 100dvh;
  background-color: var(--color-bg);
  z-index: 1050;
  overflow-y: auto;
  transition: right var(--transition-normal);
  padding: calc(var(--header-height) + var(--space-md)) var(--space-md) var(--space-md);
  border-left: 1px solid var(--color-border);
}

.mobile-nav.open {
  right: 0;
}

.mobile-nav__overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.mobile-nav__overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav a {
  display: block;
  padding: 0.6rem 0;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.mobile-nav a:hover,
.mobile-nav a:focus-visible {
  color: var(--color-accent);
}

.mobile-nav__dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 0;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.mobile-nav__dropdown-btn .chevron {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: transform var(--transition-fast);
}

.mobile-nav__dropdown-btn.open .chevron {
  transform: rotate(180deg);
}

.mobile-nav__sub {
  display: none;
  padding-left: var(--space-sm);
}

.mobile-nav__sub.open {
  display: block;
}

.mobile-nav__sub a {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}


/* ---------- 7. Hero Section ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-height) + var(--space-lg)) var(--space-md) var(--space-lg);
  text-align: center;
}

.hero__image {
  width: 100%;
  height: auto;
  margin-bottom: var(--space-lg);
}

.hero__content {
  max-width: 800px;
}

.hero__title {
  margin-bottom: var(--space-sm);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.35rem);
  color: var(--color-text-muted);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}


/* ---------- 8. Content Sections ---------- */
.content-section {
  padding: var(--space-2xl) 0;
}

.content-section h2 {
  margin-bottom: var(--space-md);
}

.content-section p {
  color: var(--color-text-muted);
  max-width: 800px;
}

.content-section p a {
  text-decoration: underline;
}

.content-section--centered {
  text-align: center;
}

.content-section--centered p {
  margin-left: auto;
  margin-right: auto;
}

.two-column {
  display: grid;
  gap: var(--space-lg);
}

.resources-grid {
  display: grid;
  gap: var(--space-lg);
}

.banner-image {
  width: 100%;
  border-radius: var(--radius-md);
}

/* Chapter-specific */
.chapter-header-image {
  width: 100%;
  max-width: 600px;
  margin: 0 auto var(--space-lg);
  border-radius: var(--radius-md);
}

.chapter-info dt {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--color-text);
  margin-top: var(--space-sm);
}

.chapter-info dd {
  color: var(--color-text-muted);
}

.chapter-info dd a {
  text-decoration: underline;
}


/* ---------- 9. Cards & Grid ---------- */
.card-grid {
  display: grid;
  gap: var(--space-lg);
}

.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--color-accent);
}

.card__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.card__body {
  padding: var(--space-md);
}

.card__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: var(--space-xs);
}

.card__text {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Card link wrapper (makes whole card clickable) */
a.card {
  display: block;
  color: var(--color-text);
  text-decoration: none;
}

a.card:hover {
  color: var(--color-text);
}

/* Partner cards */
.partner-card {
  padding: var(--space-lg);
}

.partner-card h4 {
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.partner-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.partner-card a {
  text-decoration: underline;
}


/* ---------- 10. Forms ---------- */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-family: var(--font-display);
  margin-bottom: var(--space-xs);
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(235, 62, 52, 0.25);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--color-text);
  background-color: var(--color-accent);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.btn:hover,
.btn:focus-visible {
  background-color: transparent;
  color: var(--color-accent);
}

.btn--outline {
  background-color: transparent;
  color: var(--color-accent);
}

.btn--outline:hover,
.btn--outline:focus-visible {
  background-color: var(--color-accent);
  color: var(--color-text);
}


/* ---------- 11. FAQ (details/summary) ---------- */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-list details {
  border-bottom: 1px solid var(--color-border);
}

.faq-list summary {
  padding: var(--space-md) 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: '+';
  font-size: 1.5rem;
  flex-shrink: 0;
  color: var(--color-accent);
  transition: transform var(--transition-fast);
}

.faq-list details[open] summary::after {
  content: '\2212';
}

.faq-list details p {
  padding-bottom: var(--space-md);
  color: var(--color-text-muted);
}


/* ---------- 12. Downloads ---------- */
.download-list {
  max-width: 800px;
}

.download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

.download-item__name {
  font-family: var(--font-display);
}

.download-item__link {
  flex-shrink: 0;
}


/* ---------- 13. Map Page ---------- */
.map-container {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

/* SVG map base */
.ar-map {
  width: 100%;
  height: auto;
  display: block;
}

/* Uncovered counties */
.ar-map__uncovered path {
  fill: rgb(70, 70, 70);
}

/* Chapter fill colors — distinct hues inspired by the original map */
.ar-map__chapter[data-chapter="ozark-prairie"]         .ar-map__county { fill: hsl(30, 70%, 45%); }
.ar-map__chapter[data-chapter="north-central"]         .ar-map__county { fill: hsl(140, 45%, 40%); }
.ar-map__chapter[data-chapter="ozark-foothills"]       .ar-map__county { fill: hsl(200, 55%, 45%); }
.ar-map__chapter[data-chapter="ozark-delta"]           .ar-map__county { fill: hsl(270, 40%, 45%); }
.ar-map__chapter[data-chapter="westark"]               .ar-map__county { fill: hsl(50, 65%, 42%); }
.ar-map__chapter[data-chapter="central-river-valley"]  .ar-map__county { fill: hsl(340, 55%, 45%); }
.ar-map__chapter[data-chapter="ozark-mountain"]        .ar-map__county { fill: hsl(170, 50%, 38%); }
.ar-map__chapter[data-chapter="little-red"]            .ar-map__county { fill: hsl(15, 60%, 48%); }
.ar-map__chapter[data-chapter="central-arkansas"]      .ar-map__county { fill: hsl(220, 50%, 48%); }
.ar-map__chapter[data-chapter="blackland-prairie"]     .ar-map__county { fill: hsl(80, 45%, 38%); }
.ar-map__chapter[data-chapter="red-river"]             .ar-map__county { fill: hsl(0, 55%, 42%); }
.ar-map__chapter[data-chapter="lower-ouachita"]        .ar-map__county { fill: hsl(300, 35%, 42%); }
.ar-map__chapter[data-chapter="southeast-arkansas"]  .ar-map__county { fill: hsl(110, 45%, 38%); }
.ar-map__chapter[data-chapter="ouachita-mountain"]   .ar-map__county { fill: hsl(250, 40%, 48%); }

/* Hover/focus: highlight entire chapter group */
.ar-map__chapter:hover .ar-map__county,
.ar-map__chapter:focus-visible .ar-map__county {
  fill: var(--color-accent);
  transition: fill var(--transition-fast);
}

.ar-map__chapter:focus-visible {
  outline: 2px solid var(--color-accent-hover);
  outline-offset: 1px;
}

.ar-map__chapter {
  cursor: pointer;
}

/* County borders */
.ar-map__borders path {
  fill: none;
  stroke: rgb(22, 22, 22);
  stroke-width: 1;
  pointer-events: none;
}

/* County labels */
.ar-map__labels {
  pointer-events: none;
}

.ar-map__labels text {
  fill: var(--color-text);
  font-family: var(--font-body);
  font-size: 8px;
  text-anchor: middle;
  dominant-baseline: central;
  opacity: 0.7;
}

/* Map tooltip */
.ar-map-tooltip {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  background-color: var(--color-bg-scrolled);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--color-text);
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.ar-map-tooltip.visible {
  opacity: 1;
}

.ar-map-tooltip__name {
  font-weight: 400;
  color: var(--color-accent);
}

.ar-map-tooltip__counties {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ar-map__chapter:hover .ar-map__county,
  .ar-map__chapter:focus-visible .ar-map__county,
  .ar-map__labels text,
  .ar-map-tooltip {
    transition: none;
  }
}


/* ---------- 14. Footer ---------- */
.site-footer {
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.site-footer p {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

.footer-links a {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

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


/* ---------- 15. Cookie Consent ---------- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-md);
  transform: translateY(100%);
  transition: transform var(--transition-normal);
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-banner__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  text-align: center;
}

.cookie-banner h4 {
  width: 100%;
  font-size: 1rem;
}

.cookie-banner p {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  max-width: 600px;
}


/* ---------- 16. Utilities ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background-color: var(--color-accent);
  color: var(--color-text);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  z-index: 9999;
  font-family: var(--font-display);
}

.skip-link:focus {
  top: var(--space-xs);
  color: var(--color-text);
}

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

.external-link::after {
  content: ' \2197';
  font-size: 0.75em;
}


/* ---------- 17. Responsive ---------- */

/* Tablet (768px+) */
@media (min-width: 768px) {
  .two-column {
    grid-template-columns: 1fr 1fr;
  }

  .resources-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cookie-banner__inner {
    flex-wrap: nowrap;
    text-align: left;
  }

  .cookie-banner h4 {
    width: auto;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .desktop-nav {
    display: block;
  }

  .hamburger {
    display: none;
  }

  .site-logo img {
    height: 60px;
  }


  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Large Desktop (1280px+) */
@media (min-width: 1280px) {
  :root {
    --header-height: 80px;
  }

  .desktop-nav__link {
    font-size: 0.9rem;
  }
}


/* ---------- 18. Font Face ---------- */
@font-face {
  font-family: 'League Spartan';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/LeagueSpartan-Regular.woff2') format('woff2');
}
