/* Accessibility preferences (ADR 0037 D7). Applied from the data-* attributes a11y-prefs.js sets on
   <html> before first paint. Per-device, client-only - no server state. */

/* Text size: scale the root font so rem-based UI grows/shrinks proportionally. */
:root[data-text-size="112"] { font-size: 112.5%; }
:root[data-text-size="125"] { font-size: 125%; }

/* Motion: an explicit reduce override, in addition to the OS prefers-reduced-motion the app already
   honours. Neutralises animation/transition/scroll-behaviour app-wide. */
:root[data-motion="reduce"] *,
:root[data-motion="reduce"] *::before,
:root[data-motion="reduce"] *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
}

/* High-contrast focus rings: a bold, always-visible focus outline for keyboard users who want it. */
:root[data-contrast="on"] :focus-visible {
    outline: 3px solid #1a56db !important;
    outline-offset: 2px !important;
    border-radius: 2px;
}
:root[data-contrast="on"][data-bs-theme="dark"] :focus-visible {
    outline-color: #7ca7ff !important;
}

/* The settings page's own controls. */
.a11y-page { max-width: 40rem; }
.a11y-group { margin: 0 0 1.5rem; }
.a11y-group > legend { font-size: 1rem; font-weight: 600; margin-bottom: .35rem; }
.a11y-group .form-text { margin-top: 0; margin-bottom: .5rem; }
.a11y-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.a11y-option {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .4rem .75rem; border: 1px solid var(--bs-border-color); border-radius: 8px;
}
.a11y-preview {
    margin-top: .5rem; padding: 1rem 1.25rem;
    border: 1px solid var(--bs-border-color); border-radius: 10px; background: var(--bs-card-bg);
}
.a11y-preview p { margin: 0; }

/* Print sheet (ADR 0037 D7): a clean print of any MainLayout page - drop the chrome and floating
   widgets so the content prints on white. The concept-page print sheet (ADR 0034) is separate. */
@media print {
    .site-header, .site-footer, header.mdx-header, footer.mdx-footer,
    .mx-cookie, .wa-float, .whatsapp-float, .mdx-whatsapp,
    .reconnect-modal, #components-reconnect-modal,
    .admin-sidebar, .admin-mobilebar,
    [data-print-hide] {
        display: none !important;
    }

    body { background: #fff !important; }
    main, .mdx-main, .admin-main { padding: 0 !important; }
}
