/* Shared WCAG 2.2 AA interaction and reflow safeguards. */
.skip-link {
    position: fixed;
    top: .5rem;
    left: .5rem;
    z-index: 20000;
    padding: .75rem 1rem;
    border-radius: .35rem;
    background: #fff;
    color: #111;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .35);
    transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.visually-hidden-focusable:not(:focus):not(:focus-within),
.a11y-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid #ffbf47 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 2px #111 !important;
}

:where(button, .btn, input:not([type="hidden"]), select, textarea, summary) {
    min-height: 44px;
}

:where(.nav-link, .sidebar-nav a, .footerLinks, .pagination a, .pagination button) {
    min-height: 24px;
    min-width: 24px;
}

.field-error,
.a11y-field-error { color: #9f1d20; font-size: .875rem; margin-top: .35rem; }
[aria-invalid="true"] { border-color: #b42318 !important; }

.a11y-table-region {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

.gallery-item:focus-visible { outline-offset: -4px !important; }
.gallery-lightbox[hidden] { display: none !important; }
.gallery-lightbox[aria-hidden="false"] { display: flex; }

@media (max-width: 575.98px) {
    .content-header, .header-left, .header-right { flex-wrap: wrap; }
    .table th, .table td { white-space: normal; overflow-wrap: anywhere; }
}

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

@media (forced-colors: active) {
    :where(a, button, input, select, textarea):focus-visible { outline: 3px solid CanvasText !important; }
}
