/* ==========================================================================
   NBSA Accessibility Stylesheet (WCAG 2.2 Level AAA/AA Standards)
   ========================================================================== */

/* 1. Skip to Content Navigation */
.nbsa-skip-links {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999999;
  pointer-events: none;
}

.nbsa-skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: #fe0002;
  color: #ffffff !important;
  padding: 12px 24px;
  font-family: var(--nbsa-font-heading);
  font-weight: 700;
  font-size: 1rem;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  text-decoration: none;
  transition: top 0.2s ease-in-out;
  pointer-events: auto;
  border: 3px solid #ffd726;
  outline: none;
}

.nbsa-skip-link:focus,
.nbsa-skip-link:focus-visible {
  top: 0;
  outline: 3px solid #ffbf47 !important;
  outline-offset: 2px;
}

/* 2. Unambiguous Focus Indicators (WCAG 2.2 Success Criterion 2.4.11 & 2.4.13) */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--nbsa-focus-gold) !important;
  outline-offset: 3px !important;
  border-radius: 4px;
  box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.25);
}

/* 3. Screen Reader Utilities */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
}

/* 4. Top Announcement Bar in Header */
.nbsa-a11y-bar {
  width: 100%;
  max-width: 100%;
  background-color: #222470; /* Brand Navy Blue */
  color: #ffffff;
  padding: 8px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--nbsa-font-heading);
  overflow-x: hidden;
}

.nbsa-a11y-bar .nbsa-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  max-width: 1380px;
}

.nbsa-a11y-quick-info {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.85rem;
}

.nbsa-a11y-quick-info a {
  color: #ffffff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: var(--nbsa-transition);
  font-weight: 500;
  white-space: nowrap;
}

.nbsa-a11y-quick-info a:hover {
  color: #ffd726;
  text-decoration: underline;
}

.nbsa-top-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nbsa-top-tagline {
  color: #e2e8f0;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

@media (max-width: 1023px) {
  .nbsa-top-tagline {
    display: none;
  }
  .nbsa-a11y-bar .nbsa-container {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .nbsa-a11y-quick-info {
    gap: 10px;
    font-size: 0.78rem;
    flex-wrap: wrap;
    justify-content: center;
  }
}

.nbsa-a11y-btn-group {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.nbsa-a11y-btn {
  background: transparent;
  color: #ffffff;
  border: none;
  padding: 4px 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--nbsa-transition);
}

.nbsa-a11y-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffd726;
}

.nbsa-a11y-btn.is-active {
  background: #fe0002;
  color: #ffffff;
}

/* 5. Audio Reader Toolbar (Text-to-Speech) */
.nbsa-tts-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(254, 0, 2, 0.2);
  border: 1px solid rgba(254, 0, 2, 0.4);
  border-radius: 4px;
  padding: 2px 6px;
}

.nbsa-tts-status {
  font-size: 0.75rem;
  color: #ffd726;
  margin-left: 4px;
  font-weight: 500;
}

/* 6. Dynamic Font Resizing */
html.font-scale-sm {
  font-size: 14px;
}

html.font-scale-md {
  font-size: 16px;
}

html.font-scale-lg {
  font-size: 18.5px;
}

html.font-scale-xl {
  font-size: 21px;
}

/* 7. High Contrast Mode (Yellow on Black - Peak Contrast for Visually Impaired) */
body.high-contrast-mode {
  background-color: #000000 !important;
  color: #ffd726 !important;
}

