/* ══════════════════════════════════════════════════════════════
   MAV UNITED — LUXURY ACCESSIBILITY WIDGET & ADA COMPLIANCE
   Standard: WCAG 2.1 AA / ADA Title III Compliance
   Aesthetic: Obsidian & Warm Bronze Luxury Theme
   ══════════════════════════════════════════════════════════════ */

/* ── 1. Skip to Main Content Link ── */
.a11y-skip-link {
  position: fixed;
  top: -120px;
  left: 1.5rem;
  background: #B3AEA7;
  color: #0B0F17;
  font-family: var(--font-sans, 'Manrope', sans-serif);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.85rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  z-index: 100000;
  transition: top 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border: 2px solid #FFFFFF;
}
.a11y-skip-link:focus,
.a11y-skip-link:focus-visible {
  top: 1.25rem;
  outline: 3px solid #B3AEA7;
  outline-offset: 3px;
}

/* ── 2. Floating Accessibility Button (Right Corner) ── */
.a11y-dock-btn {
  position: fixed;
  bottom: 28px;
  right: 28px; /* Positioned at the bottom-right corner */
  z-index: 9999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #0E1420;
  color: #B3AEA7;
  border: 1.5px solid rgba(179, 174, 167, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 12px rgba(179, 174, 167, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.25s ease,
              border-color 0.25s ease,
              box-shadow 0.25s ease,
              color 0.25s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.a11y-dock-btn:hover {
  transform: scale(1.08) translateY(-2px);
  background: #141C2B;
  color: #FFFFFF;
  border-color: #B3AEA7;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(179, 174, 167, 0.35);
}

.a11y-dock-btn:focus-visible {
  outline: 3px solid #B3AEA7;
  outline-offset: 3px;
  transform: scale(1.08) translateY(-2px);
}

.a11y-dock-btn__icon {
  width: 28px;
  height: 28px;
  fill: currentColor;
  transition: transform 0.25s ease;
}

.a11y-dock-btn:hover .a11y-dock-btn__icon {
  transform: scale(1.05);
}

/* Badge for active adjustments */
.a11y-dock-btn__badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #B3AEA7;
  color: #0E1420;
  font-size: 10px;
  font-weight: 800;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid #0E1420;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.a11y-dock-btn.has-active .a11y-dock-btn__badge {
  display: flex;
}

/* ── 3. Modal Backdrop ── */
.a11y-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 23, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.a11y-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

/* ── 4. Accessibility Drawer / Modal ── */
.a11y-modal {
  position: fixed;
  bottom: 96px;
  right: 28px;
  width: 390px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  background: #0E1420;
  border: 1px solid rgba(179, 174, 167, 0.35);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(179, 174, 167, 0.15);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  color: #FFFFFF;
  font-family: var(--font-sans, 'Manrope', -apple-system, sans-serif);
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.25s ease;
  overflow: hidden;
}
.a11y-modal.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Modal Header */
.a11y-modal__header {
  padding: 1.15rem 1.35rem;
  background: #141C2B;
  border-bottom: 1px solid rgba(179, 174, 167, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.a11y-modal__title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.a11y-modal__avatar-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(179, 174, 167, 0.15);
  border: 1px solid #B3AEA7;
  color: #B3AEA7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.a11y-modal__title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0;
  color: #FFFFFF;
  line-height: 1.25;
}
.a11y-modal__sub {
  font-size: 0.7rem;
  color: #B3AEA7;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-top: 2px;
}
.a11y-modal__close-btn {
  background: transparent;
  border: none;
  color: rgba(242, 239, 231, 0.7);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.2s ease, background 0.2s ease;
}
.a11y-modal__close-btn:hover,
.a11y-modal__close-btn:focus-visible {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.1);
  outline: 2px solid #B3AEA7;
}

/* Modal Body */
.a11y-modal__body {
  padding: 1.25rem 1.35rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: calc(100vh - 270px);
}

.a11y-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #B3AEA7;
  margin-bottom: 0.55rem;
}

/* Font Size Stepper */
.a11y-stepper-group {
  display: flex;
  gap: 0.45rem;
  width: 100%;
}
.a11y-step-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(179, 174, 167, 0.22);
  color: #FFFFFF;
  padding: 0.6rem 0.25rem;
  font-size: 0.775rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}
.a11y-step-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: #B3AEA7;
}
.a11y-step-btn:focus-visible {
  outline: 2px solid #B3AEA7;
}
.a11y-step-btn.is-active {
  background: #B3AEA7;
  border-color: #B3AEA7;
  color: #0E1420;
  font-weight: 800;
}

