/* =============================================================
   ADA.CSS — WCAG 2.1 AA Accessibility Styles
   The Ultimate Unification of Dance
   ============================================================= */

/* ---- SKIP NAVIGATION ---- */
.skip-nav {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 99999;
  background: var(--fire-gold, #f2d100);
  color: #000 !important;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  transition: top 0.2s ease;
  outline: 3px solid #000;
}
.skip-nav:focus {
  top: 0;
  outline: 3px solid #000;
}

/* ---- FOCUS STYLES (visible for keyboard users) ---- */
*:focus-visible {
  outline: 3px solid #f2d100 !important;
  outline-offset: 3px !important;
  border-radius: 3px;
}

/* Remove default focus ring only when using mouse */
*:focus:not(:focus-visible) {
  outline: none;
}

/* Ensure interactive elements always show focus */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #f2d100 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 5px rgba(242, 209, 0, 0.3) !important;
}

/* ---- MINIMUM TOUCH TARGET SIZE (48x48px) ---- */
.nav-cta,
.btn,
.mobile-cta,
.nav-hamburger,
.vote-card,
.usa-card-ticket,
.host-cta-btn,
.lang-btn,
.lang-toggle-btn,
#back-to-top {
  min-height: 44px;
  min-width: 44px;
}

/* ---- HIGH CONTRAST TEXT RATIOS ---- */
/* Ensure muted text meets 4.5:1 ratio on dark backgrounds */
.text-muted,
.section-tag,
.event-box-sub,
.cast-qr-sub,
.detail-sub,
.host-origin,
.host-bio,
.vote-lock-sub,
.vote-lock-note,
.register-subtitle,
.section-subtitle,
.parade-lead,
.about-lead {
  color: #c0b0d0 !important; /* lightened for better contrast */
}

/* Ensure gold text is readable */
.fire-gold,
[style*="var(--fire-gold)"] {
  color: #f2d100;
}

/* ---- SCREEN READER ONLY 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: 0;
}

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

  .pulse-glow,
  .ticker-track,
  .flag-border-inner,
  .hero-bokeh,
  .hero-sparkle,
  .hero-beam,
  .neon-orb,
  .hero-flyer-img,
  .hero-flyer-glow {
    animation: none !important;
  }
}

/* ---- FONT SIZE — respect user browser settings ---- */
html {
  font-size: 100%; /* respect user zoom / OS font size settings */
}

/* ---- LINK UNDERLINES for inline body text ---- */
p a,
.about-text a,
.host-bio a,
.partner-desc a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- BUTTON STATES ---- */
button:disabled,
.btn:disabled,
[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---- FORM INPUTS ---- */
input, textarea, select {
  font-size: 1rem; /* prevent iOS zoom on focus */
  color: #fff;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  padding: 10px 14px;
}
input:focus, textarea:focus, select:focus {
  border-color: #f2d100;
  outline: 2px solid #f2d100;
}
label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #f5f0ee;
}

/* ---- IMAGE ALT + BROKEN IMAGE ---- */
img {
  font-size: 0.8rem;
  color: #a090b0;
}
img[alt]::after {
  content: " [Image: " attr(alt) "]";
}

/* ---- ARIA-LIVE REGIONS ---- */
[aria-live] {
  min-height: 1px; /* ensure region is always in DOM */
}

/* ---- COLOR CONTRAST — VOTE SECTION ---- */
.vote-lock-title {
  color: #fff !important;
}
.vsn-night {
  color: #f2d100 !important;
}
.vsn-date,
.vsn-time {
  color: #e0d0f0 !important;
}

/* ---- CONTESTANT CARD — ACCESSIBLE HOVER ---- */
.cast-flyer-card:focus-within .cast-flyer-overlay {
  opacity: 1;
  transform: none;
}

/* ---- USA CARD FOCUS STATE ---- */
.usa-card:focus-within {
  outline: 3px solid #f2d100;
  outline-offset: 4px;
  border-radius: 16px;
}

/* ============================================================
   LANGUAGE SWITCHER STYLES
   ============================================================ */

.lang-switcher-nav {
  position: relative;
  list-style: none;
}

.lang-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(242,209,0,0.3);
  border-radius: 6px;
  padding: 7px 12px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #f2d100;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
  min-height: 36px;
}
.lang-toggle-btn:hover {
  background: rgba(242,209,0,0.12);
  border-color: rgba(242,209,0,0.6);
}
.lang-toggle-btn:focus-visible {
  outline: 3px solid #f2d100 !important;
  outline-offset: 2px !important;
}

.lang-current-flag {
  font-size: 1rem;
  line-height: 1;
}
.lang-current-name {
  font-size: 0.75rem;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lang-chevron {
  font-size: 0.6rem;
  transition: transform 0.25s;
  color: #f2d100;
  opacity: 0.7;
}

/* Dropdown */
.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #1a0826;
  border: 1px solid rgba(242,209,0,0.25);
  border-radius: 10px;
  padding: 6px;
  list-style: none;
  min-width: 170px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7), 0 0 20px rgba(58,20,78,0.5);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s, transform 0.2s;
}
.lang-dropdown.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 9px 12px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  color: #c0b0d0;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.lang-btn:hover {
  background: rgba(242,209,0,0.10);
  color: #f2d100;
}
.lang-btn.lang-active {
  background: rgba(242,209,0,0.15);
  color: #f2d100;
  font-weight: 700;
}
.lang-btn:focus-visible {
  outline: 2px solid #f2d100 !important;
  outline-offset: 1px !important;
}

/* Mobile — language switcher in mobile menu */
@media (max-width: 900px) {
  .lang-switcher-nav {
    display: none; /* hidden in desktop nav list on mobile */
  }
  .mobile-lang-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px 4px;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .mobile-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(242,209,0,0.2);
    border-radius: 100px;
    padding: 6px 12px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: #c0b0d0;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    min-height: 34px;
  }
  .mobile-lang-btn:hover,
  .mobile-lang-btn.lang-active {
    background: rgba(242,209,0,0.15);
    color: #f2d100;
    border-color: rgba(242,209,0,0.5);
  }
  .mobile-lang-btn:focus-visible {
    outline: 2px solid #f2d100 !important;
  }
  .mobile-lang-label {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.5rem;
    letter-spacing: 0.3em;
    color: rgba(255,255,255,0.4);
    padding: 8px 16px 4px;
    text-transform: uppercase;
  }
}

/* Desktop-only show lang switcher in nav */
@media (min-width: 901px) {
  .mobile-lang-row,
  .mobile-lang-label {
    display: none;
  }
}

/* ---- HIGH CONTRAST MODE (OS level) ---- */
@media (forced-colors: active) {
  .btn,
  .nav-cta,
  .lang-toggle-btn,
  .lang-btn,
  .usa-card-ticket {
    forced-color-adjust: none;
    border: 2px solid ButtonText;
  }
  .skip-nav {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }
}

/* ---- PRINT STYLES ---- */
@media print {
  .flag-border-strip,
  #navbar,
  .hero-bokeh,
  .hero-sparkle,
  .hero-beam,
  .neon-orb,
  #back-to-top,
  .ticker-wrap,
  .skip-nav {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.75em;
    color: #444;
  }
  a[href^="#"]::after {
    content: ""; /* don't print anchor links */
  }
}