body.high-contrast-mode * {
  background-color: #000000 !important;
  color: #ffd726 !important;
  border-color: #ffd726 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

body.high-contrast-mode a,
body.high-contrast-mode button,
body.high-contrast-mode .nbsa-btn {
  color: #000000 !important;
  background-color: #ffd726 !important;
  border: 2px solid #ffffff !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
}

body.high-contrast-mode a:focus,
body.high-contrast-mode button:focus,
body.high-contrast-mode input:focus {
  outline: 4px solid #ffffff !important;
  outline-offset: 4px !important;
}

body.high-contrast-mode img {
  filter: grayscale(100%) contrast(150%) !important;
}

/* 8. Dark Mode */
body.dark-mode {
  background-color: #121212 !important;
  color: #e2e8f0 !important;
}

body.dark-mode .nbsa-header {
  background-color: #1a1a1a;
  border-bottom-color: #333333;
}

body.dark-mode .nbsa-nav-link {
  color: #f1f5f9;
}

body.dark-mode .nbsa-card,
body.dark-mode .nbsa-box,
body.dark-mode .nbsa-stat-card {
  background-color: #1e1e1e !important;
  border-color: #333333 !important;
  color: #e2e8f0 !important;
}

body.dark-mode .nbsa-card p,
body.dark-mode .nbsa-card h3,
body.dark-mode .nbsa-card h4 {
  color: #f8fafc !important;
}

body.dark-mode .nbsa-goalball-showcase {
  background-color: #14161b !important;
  border-top-color: #262933 !important;
  border-bottom-color: #262933 !important;
}

body.dark-mode .nbsa-goalball-title,
body.dark-mode .nbsa-essential-header h4,
body.dark-mode .nbsa-goalball-milestones-title,
body.dark-mode .nbsa-goalball-milestone-text strong {
  color: #f8fafc !important;
}

body.dark-mode .nbsa-goalball-lead,
body.dark-mode .nbsa-goalball-narrative p,
body.dark-mode .nbsa-goalball-milestone-text p,
body.dark-mode .nbsa-essential-item p,
body.dark-mode .nbsa-metric-label {
  color: #94a3b8 !important;
}

body.dark-mode .nbsa-goalball-pullquote p {
  color: #e2e8f0 !important;
}

body.dark-mode .nbsa-pill-subtle {
  background-color: #1e222d !important;
  color: #cbd5e1 !important;
  border: none !important;
}

body.dark-mode .nbsa-goalball-milestones,
body.dark-mode .nbsa-goalball-metrics-strip,
body.dark-mode .nbsa-metric-cell {
  border-color: #262933 !important;
}

body.dark-mode .nbsa-goalball-photo-frame {
  border-color: #334155 !important;
}

/* 9. Dyslexia / Ultra-Legible Font Mode */
body.dyslexia-mode {
  font-family: Arial, Helvetica, sans-serif !important;
  letter-spacing: 0.05em !important;
  word-spacing: 0.1em !important;
  line-height: 1.9 !important;
}

/* 10. Underline Links Enforcement */
body.underline-links a {
  text-decoration: underline !important;
}

/* 11. Reduced Motion Preference */
@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;
  }
}

/* 12. Flat Top Bar Buttons */
.nbsa-a11y-flat-btn {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--nbsa-transition);
  line-height: 1.2;
}

.nbsa-a11y-flat-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffd726;
  border-color: #ffd726;
}

/* 13. Floating Flat Universal Accessibility Widget (Matching User Screenshot) */
.nbsa-floating-a11y-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99998;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nbsa-floating-a11y-btn:hover {
  transform: scale(1.1);
}

.nbsa-floating-a11y-btn:focus-visible {
  outline: 3px solid #ffd726 !important;
  outline-offset: 4px;
  border-radius: 50%;
}

.nbsa-floating-a11y-disk {
  width: 56px;
  height: 56px;
  background-color: #ffe600; /* Vibrant Yellow Disk */
  border-radius: 50%;
  border: 3.5px solid #2563eb; /* Royal Blue Outer Border */
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.28), 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: box-shadow 0.25s ease, background-color 0.2s ease;
}

.nbsa-floating-a11y-btn:hover .nbsa-floating-a11y-disk {
  box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.42), 0 12px 30px rgba(0, 0, 0, 0.32);
  background-color: #ffff00;
}

