/*
 * Accessibility helpers for the public site (loaded in app/Views/layouts/default.php).
 * Text size (A- / A / A+) is handled in partials/front/header.php.
 */

/* "Skip to main content": hidden until it receives keyboard focus */
.skip-link {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2000; /* above the sticky menu (1020) and modals (1055) */
    padding: .5rem 1rem;
    background: #185b91;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-120%);
}
.skip-link:focus {
    transform: translateY(0);
    color: #fff;
    outline: 3px solid #ffbf47;
    outline-offset: 0;
}

/* Breadcrumb strip under the banner (app/Helpers/page_helper.php) */
.page-breadcrumb .breadcrumb-item a {
    color: #185b91;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.page-breadcrumb .breadcrumb-item.active {
    color: #212529; /* Bootstrap's grey fails contrast on bg-light */
    font-weight: 600;
}

/* Main content receives focus from the skip link; no outline on the whole region */
#main-content:focus {
    outline: none;
}

/* Clearly visible keyboard focus on every link, button and form field */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible,
.btn:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible,
.form-check-input:focus-visible {
    outline: 3px solid #ffbf47 !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px #0b0c0c !important;
}

/* Required-field marker: the asterisk is read as "required" through aria-required instead */
.form-label .text-danger {
    font-weight: 700;
}

/* Bigger tap targets for checkboxes and radios (users with limited hand control) */
.form-check-input {
    width: 1.25em;
    height: 1.25em;
}

/* Respect the operating-system "reduce motion" setting (banner zoom, carousels, fades) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
