/* Shared accessibility primitives for RadarNet CSS entry points. */
.skip-link {
    position: absolute;
    inset-inline-start: 12px;
    top: 8px;
    z-index: 10000;
    padding: 8px 14px;
    background: var(--primary, #135bec);
    color: #fff;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.skip-link:not(:focus):not(:focus-visible) {
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
    box-shadow: none;
}

.skip-link:focus,
.skip-link:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

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

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

/* ── Font-size scale (toggled by a11y widget) ── */
html[data-font-size="large"]   { font-size: 18px; }
html[data-font-size="larger"]  { font-size: 20px; }
html[data-font-size="largest"] { font-size: 22px; }

/* ── Greyscale mode ── */
html[data-greyscale="on"] { filter: grayscale(100%); }

/* ── Manual reduce-motion override ── */
html[data-reduce-motion="on"] *,
html[data-reduce-motion="on"] *::before,
html[data-reduce-motion="on"] *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

/* ── High-contrast override ── */
html[data-contrast="high"] {
    --text: #000000;
    --muted: #222222;
    --bg: #ffffff;
    --surface: #ffffff;
    --border: #000000;
    --primary: #00008B;
    --primary-hover: #00006A;
    --surface-hover: #eeeeee;
}
html[data-contrast="high"] * {
    box-shadow: none !important;
}
html[data-contrast="high"] a { color: #00008B; text-decoration: underline; }

/* ── Floating accessibility widget ── */
.a11y-widget {
    position: fixed;
    inset-block-end: 24px;
    inset-inline-end: 16px;
    z-index: var(--z-toast, 90);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.a11y-widget__btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--primary, #4A357D);
    background: var(--surface, #fff);
    color: var(--primary, #4A357D);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(74,53,125,.25);
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}
.a11y-widget__btn:hover,
.a11y-widget__btn[aria-expanded="true"] {
    background: var(--primary, #4A357D);
    color: #fff;
}
.a11y-widget__btn:focus-visible {
    outline: 3px solid var(--primary, #4A357D);
    outline-offset: 3px;
}

.a11y-widget__panel {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #CFC6EC);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(74,53,125,.18);
    padding: 16px;
    min-width: 220px;
    display: none;
    flex-direction: column;
    gap: 14px;
}
.a11y-widget__panel.is-open { display: flex; }

.a11y-widget__section-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted, #4A4366);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.a11y-font-btns {
    display: flex;
    gap: 6px;
}
.a11y-font-btn {
    flex: 1;
    padding: 6px 4px;
    border: 1px solid var(--border, #CFC6EC);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: var(--text, #1A1430);
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    transition: background 0.12s, border-color 0.12s;
}
.a11y-font-btn:hover { background: var(--surface-hover, #EDE8F8); }
.a11y-font-btn.is-active {
    background: var(--primary, #4A357D);
    color: #fff;
    border-color: var(--primary, #4A357D);
}

.a11y-contrast-btn {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border, #CFC6EC);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: var(--text, #1A1430);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    transition: background 0.12s;
}
.a11y-contrast-btn:hover { background: var(--surface-hover, #EDE8F8); }
.a11y-contrast-btn.is-active {
    background: var(--primary, #4A357D);
    color: #fff;
    border-color: var(--primary, #4A357D);
}

.a11y-statement-link {
    font-size: 12px;
    color: var(--primary, #4A357D);
    text-decoration: underline;
    text-align: center;
}
