/* n360-a11y-toolbar.css v1.8 - 3rd Sep 2026 - WCAG 2.2 batch 4: the "What does this mean?" button flows inline when the statement wraps on a phone  VERIFY-A11YB4-03SEP2026-R8-J5RDF */
/* (was v1.7 - batch 2: reduce motion, text spacing, highlight links, reset row  VERIFY-A11YB2-03SEP2026-R4-M8ZKW) */
/* (was v1.6 - r3: the "What does this mean?" button and the statement modal  VERIFY-A11YB1-03SEP2026-R3-H6QTV) */
/* (was v1.5 - WCAG 2.2 batch 1: pressed state and skip link on primary-fill; line endings normalised to CRLF  VERIFY-A11YB1-03SEP2026-K7WQD) */
/* (was v1.4 - 14th Jul 2026 16:00  VERIFY-102D-A11YTOOLBAR VERIFY-102E-A11YTOOLBARMAP VERIFY-102F-A11YLOGIN VERIFY-102G-A11YPROVIDER VERIFY-102H-A11YFOOTER) */
/* Accessibility toolbar - N360 house style. Behaviour: a11y-toolbar.js. Text size +
   contrast are applied server-side (data-fs / data-contrast on <html>) so there is
   no flash; these rules define what those attributes DO. Shared by every page that
   carries the toolbar, so it lives in its own file rather than per-page CSS. */

/* Text size: scale the root font so rem-based UI grows proportionally. */
html[data-fs="2"] { font-size: 112.5%; }
html[data-fs="3"] { font-size: 125%; }