/* Interactive Toggles Grid */
.a11y-toggles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.a11y-toggle-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(179, 174, 167, 0.22);
  border-radius: 8px;
  padding: 0.85rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  text-align: left;
  color: #FFFFFF;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  position: relative;
}
.a11y-toggle-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #B3AEA7;
}
.a11y-toggle-card:focus-visible {
  outline: 2px solid #B3AEA7;
  outline-offset: 2px;
}
.a11y-toggle-card.is-active {
  background: rgba(179, 174, 167, 0.16);
  border-color: #B3AEA7;
}
.a11y-toggle-card__icon {
  width: 22px;
  height: 22px;
  color: #B3AEA7;
}
.a11y-toggle-card.is-active .a11y-toggle-card__icon {
  color: #FFFFFF;
}
.a11y-toggle-card__label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #FFFFFF;
}
.a11y-toggle-card__state {
  font-size: 0.65rem;
  color: rgba(242, 239, 231, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.a11y-toggle-card.is-active .a11y-toggle-card__state {
  color: #B3AEA7;
  font-weight: 800;
}

/* Modal Footer */
.a11y-modal__footer {
  padding: 0.95rem 1.35rem;
  background: #141C2B;
  border-top: 1px solid rgba(179, 174, 167, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.a11y-reset-button {
  background: transparent;
  border: 1px solid rgba(179, 174, 167, 0.35);
  color: rgba(242, 239, 231, 0.85);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.a11y-reset-button:hover,
.a11y-reset-button:focus-visible {
  background: rgba(179, 174, 167, 0.2);
  border-color: #B3AEA7;
  color: #FFFFFF;
  outline: 2px solid #B3AEA7;
}
.a11y-statement-anchor {
  font-size: 0.725rem;
  color: #B3AEA7;
  text-decoration: underline;
  transition: color 0.2s ease;
  font-weight: 600;
}
.a11y-statement-anchor:hover,
.a11y-statement-anchor:focus-visible {
  color: #FFFFFF;
}

/* ══════════════════════════════════════════════════════════════
   5. WCAG 2.1 AAA OVERRIDE UTILITY CLASSES (Applied to <html>)
   ══════════════════════════════════════════════════════════════ */

/* High Contrast Mode: Deep Pure Black with Off-White and Yellow Accents */
html.a11y-high-contrast {
  background: #000000 !important;
  color: #FFFFFF !important;
}
html.a11y-high-contrast body {
  background: #000000 !important;
  color: #FFFFFF !important;
}
html.a11y-high-contrast section,
html.a11y-high-contrast div:not(.a11y-dock-btn):not(.a11y-modal):not(.chatbot-trigger):not(.chatbot-modal),
html.a11y-high-contrast header,
html.a11y-high-contrast footer,
html.a11y-high-contrast nav {
  background-color: #000000 !important;
  color: #FFFFFF !important;
  border-color: #333333 !important;
}
html.a11y-high-contrast h1,
html.a11y-high-contrast h2,
html.a11y-high-contrast h3,
html.a11y-high-contrast h4,
html.a11y-high-contrast h5 {
  color: #FFFFFF !important;
}
html.a11y-high-contrast [style*="color:var(--color-bronze)"],
html.a11y-high-contrast [style*="color:#B3AEA7"],
html.a11y-high-contrast .hero__eyebrow-text,
html.a11y-high-contrast .footer__col-title {
  color: #FFEA79 !important; /* High-contrast accessible yellow */
}
html.a11y-high-contrast p,
html.a11y-high-contrast span:not(.a11y-dock-btn__badge),
html.a11y-high-contrast li {
  color: #F0F0F0 !important;
}
html.a11y-high-contrast a:not(.a11y-dock-btn):not(.btn) {
  color: #FFEA79 !important;
  text-decoration: underline !important;
}
html.a11y-high-contrast .btn--bronze,
html.a11y-high-contrast .btn--primary {
  background: #FFEA79 !important;
  color: #000000 !important;
  font-weight: 800 !important;
  border-color: #FFEA79 !important;
}
html.a11y-high-contrast .btn--outlined-light {
  border-color: #FFFFFF !important;
  color: #FFFFFF !important;
}

/* Adjust Text Size (+10%, +20%, +30%) */
html.a11y-text-10 {
  font-size: 110% !important;
}
html.a11y-text-20 {
  font-size: 120% !important;
}
html.a11y-text-30 {
  font-size: 130% !important;
}

/* Highlight Links */
html.a11y-highlight-links a:not(.a11y-dock-btn):not(.btn):not(.a11y-step-btn):not(.a11y-toggle-card),
html.a11y-highlight-links button:not(.a11y-dock-btn):not(.a11y-modal__close-btn):not(.a11y-step-btn):not(.a11y-toggle-card):not(.a11y-reset-button):not(.chatbot-trigger) {
  text-decoration: underline 3px #FFD700 !important;
  outline: 2px solid #FFD700 !important;
  outline-offset: 2px !important;
  background-color: rgba(255, 215, 0, 0.15) !important;
  color: #FFFFFF !important;
}

/* Dyslexia-Friendly / Clean High-Readability Font */
html.a11y-readable-font,
html.a11y-readable-font body,
html.a11y-readable-font p,
html.a11y-readable-font span,
html.a11y-readable-font a,
html.a11y-readable-font h1,
html.a11y-readable-font h2,
html.a11y-readable-font h3,
html.a11y-readable-font h4,
html.a11y-readable-font input,
html.a11y-readable-font select,
html.a11y-readable-font textarea,
html.a11y-readable-font button {
  font-family: 'OpenDyslexic', 'Lexend', 'Atkinson Hyperlegible', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif !important;
  letter-spacing: 0.04em !important;
  word-spacing: 0.08em !important;
}

/* Universal High Visibility Focus Ring */
:focus-visible {
  outline: 3px solid #B3AEA7 !important;
  outline-offset: 3px !important;
}

/* ── 6. Mobile Responsiveness ── */
@media (max-width: 640px) {
  .a11y-dock-btn {
    bottom: 16px;
    right: 16px; /* Right corner on mobile */
    width: 48px;
    height: 48px;
  }
  .a11y-dock-btn__icon {
    width: 24px;
    height: 24px;
  }
  .a11y-modal {
    bottom: 74px;
    right: 16px;
    width: calc(100vw - 32px);
    max-height: calc(100vh - 100px);
  }
}
