/* BLACK SIGNAL — css/13-a11y.css (Accessibility utilities). Layer `a11y`: the
   last word in the cascade. Only cross-cutting rules live here — keyboard
   focus, reduced motion, link readability, and keeping hidden controls out of
   the tab order. Component colors that once needed contrast patches here are
   now set correctly where the component is defined (css/components/*.css);
   tests/a11y_e2e.py (axe-core) keeps them honest.

   The `!important`s below are deliberate: focus visibility and reduced motion
   must beat any component rule, in any layer. */
@layer a11y {

/* A visible keyboard focus ring everywhere. Many controls are clip-path
   shapes that cut off a ring drawn outside them, so buttons get an INSET ring
   in their own text color — it shows on orange and black alike and follows
   the color theme. On a sweep control the ring sits inside the orange fill. */
html :focus-visible { outline: 2px solid var(--orange) !important; outline-offset: 2px !important; }
html button:focus-visible,
html [role="button"]:focus-visible,
html [role="tab"]:focus-visible,
html [data-click]:focus-visible { outline: 2px solid currentColor !important; outline-offset: -4px !important; }
html input:focus-visible, html textarea:focus-visible, html select:focus-visible { outline-offset: 0 !important; }
/* Close (✕) buttons carry black ink on an accent cell, so the currentColor ring
   above painted a black box INSET in the cell — it read as a hard border. Give
   the whole close family the app's orange ring just OUTSIDE the cell instead:
   keyboard focus stays clearly visible, with no border-like box. */
html .bsm-close:focus-visible, html .shm-close:focus-visible,
html .bsh-close:focus-visible, html .bs-lvl-overlay-close:focus-visible,
html .bs-plan-close:focus-visible, html .bs-vm-close:focus-visible,
html .bs-lab-tut-close:focus-visible {
  outline: 2px solid var(--orange) !important; outline-offset: 2px !important;
}
/* The lab terminal's command line is a shell prompt: its blinking block caret is
   the focus indicator, exactly as in a terminal, so it carries no ring. */
html .linux-command-input:focus, html .linux-command-input:focus-visible { outline: none !important; }

/* Handbook chapter title and guided-tour step title are focused by script to
   move the reader (and screen readers) to the new content. They carry
   tabindex="-1", so they are never reached by Tab — the move-focus ring is a
   false positive, and the orange card/header is already the visible cue. */
html .bsh-title:focus, html .bsh-title:focus-visible,
html .bsh-spot-title:focus, html .bsh-spot-title:focus-visible { outline: none !important; }

/* Users who ask their system for less motion */
@media (prefers-reduced-motion: reduce) {
  html *, html *::before, html *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}

/* Policy links: readable without hovering */
html .bs-legal-links a { color: rgba(var(--ink-rgb, 244, 243, 240), 0.7); opacity: 1; }

/* Hidden controls must not take keyboard focus. These were hidden with
   opacity / max-height only, so Tab could land on something invisible.
   visibility switches off after the fade, so the animation is unchanged. */
html .theme-swatches:not(.open) { visibility: hidden; transition: max-height var(--dur) var(--ease-standard), opacity var(--dur) var(--ease-standard), visibility 0s linear var(--dur); }
html .bs-global-back--hidden { visibility: hidden; transition: opacity 0.2s, transform 0.2s, visibility 0s linear 0.2s; }
/* Hidden means hidden: the .hidden class and the hidden attribute beat any
   component's display (a key's inline-flex would otherwise keep it on screen). */
html .hidden, html [hidden] { display: none !important; }

/* Terminal [SYSTEM] prefixes were a dark orange (3.9:1 on the terminal). */
.tline-sys .tprefix, .tline-reset .tprefix { color: var(--orange); opacity: 1; }
.tline-sys .ttext, .tline-reset .ttext { color: rgba(var(--ink-rgb, 244, 243, 240), 0.78); opacity: 1; }

}
