/* accessibility.css — Accessibility settings page + global a11y utilities.
   Owns: a11y settings panel, toggles, shortcuts grid, skip-link, focus rings,
         high-contrast mode, reduced-motion overrides, large-text mode.
   Does NOT own: legal page chrome (legal.css), sidebar (sidebar.css). */

/* === SKIP-TO-CONTENT LINK === */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100000;
  background: #00F2EA;
  color: #0A0A0A;
  padding: 12px 24px;
  border-radius: 0 0 8px 8px;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid #FF4D6D;
  outline-offset: 2px;
}

/* === GLOBAL FOCUS INDICATORS === */
*:focus-visible {
  outline: 2px solid #00F2EA;
  outline-offset: 2px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #00F2EA;
  outline-offset: 2px;
}

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

/* === SETTINGS PAGE === */
.a11y-page { max-width: 720px; }

.a11y-settings-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #141418;
  border: 1px solid #1e1e26;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.a11y-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  background: rgba(255,255,255,0.02);
  transition: background 0.15s;
}
.a11y-setting:hover { background: rgba(255,255,255,0.04); }

.a11y-setting-info { flex: 1; min-width: 0; }
.a11y-setting-info h3 {
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #F5F5F7;
  margin-bottom: 4px;
}
.a11y-setting-info p {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.5;
}

/* Toggle Switch */
.a11y-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.a11y-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.a11y-toggle-slider {
  width: 48px;
  height: 26px;
  background: #2a2a32;
  border-radius: 13px;
  position: relative;
  transition: background 0.2s;
}
.a11y-toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #666;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.a11y-toggle input:checked + .a11y-toggle-slider {
  background: rgba(0,242,234,0.3);
}
.a11y-toggle input:checked + .a11y-toggle-slider::after {
  transform: translateX(22px);
  background: #00F2EA;
}
.a11y-toggle input:focus-visible + .a11y-toggle-slider {
  box-shadow: 0 0 0 3px rgba(0,242,234,0.4);
}

.a11y-save-notice {
  padding: 12px 24px;
  font-size: 0.8125rem;
  color: #00F2EA;
  text-align: center;
  min-height: 0;
  transition: min-height 0.2s, padding 0.2s;
}
.a11y-save-notice:empty {
  padding: 0;
}

/* === SECTIONS === */
.a11y-section {
  margin-bottom: 2.5rem;
}
.a11y-section h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #F5F5F7;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #1e1e26;
}
.a11y-section h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #00F2EA;
  margin: 1.25rem 0 0.5rem;
}
.a11y-section p {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.a11y-list {
  list-style: none;
  padding: 0;
}
.a11y-list li {
  position: relative;
  padding-left: 20px;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.7;
  margin-bottom: 6px;
}
.a11y-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00F2EA;
}

/* === KEYBOARD SHORTCUTS GRID === */
.a11y-shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}
.a11y-shortcut {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid #1e1e26;
  border-radius: 10px;
}
.a11y-shortcut kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 4px 10px;
  background: #1e1e26;
  border: 1px solid #2e2e36;
  border-radius: 6px;
  font-family: 'Inter', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: #00F2EA;
  white-space: nowrap;
}
.a11y-shortcut span {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.6);
}

/* === HIGH-CONTRAST MODE === */
body.a11y-high-contrast {
  --bg: #000000;
  --bg-2: #0A0A0A;
  --surface: #111111;
  --surface-2: #1A1A1A;
  --border: #444444;
  --border-2: #555555;
  --text: #FFFFFF;
  --text-muted: #CCCCCC;
  --white: #FFFFFF;
}
body.a11y-high-contrast,
body.a11y-high-contrast .site-footer,
body.a11y-high-contrast .sidebar,
body.a11y-high-contrast .legal-page,
body.a11y-high-contrast .a11y-setting-info p,
body.a11y-high-contrast .a11y-section p,
body.a11y-high-contrast .a11y-list li,
body.a11y-high-contrast .a11y-shortcut span {
  color: #FFFFFF;
}
body.a11y-high-contrast a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
body.a11y-high-contrast .sidebar-nav-item,
body.a11y-high-contrast .footer-links a {
  color: #FFFFFF;
}
body.a11y-high-contrast *:focus-visible {
  outline: 3px solid #FFFF00;
  outline-offset: 2px;
}
body.a11y-high-contrast .a11y-toggle input:focus-visible + .a11y-toggle-slider {
  box-shadow: 0 0 0 3px rgba(255,255,0,0.5);
}
body.a11y-high-contrast .btn-teal { background: #FFFFFF; color: #000000; }
body.a11y-high-contrast .btn-ghost { border-color: #FFFFFF; color: #FFFFFF; }

/* === 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;
  }
}
body.a11y-reduced-motion *,
body.a11y-reduced-motion *::before,
body.a11y-reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* === LARGE TEXT MODE === */
body.a11y-large-text {
  font-size: 20px;
}
body.a11y-large-text .sidebar-label { font-size: 0.9375rem; }

/* === FLOATING A11Y WIDGET === */
.a11y-fab {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 9990;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #141418;
  border: 1px solid #1e1e26;
  color: #00F2EA;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
.a11y-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0,242,234,0.15);
}
.a11y-fab svg { pointer-events: none; }

.a11y-fab-menu {
  position: fixed;
  bottom: 132px;
  right: 20px;
  z-index: 9989;
  width: 260px;
  background: #141418;
  border: 1px solid #1e1e26;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  display: none;
  flex-direction: column;
  gap: 6px;
}
.a11y-fab-menu.open { display: flex; }

.a11y-fab-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  font-size: 0.8125rem;
  color: #F5F5F7;
  cursor: pointer;
  border: none;
  font-family: inherit;
  text-align: left;
  width: 100%;
}
.a11y-fab-item:hover { background: rgba(255,255,255,0.06); }
.a11y-fab-item .a11y-fab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2a2a32;
  flex-shrink: 0;
}
.a11y-fab-item.active .a11y-fab-dot { background: #00F2EA; }

.a11y-fab-link {
  display: block;
  text-align: center;
  padding: 8px;
  font-size: 0.75rem;
  color: #00F2EA;
  text-decoration: none;
  border-top: 1px solid #1e1e26;
  margin-top: 4px;
  padding-top: 12px;
}
.a11y-fab-link:hover { text-decoration: underline; }

/* Mobile tweaks */
@media (max-width: 768px) {
  .a11y-setting { padding: 16px; }
  .a11y-shortcuts-grid { grid-template-columns: 1fr; }
  .a11y-fab { bottom: 120px; }
  .a11y-fab-menu { bottom: 172px; }
}
