/* =========================================================
   ACCESSIBILITY TOOLS (GIGW / WCAG 2.1)
   Widget markup is injected by assest/accessibility.js and
   appended directly to <body> as .a11y-root, so the page-level
   overrides below can exclude it with "body > *:not(.a11y-root)".
   Widget sizes are in px so they don't grow with the font-size tool.
   ========================================================= */

/* ---------- Toggle button ---------- */
.a11y-toggle {
    position: fixed;
    top: 330px;
    right: 0;
    z-index: 10001;
    width: 52px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #032c54;
    color: #fff;
    border: 2px solid #fff;
    border-right: none;
    border-radius: 10px 0 0 10px;
    font-size: 28px;
    cursor: pointer;
    box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease, width 0.2s ease;
}

    .a11y-toggle:hover,
    .a11y-toggle:focus-visible {
        background: #4285F4;
        width: 58px;
    }

    .a11y-toggle:focus-visible {
        outline: 3px solid #ffbf00;
        outline-offset: 2px;
    }

/* ---------- Panel ---------- */
.a11y-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 10002;
    width: 420px;
    max-width: calc(100vw - 32px);
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    background: #fff;
    color: #1f2937;
    box-shadow: -6px 0 30px rgba(0, 0, 0, 0.25);
    font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    letter-spacing: normal;
    word-spacing: normal;
    transform: translateX(105%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
}

    .a11y-panel.is-open {
        transform: translateX(0);
        visibility: visible;
        transition: transform 0.25s ease;
    }

.a11y-header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: #032c54;
    color: #fff;
}

    .a11y-header h2 {
        margin: 0;
        font-size: 20px;
        font-weight: 600;
        color: #fff;
        font-family: inherit;
    }

.a11y-close {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
}

    .a11y-close:hover,
    .a11y-close:focus-visible {
        background: rgba(255, 255, 255, 0.15);
        border-color: #fff;
    }

.a11y-body {
    padding: 8px 18px 20px;
}

.a11y-group {
    margin: 0;
    padding: 0;
    border: 0;
}

    .a11y-group legend {
        float: none;
        width: auto;
        margin: 14px 0 8px;
        padding: 0;
        font-size: 17px;
        font-weight: 500;
        color: #1f2937;
    }

.a11y-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.a11y-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 92px;
    padding: 10px 6px;
    background: #fff;
    color: #1f2937;
    border: 1px solid #b8bec7;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

    .a11y-btn i {
        font-size: 26px;
        line-height: 1;
    }

    .a11y-btn .a11y-glyph {
        font-size: 28px;
        font-weight: 500;
        line-height: 1;
    }

    .a11y-btn:hover {
        background: #f1f5fb;
        border-color: #4285F4;
    }

    .a11y-btn:focus-visible {
        outline: 3px solid #4285F4;
        outline-offset: 2px;
    }

    /* Active state: underlined label + green tick, as in the GIGW reference */
    .a11y-btn[aria-pressed="true"] {
        border-color: #1f2937;
        border-width: 2px;
    }

        .a11y-btn[aria-pressed="true"] .a11y-label {
            text-decoration: underline;
        }

        .a11y-btn[aria-pressed="true"]::after {
            content: "\f00c";
            font-family: "Font Awesome 6 Free";
            font-weight: 900;
            position: absolute;
            top: -7px;
            right: -7px;
            width: 22px;
            height: 22px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #0a7d1e;
            color: #fff;
            border: 2px solid #fff;
            border-radius: 50%;
            font-size: 11px;
        }

    /* High Contrast button is rendered dark when on, like the reference */
    .a11y-btn[data-a11y="contrast-high"][aria-pressed="true"] {
        background: #000;
        color: #fff;
    }

    .a11y-btn:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

.a11y-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    background: #032c54;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

    .a11y-reset:hover,
    .a11y-reset:focus-visible {
        background: #4285F4;
    }

.a11y-sr-only {
    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;
}

