/* ===== ACCESSIBILITY WIDGET ===== */

/* ---------- Toggle Button ---------- */
.a11y-toggle {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 99999;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #F05A29;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, background 0.2s ease;
  font-size: 1.4rem;
}
.a11y-toggle:hover {
  transform: scale(1.1);
  background: #d94e22;
}
.a11y-toggle:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* ---------- Panel ---------- */
.a11y-panel {
  position: fixed;
  bottom: 88px;
  left: 24px;
  z-index: 99998;
  width: 280px;
  max-height: 80vh;
  overflow-y: auto;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  transform: translateY(12px);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
}
.a11y-panel.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

/* Panel header */
.a11y-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.a11y-panel-title {
  font-family: 'Secular One', sans-serif;
  font-size: 1rem;
  color: #fff;
  margin: 0;
}
.a11y-reset-btn {
  font-family: 'Secular One', sans-serif;
  font-size: 0.7rem;
  color: #9aa0aa;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.a11y-reset-btn:hover {
  color: #F05A29;
  border-color: #F05A29;
}

/* ---------- Font Size Control ---------- */
.a11y-font-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.a11y-font-label {
  font-family: 'Secular One', sans-serif;
  font-size: 0.85rem;
  color: #ccc;
}
.a11y-font-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.a11y-font-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: 'Secular One', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.a11y-font-btn:hover {
  background: rgba(240, 90, 41, 0.2);
  border-color: #F05A29;
}
.a11y-font-value {
  font-family: 'Secular One', sans-serif;
  font-size: 0.8rem;
  color: #F05A29;
  min-width: 36px;
  text-align: center;
}

/* ---------- Toggle Buttons (features) ---------- */
.a11y-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.a11y-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  font-family: 'Secular One', sans-serif;
  font-size: 0.82rem;
  color: #ccc;
}
.a11y-option:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}
.a11y-option.active {
  background: rgba(240, 90, 41, 0.12);
  border-color: #F05A29;
  color: #fff;
}
.a11y-option-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.a11y-option.active .a11y-option-icon {
  color: #F05A29;
}

/* ---------- Skip to Content Link ---------- */
.skip-to-content {
  position: fixed;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  background: #F05A29;
  color: #fff;
  padding: 12px 24px;
  border-radius: 0 0 8px 8px;
  font-family: 'Secular One', sans-serif;
  font-size: 1rem;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-to-content:focus {
  top: 0;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* ---------- Global Focus Styles ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #F05A29;
  outline-offset: 3px;
}

/* ---------- Global Accessibility Overrides ---------- */

/* High Contrast */
html.a11y-high-contrast body {
  background: #000 !important;
  color: #fff !important;
}
html.a11y-high-contrast * {
  border-color: #fff !important;
}
html.a11y-high-contrast a {
  color: #FFD700 !important;
}
html.a11y-high-contrast p,
html.a11y-high-contrast li,
html.a11y-high-contrast span,
html.a11y-high-contrast div {
  color: #fff !important;
}
html.a11y-high-contrast .header,
html.a11y-high-contrast .footer {
  background: #000 !important;
}

/* Grayscale */
html.a11y-grayscale {
  filter: grayscale(100%);
}

/* Link Highlight */
html.a11y-links-highlight a {
  outline: 2px solid #FFD700 !important;
  outline-offset: 2px;
  text-decoration: underline !important;
}
html.a11y-links-highlight a:hover {
  outline-color: #F05A29 !important;
}

/* Readable Spacing */
html.a11y-readable-spacing p,
html.a11y-readable-spacing li,
html.a11y-readable-spacing span,
html.a11y-readable-spacing div {
  letter-spacing: 0.05em !important;
  word-spacing: 0.12em !important;
  line-height: 2 !important;
}

/* Stop Animations */
html.a11y-stop-animations *,
html.a11y-stop-animations *::before,
html.a11y-stop-animations *::after {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition-duration: 0s !important;
  transition-delay: 0s !important;
}

/* ---------- Mobile Adjustments ---------- */
@media (max-width: 768px) {
  .a11y-toggle {
    bottom: 16px;
    left: 16px;
    width: 46px;
    height: 46px;
    font-size: 1.2rem;
  }
  .a11y-panel {
    bottom: 74px;
    left: 16px;
    right: 16px;
    width: auto;
  }
}
