/* Page structure helpers (Section 508 / WCAG 2.4.1, 1.3.1). Loaded by every portal page. */

/* Skip link: off-screen until focused, then pinned top-left. */
.skip-to-main-link {
    position: absolute;
    left: 8px;
    top: -200px;
    z-index: 10000;
    padding: 10px 16px;
    border-radius: 4px;
    background: #0f172a;
    color: #ffffff;
    font: 600 14px/1.2 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.35);
}

.skip-to-main-link:focus,
.skip-to-main-link:focus-visible {
    top: 8px;
    outline: 3px solid #38bdf8;
    outline-offset: 2px;
}

/* main gets tabindex="-1" so the skip link can focus it; the region itself needs no ring. */
main#main:focus {
    outline: none;
}

/* For a page H1 on screens that show no visible title: read by screen readers, not drawn. */
.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;
}

/* KAN-1126 (WCAG 1.4.4, 1.4.10): select and autocomplete lists. MudSelect writes its MaxHeight
   (300px) inline on the popover, which also turns off MudBlazor's own fit-to-window sizing. On a
   short window (200% zoom on a laptop) a 300px list fits neither above nor below the field, so it
   ran off screen with the highlighted option out of reach. Below 680px tall, cap the list at half
   the window less the field: one side of the field always has that much room, and MudBlazor's
   flip opens the list on that side. Taller windows keep the 300px list. */
@media (max-height: 679.98px) {
    .mud-popover:has(> .mud-list[role="listbox"]) {
        max-height: calc(50vh - 40px) !important;
    }
}