.nbsa-floating-a11y-svg {
  width: 44px;
  height: 44px;
  display: block;
}

.nbsa-floating-a11y-tooltip {
  position: absolute;
  right: 70px;
  background-color: #111111;
  color: #ffffff;
  padding: 5px 12px;
  font-family: var(--nbsa-font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px);
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.nbsa-floating-a11y-tooltip::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -5px;
  transform: translateY(-50%);
  border-width: 5px 0 5px 5px;
  border-style: solid;
  border-color: transparent transparent transparent #111111;
}

.nbsa-floating-a11y-btn:hover .nbsa-floating-a11y-tooltip,
.nbsa-floating-a11y-btn:focus-visible .nbsa-floating-a11y-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* 14. Accessibility Modal Dialog & Backdrop */
.nbsa-a11y-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 999990;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.nbsa-a11y-modal-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

.nbsa-a11y-modal {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.08);
  z-index: 999995;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nbsa-a11y-modal.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.nbsa-a11y-modal-dialog {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
}

.nbsa-a11y-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.25rem;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.nbsa-a11y-badge-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #ffe600;
  border: 2px solid #2563eb;
  color: #111111;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nbsa-a11y-close-btn {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.nbsa-a11y-close-btn:hover {
  background-color: #fee2e2;
  color: #dc2626;
}

