/* ═══════════════════════════════════════════════════════════════
   BlueDXP — Shared Accessibility Styles (WCAG 2.1 AA)
   v1.49.0 · Block P7
   ═══════════════════════════════════════════════════════════════ */

/* ── Skip-to-content link ─────────────────────────────────────
   Hidden off-screen until focused; becomes a fixed banner so
   keyboard-only users can bypass the nav.                     */
.skip-to-content {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 10000;
}
.skip-to-content:focus {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  padding: 1rem 2rem;
  background: var(--org-primary, #2563eb);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  z-index: 10000;
  outline: 3px solid #fff;
  text-decoration: none;
}

/* ── Visible focus rings (legacy fallback) ───────────────────
   Canonical focus-visible styling now lives in /assets/design-tokens.css
   (A11Y-04). Keep this lightweight fallback for pages that only load
   a11y.css and not design-tokens.css.                           */
:where(
  a,
  button,
  input,
  select,
  textarea,
  summary,
  [role='button'],
  [role='tab'],
  [role='link'],
  [tabindex]:not([tabindex='-1'])
):focus-visible {
  outline: 2px solid var(--org-primary, #2563eb);
  outline-offset: 2px;
  box-shadow: var(--focus-ring, 0 0 0 2px #060a10, 0 0 0 4px #2563eb);
  border-radius: 6px;
}

/* ── Screen-reader only utility ───────────────────────────────
   Visually hidden but announced by assistive technology.
   Prefer this over display:none which hides from SR too.      */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Reduced-motion preference ────────────────────────────────
   WCAG 2.3.3 — respect OS-level motion preferences.          */
@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;
  }
}

/* ── High-contrast focus for dark mode ────────────────────── */
html[data-theme="dark"] :focus-visible {
  outline-color: #60a5fa;
}
