/* a11y.css — accessibility baseline (core, WP0c; navigation.md A11Y). Loaded after app.css on every page. */

:root {
  --focus-ring: var(--accent);
  --env-band-h: 0px;
  --sticky-top: calc(var(--env-band-h) + var(--header-h) + var(--banner-h, 0px));
}

/* The hidden attribute always wins over a class that sets display. */
[hidden] { display: none !important; }

/* Visible focus: a real outline (a box-shadow alone disappears in forced-colors mode). */
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.grid td:focus-visible, .grid th:focus-visible, .result-grid td:focus-visible { outline-offset: -2px; }

/* Focus not obscured by the sticky top bar, the session banner or the bottom bars. */
html {
  scroll-padding-top: calc(var(--sticky-top) + .5rem);
  scroll-padding-bottom: calc(var(--bars-h, 0px) + .5rem);
}
tr:target { scroll-margin-top: var(--sticky-top); }
tr:target > td { background: color-mix(in srgb, var(--accent-soft) 80%, transparent); }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 200;
  padding: .5rem 1rem;
  background: var(--panel);
  color: var(--fg);
  border: 2px solid var(--focus-ring);
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: .5rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  :focus-visible { outline: 2px solid CanvasText; }
  .kind-badge, .priv-icon, .null-badge { border: 1px solid CanvasText; }
}
