/* Exigent accessibility baseline — plain-CSS port of
   vendor/exigent/silverstripe-accessibility/client/scss/_a11y.scss.
   The module ships an SCSS partial that uses %placeholder/@extend, but this
   theme's Sass is not built in this repo (only the compiled style.min.css is
   committed), so the partial is inlined here as plain CSS and required after
   style.min.css. Keep the two in step if the module's partial changes. */

/* --- Visually hidden: available to screen readers, not to the eye.
       Bootstrap 4.6 ships .sr-only, Bootstrap 5 .visually-hidden — define both. */
.visually-hidden,
.sr-only,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
    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;
}

/* --- Skip links --- */
.skip-links .skip-link {
    display: inline-block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10000;
    padding: .75rem 1rem;
    background: #000;
    color: #fff;
    text-decoration: underline;
}
.skip-links .skip-link:focus {
    outline: 3px solid currentColor;
    outline-offset: 2px;
}

/* --- Visible focus.
       A TWO-TONE ring, because this site paints block backgrounds from #FFFFFF
       through #009E4D to #000000 and no single colour holds the 3:1 that WCAG 2.2
       SC 2.4.13 wants against all of them (blue #2563eb drops to 1.07:1 on
       bruinprim). White inner + near-black outer always leaves one contrasting;
       worst case across every configured background is 5.39:1.
       Kept deliberately THIN — 1px white + 2px dark, 3px total. The first cut used
       3px + 6px and read as a heavy black slab on form fields. --- */
:focus-visible {
    outline: 2px solid #111111;
    outline-offset: 1px;
    box-shadow: 0 0 0 1px #ffffff;
    border-radius: 2px;
}
/* Inputs already carry a border and Bootstrap's own focus shadow; a plain offset
   outline is enough there and avoids doubling up. */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #111111;
    outline-offset: 1px;
    box-shadow: none;
}
/* Keyboard users stay covered on engines where :focus-visible does not apply,
   while mouse clicks keep their clean look. */
:focus:not(:focus-visible) {
    outline: none;
}

/* --- Spam honeypot.
       The "Fax" field is a bot trap: anything typed into it rejects the
       submission. It was only ever made SMALL (width:100px;height:10px in the
       theme), never hidden, so it stayed reachable — and the module's form-holder
       markup made it plainly visible. A sighted user can now see it, and a
       keyboard or screen-reader user could tab into it and have their genuine
       enquiry silently discarded. Take it out of the accessibility tree and the
       tab order entirely; the controller also sets tabindex/aria-hidden. --- */
#Form_ContactForm_Fax_Holder,
label[for="Form_ContactForm_Fax"] {
    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;
}

/* --- Respect the OS reduced-motion setting.
       This site runs a hero carousel and scroll animations. --- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- Form error / required treatment --- */
.form-group.has-error .form-label { color: #b91c1c; }
.form-group.has-error .form-control { border-color: #b91c1c; }
.form-group.has-error .invalid-feedback {
    display: block;
    color: #b91c1c;
    font-size: .875rem;
    margin-top: .25rem;
}

/* --- Windows High Contrast / forced-colors --- */
@media (forced-colors: active) {
    .btn,
    .form-control,
    .skip-link {
        border: 1px solid CanvasText;
    }
}
