/* ── Accessibility Widget ── */

#a11y-toggle {
    position: fixed;
    bottom: 100px;
    right: 12px;
    z-index: 10010;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background-color: #95162A;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(0,0,0,0.3);
    transition: background-color 0.2s, transform 0.2s;
}

#a11y-toggle:hover,
#a11y-toggle:focus {
    background-color: #7a1224;
    transform: scale(1.08);
    outline: 3px solid #95162A;
    outline-offset: 3px;
}

#a11y-toggle svg {
    width: 34px;
    height: 34px;
    fill: #ffffff;
}

/* Panel */
#a11y-panel {
    position: fixed;
    bottom: 176px;
    right: 12px;
    z-index: 10009;
    background: #ffffff;
    border: 2px solid #95162A;
    border-radius: 12px;
    padding: 24px 22px 20px;
    width: 300px;
    box-shadow: 0 6px 32px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    gap: 14px;
}

#a11y-panel.a11y-open {
    display: flex;
}

#a11y-panel h2 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-family: 'Cinzel', serif;
    color: #95162A;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 2px solid #95162A;
    padding-bottom: 10px;
}

/* Rows */
.a11y-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
}

.a11y-row span {
    font-size: 1rem;
    color: #2C2C2C;
    font-family: 'Lato', sans-serif;
    font-weight: 400;
}

/* Font size buttons */
.a11y-btn {
    background: #f9f3f3;
    border: 1.5px solid #95162A;
    color: #95162A;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    line-height: 1;
    min-width: 44px;
    text-align: center;
}

.a11y-btn:hover,
.a11y-btn:focus {
    background: #95162A;
    color: #ffffff;
    outline: 2px solid #95162A;
    outline-offset: 2px;
}

.a11y-font-controls {
    display: flex;
    gap: 6px;
}

/* Toggle switches */
.a11y-switch {
    position: relative;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.a11y-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.a11y-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 28px;
    cursor: pointer;
    transition: background 0.2s;
}

.a11y-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 4px;
    top: 4px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.a11y-switch input:checked + .a11y-slider {
    background: #95162A;
}

.a11y-switch input:checked + .a11y-slider::before {
    transform: translateX(24px);
}

.a11y-switch input:focus + .a11y-slider {
    outline: 2px solid #95162A;
    outline-offset: 2px;
}

/* Reset button */
#a11y-reset {
    margin-top: 4px;
    width: 100%;
    padding: 11px;
    background: transparent;
    border: 2px solid #95162A;
    color: #95162A;
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

#a11y-reset:hover,
#a11y-reset:focus {
    background: #95162A;
    color: #ffffff;
    outline: 2px solid #95162A;
    outline-offset: 2px;
}

/* ── Applied states ── */

html.a11y-high-contrast body {
    filter: contrast(1.6) brightness(0.95);
}

html.a11y-readable-font,
html.a11y-readable-font * {
    font-family: Arial, Helvetica, sans-serif !important;
}

html.a11y-underline-links a {
    text-decoration: underline !important;
}
