/* base/_accessibility.css
   Accessibility helpers and reduced-motion handling.
*/

/* Focus ring default for every focusable element.

   A component may retune this ring (colour, width, offset) or replace it with a
   different indicator that is at least as visible — a ring drawn with
   `box-shadow`, a border-colour change, a `:focus-within` outline on a wrapper.
   A component must never declare `outline: none` on `:focus-visible` without
   painting such a replacement: that leaves keyboard focus with no visual
   position at all (WCAG 2.4.7 Focus Visible). `:focus:not(:focus-visible)`
   below is the supported way to suppress the ring for pointer interaction. */
:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Screen-reader-only utility */
.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;
}

/* Reduced motion – respect user's 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;
  }
}

/* Forced colors mode (Windows high contrast). */
@media (forced-colors: active) {
  :focus-visible {
    outline-color: Highlight;
  }
}
