/* ═══ WLMS accessibility (screen readers, keyboard, low vision) ═══ */

/* Text only for screen readers */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* "Skip to main content" – first thing a keyboard / NVDA user reaches */
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 5000; background: #111; color: #fff !important; padding: 12px 18px; border-radius: 8px;
  font-weight: 800; font-size: 15px; text-decoration: none; transform: translateY(-160%); transition: transform .15s; }
.skip-link:focus { transform: none; outline: 3px solid #fbbf24; outline-offset: 2px; }
#main-content:focus { outline: none; }

/* Clear focus ring on everything you can reach with Tab */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible, iframe:focus-visible, summary:focus-visible {
  outline: 3px solid #f59e0b !important; outline-offset: 2px !important; box-shadow: 0 0 0 5px rgba(17,17,17,.85) !important; border-radius: 4px;
}

/* Accessibility button in the top bar */
.a11y-open-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border, #e2e8f0); background: #fff; color: var(--primary, #1a3c5e);
  border-radius: 20px; padding: 6px 12px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; }
.a11y-open-btn:hover { background: #eff6ff; }
@media (max-width: 576px) { .a11y-open-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }

/* Settings dialog */
.a11y-panel:not([hidden]) { position: fixed; inset: 0; z-index: 4000; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.a11y-card { background: #fff; color: #111; border-radius: 16px; padding: 22px; width: 100%; max-width: 440px; max-height: 90vh; overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.a11y-card h2 { font-size: 20px; margin: 0 0 6px; color: #1a3c5e; }
.a11y-hint { font-size: 13px; color: #475569; margin: 0 0 14px; line-height: 1.5; }
.a11y-card fieldset { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; }
.a11y-card legend { font-weight: 800; font-size: 14px; padding: 0 6px; }
.a11y-card label { display: flex; align-items: center; gap: 10px; font-size: 15px; padding: 7px 0; cursor: pointer; }
.a11y-card input { width: 20px; height: 20px; accent-color: #1a3c5e; }
.a11y-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.a11y-btn { border: 0; border-radius: 10px; padding: 10px 16px; font-size: 14px; font-weight: 700; background: #1a3c5e; color: #fff !important; cursor: pointer; text-decoration: none; font-family: inherit; }
.a11y-btn.a11y-light { background: #f1f5f9; color: #1e293b !important; }

/* ── Larger text (whole page grows evenly) ── */
html.a11y-text-l body  { zoom: 1.15; }
html.a11y-text-xl body { zoom: 1.32; }

/* ── Underlined links ── */
html.a11y-links a:not(.nav-link):not(.abn-item):not(.skip-link) { text-decoration: underline !important; text-underline-offset: 2px; }

/* ── Readable spacing ── */
html.a11y-spacing body { letter-spacing: .04em; word-spacing: .12em; }
html.a11y-spacing p, html.a11y-spacing li, html.a11y-spacing td, html.a11y-spacing div { line-height: 1.75 !important; }

/* ── Calm screen: no motion ── */
html.a11y-calm *, html.a11y-calm *::before, html.a11y-calm *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.a11y-calm .app-toast, html.a11y-calm .rp-hint { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ── High contrast ── */
html.a11y-contrast {
  --primary: #000; --primary-light: #003a8c; --bg: #fff; --surface: #fff; --surface2: #fff; --border: #000;
  --text: #000; --text-muted: #1f1f1f; --accent: #8a4b00; --success: #0b5d1e; --danger: #a30000; --warning: #7a4a00; --info: #003a8c;
}
html.a11y-contrast body { background: #fff !important; color: #000 !important; }
html.a11y-contrast .card, html.a11y-contrast .content-item, html.a11y-contrast .as-card, html.a11y-contrast .as-box,
html.a11y-contrast .course-card, html.a11y-contrast .lms-topbar, html.a11y-contrast .app-bottom-nav { border: 2px solid #000 !important; box-shadow: none !important; background: #fff !important; }
html.a11y-contrast a:not(.nav-link):not(.abn-item):not(.skip-link) { color: #003a8c !important; text-decoration: underline !important; }
html.a11y-contrast .lms-sidebar { background: #000 !important; }
html.a11y-contrast .lms-sidebar .nav-link, html.a11y-contrast .lms-sidebar .nav-section,
html.a11y-contrast .lms-sidebar .student-id, html.a11y-contrast .lms-sidebar .brand-sub { color: #fff !important; opacity: 1 !important; }
html.a11y-contrast .lms-sidebar .nav-link.active { background: #ffd400 !important; color: #000 !important; }
html.a11y-contrast .text-muted, html.a11y-contrast small, html.a11y-contrast .content-meta, html.a11y-contrast .as-meta { color: #1f1f1f !important; }
html.a11y-contrast img { filter: none; }