.nbsa-a11y-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.nbsa-a11y-section-title {
  display: block;
  font-family: var(--nbsa-font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  margin-bottom: 0.6rem;
}

.nbsa-a11y-btn-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.nbsa-a11y-grid-tools {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.nbsa-btn-a11y-tool {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  padding: 8px 12px;
  font-family: var(--nbsa-font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  min-height: 38px;
}

.nbsa-btn-a11y-tool:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}

.nbsa-btn-a11y-tool.is-active {
  background: var(--nbsa-primary);
  border-color: var(--nbsa-primary);
  color: #ffffff;
}

/* Dark Mode Overrides for Goalball Dedicated Page */
body.dark-mode .nbsa-gp-hero-section {
  background-color: #14161b !important;
  border-bottom-color: #262933 !important;
}

body.dark-mode .nbsa-gp-section-alt {
  background-color: #14161b !important;
}

body.dark-mode .nbsa-gp-hero-title,
body.dark-mode .nbsa-gp-card-header h3,
body.dark-mode .nbsa-gp-tactic-title,
body.dark-mode .nbsa-gp-timeline-card h4 {
  color: #f8fafc !important;
}

body.dark-mode .nbsa-gp-hero-lead,
body.dark-mode .nbsa-gp-tactic-desc,
body.dark-mode .nbsa-gp-timeline-card p,
body.dark-mode .nbsa-gp-bullet-list {
  color: #94a3b8 !important;
}

body.dark-mode .nbsa-gp-feature-card,
body.dark-mode .nbsa-gp-tactic-card,
body.dark-mode .nbsa-gp-timeline-card {
  background-color: #1e222d !important;
  border-color: #334155 !important;
}

body.dark-mode .nbsa-gp-bullet-list strong {
  color: #f8fafc !important;
}

body.dark-mode .nbsa-gp-mini-stats {
  border-top-color: #334155 !important;
}

/* Dark Mode Overrides for Sports & Programs Page */
body.dark-mode .nbsa-sp-hero-section {
  background-color: #14161b !important;
  border-bottom-color: #262933 !important;
}

body.dark-mode .nbsa-sp-hero-title,
body.dark-mode .nbsa-sp-card-title,
body.dark-mode .nbsa-sp-section-title,
body.dark-mode .nbsa-sp-pathway-card-title {
  color: #f8fafc !important;
}

body.dark-mode .nbsa-sp-hero-lead,
body.dark-mode .nbsa-sp-card-text,
body.dark-mode .nbsa-sp-section-desc,
body.dark-mode .nbsa-sp-pathway-card-text {
  color: #94a3b8 !important;
}

body.dark-mode .nbsa-sp-card,
body.dark-mode .nbsa-sp-pathway-card {
  background-color: #1e222d !important;
  border-color: #334155 !important;
}

body.dark-mode .nbsa-sp-stat {
  background-color: #262933 !important;
  color: #cbd5e1 !important;
}

body.dark-mode .nbsa-sp-stat svg {
  color: #94a3b8 !important;
}

body.dark-mode .nbsa-sp-highlights-wrap {
  background-color: #14161b !important;
  border-color: #262933 !important;
}

body.dark-mode .nbsa-sp-highlights-label {
  color: #e2e8f0 !important;
}

body.dark-mode .nbsa-sp-highlights-list li {
  color: #cbd5e1 !important;
}

body.dark-mode .nbsa-sp-pathway-section {
  background-color: #14161b !important;
  border-top-color: #262933 !important;
  border-bottom-color: #262933 !important;
}

body.dark-mode .nbsa-sp-pathway-list {
  border-top-color: #262933 !important;
}

body.dark-mode .nbsa-sp-pathway-list li {
  color: #cbd5e1 !important;
}

/* Dark Mode Overrides for Get Involved & Donations Page */
body.dark-mode .nbsa-gi-hero-section {
  background-color: #14161b !important;
  border-bottom-color: #262933 !important;
}

body.dark-mode .nbsa-gi-hero-title,
body.dark-mode .nbsa-gi-section-title,
body.dark-mode .nbsa-gi-pillar-title,
body.dark-mode .nbsa-gi-tier-title,
body.dark-mode .nbsa-gi-bank-title,
body.dark-mode .nbsa-gi-trust-title,
body.dark-mode .nbsa-gi-steps-title,
body.dark-mode .nbsa-gi-bank-value,
body.dark-mode .nbsa-gi-qr-label {
  color: #f8fafc !important;
}

body.dark-mode .nbsa-gi-hero-lead,
body.dark-mode .nbsa-gi-section-desc,
body.dark-mode .nbsa-gi-pillar-text,
body.dark-mode .nbsa-gi-tier-desc,
body.dark-mode .nbsa-gi-bank-lead,
body.dark-mode .nbsa-gi-steps-list,
body.dark-mode .nbsa-gi-pillar-list li {
  color: #94a3b8 !important;
}

body.dark-mode .nbsa-gi-pillar-card,
body.dark-mode .nbsa-gi-tier-card,
body.dark-mode .nbsa-gi-bank-box,
body.dark-mode .nbsa-gi-trust-box,
body.dark-mode .nbsa-gi-transfer-steps,
body.dark-mode .nbsa-gi-qr-box {
  background-color: #1e222d !important;
  border-color: #334155 !important;
}

body.dark-mode .nbsa-gi-tiers-section {
  background-color: #14161b !important;
  border-top-color: #262933 !important;
  border-bottom-color: #262933 !important;
}

body.dark-mode .nbsa-gi-bank-info {
  border-right-color: #334155 !important;
}

body.dark-mode .nbsa-gi-bank-side {
  background-color: #171920 !important;
}

body.dark-mode .nbsa-gi-bank-table {
  background-color: #14161b !important;
  border-color: #262933 !important;
}

body.dark-mode .nbsa-gi-bank-row {
  border-bottom-color: #262933 !important;
}

body.dark-mode .nbsa-gi-code {
  background-color: #262933 !important;
  color: #ffd726 !important;
}

body.dark-mode .nbsa-gi-copy-btn {
  background-color: #1e222d !important;
  border-color: #475569 !important;
  color: #cbd5e1 !important;
}

body.dark-mode .nbsa-gi-copy-btn:hover {
  background-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-mode .nbsa-gi-bank-notice {
  background-color: #1e222d !important;
  border-left-color: #3b82f6 !important;
  color: #e2e8f0 !important;
}

body.dark-mode .nbsa-gi-tier-amount {
  color: #60a5fa !important;
}