/* High contrast: strengthen text + borders against the background. */
[data-contrast="1"] { --bs-secondary-color: #1a1a1a; --bs-border-color: #333; }
[data-contrast="1"][data-bs-theme="dark"] { --bs-secondary-color: #f2f2f2; --bs-border-color: #cfd8dd; }
[data-contrast="1"] .text-muted, [data-contrast="1"] .small.text-muted { color: var(--bs-secondary-color) !important; }
[data-contrast="1"] .card, [data-contrast="1"] .search-filter-card,
[data-contrast="1"] .pill-field, [data-contrast="1"] .border { border-color: var(--bs-border-color) !important; }

/* Button + panel. */
/* The toolbar trigger button - self-contained so it looks identical on every
   page (dashboard, results, login, provider) regardless of page-specific classes. */
.a11y-trigger {
    display: inline-flex; align-items: center; gap: .4rem;
    border: 1.5px solid var(--bs-border-color, #ced4da); background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #1a1a1a); border-radius: 50px; padding: .5rem 1rem;
    font-weight: 600; font-size: .85rem; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: border-color .2s, color .2s, transform .2s;
}
.a11y-trigger:hover { border-color: var(--n360-cyan); color: var(--n360-cyan); transform: translateY(-1px); }
.a11y-trigger:focus-visible { outline: 3px solid var(--n360-cyan); outline-offset: 2px; }
.a11y-wrap { position: relative; display: inline-block; }
.a11y-panel {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 10050;
    width: min(300px, calc(100vw - 24px));
    background: var(--bs-body-bg, #fff); color: var(--bs-body-color, #1a1a1a);
    border: 1px solid var(--bs-border-color, #dee2e6); border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0, 30, 48, .22); padding: 16px; display: none;
}
.a11y-panel.open { display: block; }
.a11y-title { font-size: 1rem; font-weight: 700; margin: 0 0 10px; display: flex; align-items: center; }
.a11y-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--bs-border-color, #e9ecef); }
.a11y-row > span { font-weight: 600; font-size: .92rem; }
.a11y-ctl { display: flex; gap: 6px; }
.a11y-ctl button {
    min-width: 40px; min-height: 40px; padding: 6px 12px;
    border: 1.5px solid var(--bs-border-color, #ced4da); background: transparent;
    color: var(--bs-body-color, #1a1a1a); border-radius: 10px; cursor: pointer; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    transition: border-color .15s, background .15s, color .15s;
}
.a11y-ctl button:hover { border-color: var(--n360-primary); color: var(--n360-primary); }
.a11y-ctl button[aria-pressed="true"] { background: var(--n360-primary-fill, #005a84); border-color: var(--n360-primary-fill, #005a84); color: var(--n360-on-primary, #fff); }
.a11y-ctl button:focus-visible { outline: 3px solid var(--n360-cyan); outline-offset: 2px; }

/* -- G2 foundations (focus-visible + reduced motion), shared so pages that load
   this a11y stylesheet (login, provider) get them without duplicating. Dashboard
   and results carry their own copies too (harmless - identical rules). -- */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible, .a11y-trigger:focus-visible {
    outline: 3px solid var(--n360-cyan, #00bde7) !important;
    outline-offset: 2px !important;
}
/* REDUCE MOTION - by the OS preference OR the Access-menu toggle (data-motion="reduce"), identical
   rules. KP's rule for it (24th Aug 2026): "if it's good enough for Stripe to allow a little spinner
   on reduce motion" - DISABLE DECORATION, KEEP STATE. Transitions, slide-ins, pulses and parallax
   are decoration and stop; a spinner is not decoration - it is the only thing telling somebody the
   system has not locked up - so the spinner classes get their animation back below. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important; animation-iteration-count: 1 !important;
        transition-duration: .001ms !important; scroll-behavior: auto !important;
    }
}
[data-motion="reduce"] *, [data-motion="reduce"] *::before, [data-motion="reduce"] *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
}
/* ...except the things that mean "working": Font Awesome's spin, Bootstrap's spinners, the feedback spinner. */
@media (prefers-reduced-motion: reduce) {
    .fa-spin { animation-name: fa-spin !important; animation-duration: 2s !important; animation-iteration-count: infinite !important; }
    .fa-spin-pulse { animation-name: fa-spin !important; animation-duration: 1s !important; animation-iteration-count: infinite !important; }
    .spinner-border, .spinner-grow, .fb-spinner { animation-duration: .75s !important; animation-iteration-count: infinite !important; }
}
[data-motion="reduce"] .fa-spin { animation-name: fa-spin !important; animation-duration: 2s !important; animation-iteration-count: infinite !important; }
[data-motion="reduce"] .fa-spin-pulse { animation-name: fa-spin !important; animation-duration: 1s !important; animation-iteration-count: infinite !important; }
[data-motion="reduce"] .spinner-border, [data-motion="reduce"] .spinner-grow, [data-motion="reduce"] .fb-spinner { animation-duration: .75s !important; animation-iteration-count: infinite !important; }

/* Existing AI loading rings must also remain active with the Access-menu setting. */
[data-motion="reduce"] .cs-spin, [data-motion="reduce"] .ond-spinner {
    animation-duration: 2.8s !important; animation-iteration-count: infinite !important;
}

/* TEXT SPACING - WCAG 1.4.12's own numbers (line height 1.5, letter spacing .12em, word spacing .16em,
   paragraph spacing 2em) applied as a user setting rather than only surviving when a user injects them.
   Icon glyphs are single characters and would grow a trailing gap, so they are excluded. */
[data-spacing="1"] :where(body, p, li, dt, dd, td, th, label, legend, a, span, small, strong, em, b, button, input, select, textarea, h1, h2, h3, h4, h5, h6, div):not([class*="fa-"]) {
    line-height: 1.5 !important; letter-spacing: .12em !important; word-spacing: .16em !important;
}
[data-spacing="1"] p { margin-bottom: 2em !important; }

/* HIGHLIGHT LINKS - for anyone who cannot rely on colour to find a link: every in-content link is
   underlined (thick, offset so it clears descenders) and gains an accent tint on hover. Buttons,
   nav links and the sidebar are already unmistakable and are left alone. */
[data-links="1"] a:not(.btn):not(.nav-link):not(.sidebar-link):not(.quick-link):not(.ql-row):not(.a11y-trigger) {
    text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: .18em !important;
}
[data-links="1"] a:not(.btn):not(.nav-link):not(.sidebar-link):not(.quick-link):not(.ql-row):not(.a11y-trigger):hover {
    background: rgba(var(--n360-accent-rgb, 0, 189, 231), .18) !important; border-radius: 3px;
}

/* The Reset row and its button - a quiet text button, full width, under the controls. */
.a11y-row-reset { justify-content: center; padding-top: 12px; }
.a11y-reset { background: none; border: 1px solid var(--bs-border-color, #ced4da); border-radius: 50rem; padding: .35rem .9rem; font: inherit; font-size: .82rem; font-weight: 600; color: var(--bs-body-color, #1a1a1a); cursor: pointer; }
.a11y-reset:hover { border-color: var(--n360-primary); color: var(--n360-primary); }

/* Skip link (shared) - first focusable element, hidden until focused. */
.skip-link {
    position: absolute; left: .5rem; top: -3.5rem; z-index: 100001;
    background: var(--n360-primary-fill, #005a84); color: var(--n360-on-primary, #fff); padding: .6rem 1rem;
    border-radius: 0 0 8px 8px; font-weight: 700; text-decoration: none; transition: top .15s ease;
}
.skip-link:focus { top: 0; outline: 3px solid var(--n360-cyan, #00bde7); outline-offset: 2px; }

/* Footer accessibility statement (shared partial _AccessibilityStatement). */
.a11y-statement { display: flex; align-items: flex-start; gap: .5rem; font-size: .8rem;
    color: var(--bs-body-color, #333); padding: .6rem 0; line-height: 1.5; }
.a11y-statement i { color: var(--n360-primary); margin-top: .12rem; flex-shrink: 0; font-size: .95rem; }
.a11y-statement a { color: var(--n360-primary); font-weight: 600; text-decoration: none; }
.a11y-statement a:hover { text-decoration: underline; }
/* r3: the "What does this mean?" trigger is a BUTTON (it opens a dialog, it does not navigate) styled as
   the statement's link so the sentence reads as one line. Keyboard: the shared :focus-visible ring. */
.a11y-what { display: inline; background: none; border: 0; padding: 0; margin: 0 .15rem; font: inherit; font-weight: 600; color: var(--n360-primary); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; } /* batch 4: display:inline - as an inline-block the button opened up the line box when the sentence wrapped on a phone */
.a11y-what:hover { text-decoration-thickness: 2px; }

/* ── THE ACCESSIBILITY STATEMENT MODAL (_AccessibilityStatement.cshtml) ──
   Bootstrap's modal does the chrome; this is the statement's own typography. Reads only the
   tokens and Bootstrap's mode-aware variables, so it is correct in dark mode and under every
   preset without a single override. Modelled on the TrueFit statement (v1.2, June 2026). */
.a11y-modal .modal-body { font-size: .92rem; line-height: 1.55; }
.a11y-modal .a11y-lead { font-size: .98rem; }
.a11y-modal .a11y-meta { display: flex; flex-wrap: wrap; gap: .4rem .5rem; margin: 0 0 1.2rem; font-size: .74rem; font-weight: 600; color: var(--bs-secondary-color); }
.a11y-modal .a11y-meta span { border: 1px solid var(--bs-border-color); border-radius: 50rem; padding: .15rem .65rem; }
.a11y-modal .a11y-h { font-family: 'Outfit', sans-serif; font-size: 1.05rem; font-weight: 700; margin: 1.35rem 0 .55rem; padding-top: 1rem; border-top: 1px solid var(--bs-border-color); }
.a11y-modal .a11y-std { display: grid; gap: .5rem; margin: 0 0 .9rem; }
.a11y-modal .a11y-std > div { display: grid; grid-template-columns: 7.5rem 1fr; gap: .75rem; align-items: baseline; }
.a11y-modal .a11y-std dt { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--n360-primary); }
.a11y-modal .a11y-std dd { margin: 0; }
.a11y-modal .a11y-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.a11y-modal .a11y-item { border: 1px solid var(--bs-border-color); border-left: 3px solid var(--n360-cyan); border-radius: 10px; padding: .8rem .95rem; background: var(--bs-body-bg); }
.a11y-modal .a11y-item h4 { font-family: 'Outfit', sans-serif; font-size: .92rem; font-weight: 700; margin: 0 0 .3rem; }
.a11y-modal .a11y-item p { margin: 0 0 .4rem; font-size: .86rem; }
.a11y-modal .a11y-item small { display: block; font-size: .7rem; color: var(--bs-secondary-color); }
.a11y-modal .a11y-todo { padding-left: 1.2rem; }
.a11y-modal .a11y-todo li { margin-bottom: .35rem; }
.a11y-modal .a11y-foot { margin: 1.2rem 0 0; font-size: .74rem; color: var(--bs-secondary-color); }
@media (max-width: 640px) {
    .a11y-modal .a11y-grid { grid-template-columns: 1fr; }
    .a11y-modal .a11y-std > div { grid-template-columns: 1fr; gap: .1rem; }
}
