/* Accessibility helpers shared by FINDtxt.html and Video.html */

/* Text for screen readers only */
._c_sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* "Skip to ..." link: hidden until it gets keyboard focus */
._c_skip-link {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: bold;
    color: #000;
    background: #ffe600;
    transform: translateY(-120%);
}

._c_skip-link:focus {
    transform: none;
}

/* Visible keyboard focus everywhere (WCAG 2.4.7). The ring is yellow with a
   black edge so it shows on both the black page and the white buttons. */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #ffe600;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px #000;
}

/* The results box is focused by script after a choice; no ring needed there */
#_id_results:focus,
#_id_iframe:focus {
    outline: none;
    box-shadow: none;
}

/* Honour the "reduce motion" setting for every animation and transition */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* Windows High Contrast / forced colors: keep borders and focus visible */
@media (forced-colors: active) {
    ._c_search-input:focus,
    a:focus-visible,
    button:focus-visible,
    [role="button"]:focus-visible {
        outline: 3px solid Highlight;
    }
}
