/* public/css/a11y.css
   Shared IS 5568 / WCAG 2.2 AA accessibility primitives.
   Framework-free, RTL-aware, loaded by every page. */

/* Visually-hidden but present in the accessibility tree. */
.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;
}

/* Visually-hidden until focused (skip-link pattern). */
.sr-only-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Keyboard focus indicator — visible, >=3:1, applied everywhere.
   Suppressed for pointer interactions via :focus:not(:focus-visible). */
:focus-visible {
  outline: 3px solid #1A56C4;   /* brand-derived, >=3:1 on white and on brand fills */
  outline-offset: 2px;
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* Skip link — off-screen until focused, then pinned top (RTL-aware). */
.skip-link {
  position: fixed;
  top: 0; inset-inline-start: 0;
  z-index: 100000;
  background: #0B1220; color: #fff;
  padding: .6rem 1rem;
  font-weight: 700;
  border-radius: 0 0 .5rem 0;
  transform: translateY(-120%);
  transition: transform .15s ease;
}
.skip-link:focus { transform: translateY(0); }

/* Reduced-motion safety net (pages also self-declare). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
