/* Accessibility fixes for the logged-in pages (base.html). Loaded after the legacy sheets
   (style_both_v24.css, login.css), before each page's own CSS. WCAG 2.1 AA. */

/* Skip link: hidden until focused (2.4.1) */
.skip-link { position: absolute; left: -9999px; top: 0; transition: none !important; }
.skip-link:focus { left: 16px; top: 16px; z-index: 10000; background: #1fc2b5; color: #031413; padding: 8px 12px; border-radius: 8px; font-weight: 700; text-decoration: none; }
#main:focus { outline: none; } /* the skip target; focus lands here only from the skip link */

/* Visible keyboard focus everywhere (2.4.7) */
:focus-visible { outline: 2px solid #1fc2b5; outline-offset: 2px; }

/* Search boxes in the filter bar: the same focus glow as the date and select fields */
.fb-search:focus-within { box-shadow: 0 0 0 3px rgba(31, 194, 181, .18); }

/* Prop rows open the player panel from the keyboard (projections-v36.js / bestvalue-v36.js) */
tr.prop-row:focus-visible { outline: 2px solid #1fc2b5; outline-offset: -2px; }
tr.prop-row:focus-visible td { background: #0f2321; }

/* Legacy element colours were dark gray (#333-#666) on the near-black lab background: ~2-3.6:1 contrast (1.4.3).
   :where() keeps these at element specificity, so any class-based colour still wins. */
:where(body:has(.lab-page)) p,
:where(body:has(.lab-page)) h2 { color: inherit; }
:where(body:has(.lab-page)) a { color: #1fc2b5; }
:where(body:has(.lab-page)) a:hover { color: #5ff0e2; }
/* Links inside running text need more than colour to stand out (1.4.1) */
:where(body:has(.lab-page)) :where(p, li) > a:not([class]) { text-decoration: underline; text-underline-offset: 2px; }

/* Scrolling announcement banner: pause button, and no motion for people who ask for less (2.2.2, 2.3.3) */
.ticker-wrap { position: relative; }
.ticker-pause {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); z-index: 2;
  min-width: 32px; min-height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid currentColor;
  background: #0f2321; color: inherit; font: 700 12px/1 Inter, system-ui, sans-serif; cursor: pointer;
}
/* Paused: the whole message as still text, wrapped to fit */
.ticker-wrap.paused { height: auto; line-height: 1.4; padding: 8px 56px 8px 16px; }
.ticker-wrap.paused .ticker { animation: none; position: static; padding-left: 0; white-space: normal; line-height: 1.4; }

/* The Pause button on looping demo videos is styled by static/java/a11y.js */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .ticker-wrap { height: auto; line-height: 1.4; padding: 8px 16px; }
  .ticker { animation: none !important; position: static; padding-left: 0; white-space: normal; line-height: 1.4; }
  .ticker-pause { display: none; }
}