@media (max-width: 420px) {
    .a11y-btn {
        min-height: 84px;
        font-size: 13px;
    }

    .a11y-toggle {
        top: auto;
        bottom: 100px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .a11y-panel,
    .a11y-panel.is-open,
    .a11y-toggle {
        transition: none;
    }
}

/* =========================================================
   PAGE-LEVEL EFFECTS (classes are set on <html>)
   ========================================================= */

/* ---------- High contrast: black background, white text, yellow links ---------- */
html.a11y-contrast-high body,
html.a11y-contrast-high body > *:not(.a11y-root),
html.a11y-contrast-high body > *:not(.a11y-root) * {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

    /* Strip decorative gradients, but keep Bootstrap's carousel arrow icons */
    html.a11y-contrast-high body,
    html.a11y-contrast-high body > *:not(.a11y-root),
    html.a11y-contrast-high body > *:not(.a11y-root) *:not(.carousel-control-prev-icon):not(.carousel-control-next-icon) {
        background-image: none !important;
    }

    html.a11y-contrast-high body > *:not(.a11y-root) a,
    html.a11y-contrast-high body > *:not(.a11y-root) a * {
        color: #ff0 !important;
    }

    html.a11y-contrast-high body > *:not(.a11y-root) a {
        text-decoration: underline !important;
    }

    html.a11y-contrast-high body > *:not(.a11y-root) button,
    html.a11y-contrast-high body > *:not(.a11y-root) input,
    html.a11y-contrast-high body > *:not(.a11y-root) select,
    html.a11y-contrast-high body > *:not(.a11y-root) textarea {
        border: 1px solid #fff !important;
    }

/* ---------- Highlight links ---------- */
html.a11y-highlight-links body > *:not(.a11y-root) a {
    background-color: #ff0 !important;
    color: #000 !important;
    outline: 2px solid #000 !important;
    text-decoration: underline !important;
}

    html.a11y-highlight-links body > *:not(.a11y-root) a * {
        color: #000 !important;
    }

/* ---------- Invert / Saturation ----------
   Filters go on <html> (a filter on the root element does not break
   position:fixed). The widget is then counter-inverted so it stays readable,
   and photos are counter-inverted so they look natural. */
html.a11y-invert {
    filter: invert(1) hue-rotate(180deg);
}

html.a11y-saturation {
    filter: grayscale(1);
}

html.a11y-invert.a11y-saturation {
    filter: invert(1) hue-rotate(180deg) grayscale(1);
}

    html.a11y-invert .a11y-root,
    html.a11y-invert body > *:not(.a11y-root) img,
    html.a11y-invert body > *:not(.a11y-root) video,
    html.a11y-invert body > *:not(.a11y-root) iframe {
        filter: invert(1) hue-rotate(180deg);
    }

/* ---------- Text spacing (WCAG 1.4.12 values) ---------- */
html.a11y-text-spacing body > *:not(.a11y-root),
html.a11y-text-spacing body > *:not(.a11y-root) * {
    letter-spacing: 0.12em !important;
    word-spacing: 0.16em !important;
}

/* ---------- Line height ---------- */
html.a11y-line-height body > *:not(.a11y-root),
html.a11y-line-height body > *:not(.a11y-root) * {
    line-height: 1.9 !important;
}

/* ---------- Hide images ---------- */
html.a11y-hide-images body > *:not(.a11y-root) img,
html.a11y-hide-images body > *:not(.a11y-root) picture,
html.a11y-hide-images body > *:not(.a11y-root) video,
html.a11y-hide-images body > *:not(.a11y-root) svg {
    visibility: hidden !important;
}

html.a11y-hide-images body > *:not(.a11y-root),
html.a11y-hide-images body > *:not(.a11y-root) *:not(.carousel-control-prev-icon):not(.carousel-control-next-icon) {
    background-image: none !important;
}

/* ---------- Big cursor ---------- */
html.a11y-big-cursor,
html.a11y-big-cursor * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 11.5-6.6.9 3.9 7.3-2.8 1.5-3.9-7.4L4 20z' fill='%23000' stroke='%23fff' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E") 8 4, auto !important;
}

    html.a11y-big-cursor a,
    html.a11y-big-cursor a *,
    html.a11y-big-cursor button,
    html.a11y-big-cursor button *,
    html.a11y-big-cursor [role="button"],
    html.a11y-big-cursor label,
    html.a11y-big-cursor select {
        cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M9 1.5a1.8 1.8 0 0 1 1.8 1.8V11l.6-.1V8.8a1.7 1.7 0 0 1 3.3 0v2.4a1.7 1.7 0 0 1 3.2.6v1a1.6 1.6 0 0 1 3.1.7v4.3c0 3.4-2.6 5.7-6.1 5.7h-2.2c-2 0-3.4-.8-4.6-2.4L3.5 15.3a1.7 1.7 0 0 1 2.7-2.1l1-.1V3.3A1.8 1.8 0 0 1 9 1.5z' fill='%23fff' stroke='%23000' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E") 18 4, pointer !important;
    }
