/* ============================================
   Accessibility Widget — accessibility-widget.css
   ============================================ */

/* ── Toggle Button ── */
#a11y-toggle {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 99999;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #2E307A;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    padding: 0;
}

#a11y-toggle:hover {
    background: #1B68B3;
    transform: scale(1.08);
}

#a11y-toggle:focus-visible {
    outline: 3px solid #1CA2DC;
    outline-offset: 3px;
}

#a11y-toggle svg {
    width: 26px;
    height: 26px;
    fill: #fff;
    pointer-events: none;
}

/* ── Panel ── */
#a11y-panel {
    position: fixed;
    bottom: 86px;
    left: 24px;
    z-index: 99998;
    width: 280px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    padding: 20px;
    font-family: sans-serif;
    transform: translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#a11y-panel.a11y-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

#a11y-panel h3 {
    margin: 0 0 16px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #2E307A;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* ── Rows ── */
.a11y-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #F0F0F0;
    gap: 8px;
}

.a11y-row:last-of-type {
    border-bottom: none;
}

.a11y-label {
    font-size: 0.88rem;
    color: #333;
    flex: 1;
}

/* ── Toggle Switch ── */
.a11y-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

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

.a11y-switch input:checked + .a11y-switch-track {
    background: #2E307A;
}

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

.a11y-switch input:checked + .a11y-switch-track::after {
    transform: translateX(20px);
}

.a11y-switch input:focus-visible + .a11y-switch-track {
    outline: 3px solid #1CA2DC;
    outline-offset: 2px;
}

/* ── Font size controls ── */
.a11y-font-controls {
    display: flex;
    gap: 6px;
}

.a11y-btn {
    width: 32px;
    height: 32px;
    border: 2px solid #2E307A;
    background: transparent;
    color: #2E307A;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.a11y-btn:hover {
    background: #2E307A;
    color: #fff;
}

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

/* ── Reset ── */
#a11y-reset {
    width: 100%;
    margin-top: 14px;
    padding: 9px;
    background: #F6F5F2;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #555;
    cursor: pointer;
    transition: background 0.15s;
}

#a11y-reset:hover { background: #e8e7e4; }

/* ── Applied states ── */
body.a11y-high-contrast {
    filter: contrast(1.5);
}

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

body.a11y-high-contrast.a11y-grayscale {
    filter: contrast(1.5) grayscale(1);
}

body.a11y-big-cursor *,
body.a11y-big-cursor {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M8 4l16 12-7 1 4 9-3 1-4-9-6 5z' fill='%232E307A' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E") 0 0, auto !important;
}

body.a11y-links-highlight a {
    text-decoration: underline !important;
    text-underline-offset: 3px;
    outline: 2px solid #1CA2DC;
    outline-offset: 2px;
    border-radius: 2px;
}
