/* ==========================================================
   Accessibility Widget — Component Styles
   Class prefix: a11y-widget
   ========================================================== */

.a11y-widget {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 110;
    isolation: isolate;
    display: flex;
    flex-direction: column-reverse;
}

.a11y-widget__toggle,
.a11y-widget__action,
.a11y-widget__statement-trigger,
.a11y-widget__reset,
.a11y-widget__close,
.a11y-widget__dialog-close {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.a11y-widget__toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 999px;
    background: linear-gradient(90deg, #0d546f 35%, #2aa9cb 100%);
    box-shadow: 0 10px 28px rgba(0, 58, 82, 0.28);
    color: #fff;
}

.a11y-widget__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.a11y-widget__label {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.1;
}

.a11y-widget__panel {
    width: min(320px, calc(100vw - 30px));
    margin-bottom: 12px;
    padding: 20px;
    border: 1px solid rgba(13, 84, 111, 0.18);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(0, 58, 82, 0.22);
}

.a11y-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.a11y-widget__title {
    margin: 0;
    color: #003a52;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.a11y-widget__close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #daeaea;
    color: #003a52;
    font-size: 28px;
    line-height: 1;
}

.a11y-widget__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.a11y-widget__action,
.a11y-widget__statement-trigger,
.a11y-widget__reset {
    min-height: 54px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #daeaea;
    color: #003a52;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.a11y-widget__action[aria-pressed="true"],
.a11y-widget__reset[aria-pressed="true"] {
    background: #003a52;
    color: #fff;
}

.a11y-widget__reset {
    width: 100%;
    margin-top: 12px;
    background: #f2be4a;
}

.a11y-widget__statement-trigger {
    width: 100%;
    margin-top: 12px;
    background: #edf6f9;
}

.a11y-widget__dialog[hidden] {
    display: none !important;
}

.a11y-widget__dialog {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.a11y-widget__dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 26, 36, 0.62);
}

.a11y-widget__dialog-panel {
    position: relative;
    width: min(720px, calc(100vw - 24px));
    max-height: min(80vh, 760px);
    overflow: auto;
    padding: 28px 24px 24px;
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 24px 56px rgba(0, 58, 82, 0.28);
    color: #003a52;
}

.a11y-widget__dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.a11y-widget__dialog-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
}

.a11y-widget__dialog-close {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: #daeaea;
    color: #003a52;
    font-size: 28px;
    line-height: 1;
}

.a11y-widget__dialog-content {
    font-size: 16px;
    line-height: 1.7;
}

.a11y-widget__dialog-content p {
    margin: 0 0 14px;
}

.a11y-widget__dialog-content ul {
    margin: 0 0 14px;
    padding: 0 20px 0 0;
}

.a11y-widget__dialog-content li {
    margin-bottom: 8px;
}

.a11y-widget__dialog-content a {
    color: #0d546f;
    font-weight: 700;
}

@media (max-width: 768px) {
    .a11y-widget {
        left: 12px;
        bottom: 12px;
    }

    .a11y-widget__toggle {
        padding: 12px 14px;
    }

    .a11y-widget__label {
        font-size: 15px;
    }

    .a11y-widget__panel {
        width: min(300px, calc(100vw - 24px));
        padding: 16px;
    }

    .a11y-widget__actions {
        grid-template-columns: 1fr;
    }

    .a11y-widget__dialog {
        padding: 12px;
    }

    .a11y-widget__dialog-panel {
        width: min(100vw - 16px, 100%);
        max-height: min(86vh, 760px);
        padding: 22px 18px 18px;
        border-radius: 22px;
    }

    .a11y-widget__dialog-title {
        font-size: 24px;
    }
}

/* ==========================================================
   Page Modifier Classes
   Applied to <html> / <body> by the JS
   ========================================================== */

body.a11y-readable-font,
body.a11y-readable-font button,
body.a11y-readable-font input,
body.a11y-readable-font select,
body.a11y-readable-font textarea {
    font-family: Arial, Helvetica, sans-serif !important;
}

html.a11y-underline-links a,
body.a11y-underline-links a {
    text-decoration: underline !important;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
}

body.a11y-grayscale::before {
    content: "";
    position: fixed;
    inset: 0;
    backdrop-filter: grayscale(1);
    z-index: 109;
    pointer-events: none;
}

body.a11y-high-contrast {
    background: #000 !important;
    color: #fff !important;
}

body.a11y-high-contrast a,
body.a11y-high-contrast h1,
body.a11y-high-contrast h2,
body.a11y-high-contrast h3,
body.a11y-high-contrast h4,
body.a11y-high-contrast h5,
body.a11y-high-contrast h6,
body.a11y-high-contrast p,
body.a11y-high-contrast span,
body.a11y-high-contrast li,
body.a11y-high-contrast td,
body.a11y-high-contrast th,
body.a11y-high-contrast label,
body.a11y-high-contrast button {
    color: #fff !important;
}

body.a11y-high-contrast .a11y-widget__panel {
    background: #000 !important;
    border-color: #fff !important;
    box-shadow: none !important;
}

body.a11y-high-contrast .a11y-widget__dialog-panel {
    background: #000 !important;
    color: #fff !important;
    border: 1px solid #fff !important;
    box-shadow: none !important;
}

body.a11y-high-contrast .a11y-widget__toggle {
    color: #fff !important;
}

body.a11y-high-contrast .a11y-widget__statement-trigger,
body.a11y-high-contrast .a11y-widget__dialog-close {
    background: #111 !important;
    color: #fff !important;
    border: 1px solid #fff !important;
}

body.a11y-high-contrast .a11y-widget__dialog-content a {
    color: #fff !important;
}
