﻿/* =========================================================
   ACCESSIBILITY WIDGET
   ========================================================= */

.a11y-widget {
    position: fixed;
    left: 22px;
    bottom: calc(22px + env(safe-area-inset-bottom));
    z-index: 2500;
    font-family: "Inter", sans-serif;
}


/* =========================================================
   TRIGGER
   ========================================================= */

.a11y-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 11px 17px;
    border: 2px solid rgba(255,255,255,.65);
    border-radius: 999px;
    background: #0f1720;
    color: #fff;
    box-shadow: 0 12px 32px rgba(0,0,0,.25);
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

    .a11y-trigger:hover {
        background: #c6a75e;
        transform: translateY(-2px);
        box-shadow: 0 16px 36px rgba(0,0,0,.28);
    }

    .a11y-trigger svg {
        flex: 0 0 auto;
    }


/* =========================================================
   PANEL
   ========================================================= */

.a11y-panel {
    position: absolute;
    left: 0;
    bottom: 62px;
    width: min(370px, calc(100vw - 32px));
    max-height: min(650px, calc(100vh - 100px));
    overflow-y: auto;
    padding: 22px;
    background: #fff;
    border: 1px solid rgba(15,23,32,.12);
    border-radius: 20px;
    color: #17212b;
    box-shadow: 0 25px 75px rgba(0,0,0,.25);
}

    .a11y-panel[hidden] {
        display: none;
    }


/* HEADER */

.a11y-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid #eceef1;
}

.a11y-panel-kicker {
    display: block;
    margin-bottom: 3px;
    color: #a78332;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.a11y-panel h2 {
    margin: 0;
    color: #101820;
    font-size: 22px;
    line-height: 1.2;
}

.a11y-close {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    border: 0;
    border-radius: 50%;
    background: #f2f3f5;
    color: #17212b;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
}

    .a11y-close:hover {
        background: #17212b;
        color: #fff;
    }


/* =========================================================
   FONT SIZE
   ========================================================= */

.a11y-font-size {
    padding: 15px;
    margin-bottom: 13px;
    background: #f7f8f9;
    border: 1px solid #eceef1;
    border-radius: 14px;
}

.a11y-option-title {
    display: block;
    margin-bottom: 11px;
    color: #303943;
    font-size: 13px;
    font-weight: 800;
}

.a11y-font-controls {
    display: grid;
    grid-template-columns: 52px 1fr 52px;
    align-items: center;
    gap: 8px;
}

    .a11y-font-controls button {
        height: 40px;
        border: 1px solid #d9dde1;
        border-radius: 10px;
        background: #fff;
        color: #17212b;
        font-family: inherit;
        font-size: 16px;
        font-weight: 800;
        cursor: pointer;
    }

        .a11y-font-controls button:hover {
            background: #17212b;
            color: #fff;
        }

#a11yZoomValue {
    text-align: center;
    color: #a78332;
    font-size: 14px;
    font-weight: 800;
}


/* =========================================================
   OPTIONS
   ========================================================= */

.a11y-options {
    display: grid;
    gap: 8px;
}

.a11y-option {
    width: 100%;
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 11px;
    align-items: center;
    padding: 12px;
    border: 1px solid #e4e6e9;
    border-radius: 13px;
    background: #fff;
    color: #26313c;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    transition: .2s;
}

    .a11y-option:hover {
        border-color: rgba(198,167,94,.6);
        background: #fbfaf6;
    }

    .a11y-option[aria-pressed="true"] {
        background: #f7f1df;
        border-color: #c6a75e;
    }

.a11y-option-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #f2f3f5;
    color: #a78332;
    font-size: 18px;
    font-weight: 900;
}

.a11y-option strong,
.a11y-option small {
    display: block;
}

.a11y-option strong {
    margin-bottom: 2px;
    font-size: 13px;
}

.a11y-option small {
    color: #737d87;
    font-size: 10px;
    line-height: 1.35;
}


/* =========================================================
   RESET
   ========================================================= */

.a11y-reset {
    width: 100%;
    margin-top: 14px;
    padding: 11px;
    border: 1px solid #dfe2e5;
    border-radius: 11px;
    background: #f7f8f9;
    color: #444f59;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

    .a11y-reset:hover {
        background: #eceef1;
    }


/* =========================================================
   LINKS
   ========================================================= */

.a11y-panel-footer {
    display: grid;
    gap: 8px;
    margin-top: 17px;
    padding-top: 16px;
    border-top: 1px solid #eceef1;
}

    .a11y-panel-footer a {
        color: #82651f;
        font-size: 12px;
        font-weight: 800;
        text-decoration: underline;
        text-underline-offset: 3px;
    }


/* =========================================================
   GLOBAL ACCESSIBILITY STATES
   ========================================================= */


/* LINKS */

html.a11y-links a {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 4px !important;
}


/* TEXT SPACING */

html.a11y-spacing
:is( p, li, a, button, label, input, textarea, select, h1, h2, h3, h4, h5, h6 ) {
    line-height: 1.65 !important;
    letter-spacing: .035em !important;
    word-spacing: .10em !important;
}


/* REDUCED MOTION */

html.a11y-reduce-motion *,
html.a11y-reduce-motion *::before,
html.a11y-reduce-motion *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
}


/* HIGH CONTRAST */

html.a11y-contrast body {
    background: #000 !important;
    color: #fff !important;
}

    html.a11y-contrast body
    :is( header, footer, main, section, article, aside, nav, div ) {
        background-color: #000 !important;
        background-image: none !important;
        color: #fff !important;
        box-shadow: none !important;
    }

    html.a11y-contrast body
    :is( h1, h2, h3, h4, h5, h6, p, li, span, strong, small, label ) {
        color: #fff !important;
    }

    html.a11y-contrast body a {
        color: #ffdf57 !important;
    }

    html.a11y-contrast body
    :is( button, input, textarea, select ) {
        background: #000 !important;
        color: #fff !important;
        border: 2px solid #fff !important;
    }


/* widget remains clearly separated */

html.a11y-contrast .a11y-trigger {
    background: #000 !important;
    color: #ffdf57 !important;
    border-color: #ffdf57 !important;
}

html.a11y-contrast .a11y-panel {
    border: 2px solid #fff !important;
}


/* =========================================================
   FOCUS — ALWAYS ENABLED
   ========================================================= */

:focus-visible {
    outline: 3px solid #f4c842 !important;
    outline-offset: 4px !important;
}


/* =========================================================
   SKIP LINK
   ========================================================= */

.skip-to-content {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 10000;
    padding: 11px 16px;
    background: #000;
    color: #fff;
    border: 2px solid #f4c842;
    border-radius: 8px;
    font-weight: 800;
    transform: translateY(-160%);
    transition: transform .15s;
}

    .skip-to-content:focus {
        transform: translateY(0);
    }


/* =========================================================
   SYSTEM REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .a11y-widget {
        left: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom));
    }

    .a11y-trigger {
        width: 50px;
        height: 50px;
        justify-content: center;
        padding: 0;
    }

        .a11y-trigger > span {
            position: absolute;
            width: 1px;
            height: 1px;
            overflow: hidden;
            clip: rect(0,0,0,0);
            white-space: nowrap;
        }

    .a11y-panel {
        bottom: 61px;
        width: calc(100vw - 28px);
        padding: 18px;
    }
}
