/* ================================================================
   ACCESSIBILITY OVERRIDES
   Loads AFTER styles.css — adds skip link, sr-only, focus-visible,
   prefers-reduced-motion, prefers-contrast, ARIA styles.
   ================================================================ */

/* === SKIP-TO-CONTENT LINK === */

.skip-to-content {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--accent-gold);
  color: var(--dark-brown);
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: bold;
  text-decoration: none;
  z-index: 10000;
  border-radius: 0 0 8px 8px;
  transition: top 0.2s ease;
}

.skip-to-content:focus {
  top: 0;
}


/* === SCREEN-READER-ONLY UTILITY === */

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


/* === FOCUS-VISIBLE: Keyboard focus indicators === */
/* Overrides the outline: none at styles.css:324 */

.form-group input:focus-visible,
.form-group textarea:focus-visible,
.form-group select:focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 2px;
  border-color: var(--secondary-green);
}

/* All interactive elements */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 2px;
}

/* Nav links on dark header background */
.nav-item a:focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 2px;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Dropdown menu links on white background */
.dropdown-menu a:focus-visible {
  outline: 3px solid var(--primary-green);
  outline-offset: -2px;
  background-color: var(--cream);
}

/* Header donate button */
.donate-btn:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 2px;
}

/* Primary/secondary buttons */
.btn:focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 3px;
}

/* Footer links on dark background */
.footer a:focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 2px;
}

/* Social links */
.social-links a:focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 3px;
}

/* Theme switcher toggle */
#theme-toggle-btn:focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 3px;
}

/* Hamburger toggle */
.nav-toggle:focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 2px;
}


/* === ARIA-DRIVEN STYLES === */

/* Current page indicator in navigation */
[aria-current="page"] {
  color: var(--accent-gold) !important;
  font-weight: bold;
  border-bottom: 2px solid var(--accent-gold);
}

/* Gallery filter: currently pressed */
[aria-pressed="true"] {
  background-color: var(--accent-gold) !important;
  color: var(--dark-brown) !important;
}

/* Disabled state */
[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}


/* === COLOR CONTRAST FIX (WCAG 2.1 AA: 4.5:1 for small text) === */
/* #666666 on #f5f1e8 = 4.84:1 — borderline, fails at small sizes.
   #595959 on #f5f1e8 = 5.08:1 — PASSES across all theme palettes. */

.card-content p,
.card-btn,
.event-date .month {
  color: #595959;
}


/* === FORM ACCESSIBILITY ADDITIONS === */

/* Fieldset/legend reset for radio/checkbox groups */
fieldset.form-group {
  border: none;
  padding: 0;
  margin: 0;
  margin-bottom: 20px;
}

fieldset.form-group legend {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--text-dark);
}

/* Required-fields explanation */
.form-required-note {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 15px;
}


/* === PREFERS-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;
  }

  .card:hover {
    transform: none;
  }

  .tier:hover {
    transform: none;
  }

  .gallery-item:hover img {
    transform: none;
  }

  body.design-fusion .hero-cta:hover {
    transform: none;
  }

  body.design-prairie .dropdown-menu a:hover {
    padding-left: 20px;
  }

  .skip-to-content {
    transition: none;
  }
}


/* === PREFERS-CONTRAST: MORE === */

@media (prefers-contrast: more) {
  :root {
    --text-light: #333333;
  }

  p,
  .card-content p {
    color: var(--text-dark);
  }

  .card {
    border: 2px solid var(--text-dark);
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    border-width: 3px;
    border-color: var(--text-dark);
  }

  a:focus-visible,
  button:focus-visible {
    outline-width: 4px;
  }

  .dropdown-menu {
    border: 2px solid var(--text-dark);
  }

  .footer p,
  .footer a {
    color: rgba(255, 255, 255, 1);
  }

  .btn-primary {
    border: 2px solid var(--white);
  }

  .btn-secondary {
    border: 2px solid var(--dark-brown);
  }

  .info-box p {
    color: var(--white);
    font-weight: 500;
  }
}


/* === PREFERS-COLOR-SCHEME: DARK (minimal pre-JS fallback) === */

@media (prefers-color-scheme: dark) {
  body:not(.design-franciscan):not(.design-fusion):not(.design-blessed):not(.design-prairie) {
    --cream: #1a1a2e;
    --white: #16213e;
    --text-dark: #e0e0e0;
    --text-light: #b0b0b0;
  }
}
