/* ============================================================
   ACCESSIBILITY WIDGET
   ============================================================ */

/* ── Toggle button ───────────────────────── */
.a11y-toggle {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 998;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--clr-primary);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,58,55,0.4);
    transition: transform 0.25s var(--ease), box-shadow 0.25s ease, background 0.2s ease;
}
.a11y-toggle:hover {
    transform: scale(1.08);
    background: var(--clr-primary-mid);
    box-shadow: 0 6px 28px rgba(0,58,55,0.5);
}
.a11y-toggle svg { width: 26px; height: 26px; }

/* ── Panel ───────────────────────────────── */
.a11y-panel {
    position: fixed;
    bottom: 90px;
    right: 28px;
    z-index: 997;
    width: 270px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.18);
    border: 1px solid rgba(0,58,55,0.1);
    overflow: hidden;
    transform-origin: bottom right;
    transition: opacity 0.25s ease, transform 0.25s var(--ease);
}
.a11y-panel[hidden] {
    display: none;
}
.a11y-panel.entering {
    animation: panelIn 0.25s var(--ease) forwards;
}
@keyframes panelIn {
    from { opacity: 0; transform: scale(0.88) translateY(12px); }
    to   { opacity: 1; transform: none; }
}

.a11y-panel-header {
    background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-primary-mid) 100%);
    color: #fff;
    padding: 1rem 1.25rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.a11y-panel-header h2 {
    font-size: 0.95rem;
    font-weight: 700;
}
.a11y-reset {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.75);
    background: none;
    border: none;
    font-family: var(--font);
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    transition: color 0.2s;
}
.a11y-reset:hover { color: #fff; }

/* ── Options list ────────────────────────── */
.a11y-options {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.a11y-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    border: 1.5px solid transparent;
    background: none;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--clr-text);
    cursor: pointer;
    text-align: right;
    width: 100%;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.a11y-btn:hover {
    background: rgba(0,58,55,0.06);
}
.a11y-btn.active {
    background: rgba(0,58,55,0.08);
    border-color: var(--clr-primary);
    color: var(--clr-primary);
}
.a11y-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--clr-primary);
}
.a11y-btn .a11y-label { flex: 1; }

/* Counter control (font size) */
.a11y-counter {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: auto;
}
.a11y-counter button {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--clr-primary);
    background: none;
    color: var(--clr-primary);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.15s ease;
}
.a11y-counter button:hover { background: rgba(0,58,55,0.1); }
.a11y-counter span {
    font-size: 0.82rem;
    font-weight: 600;
    min-width: 22px;
    text-align: center;
    color: var(--clr-primary);
}

.a11y-panel-footer {
    padding: 0.6rem 1.25rem 0.9rem;
    text-align: center;
    font-size: 0.72rem;
    color: var(--clr-text-muted);
    border-top: 1px solid rgba(0,58,55,0.07);
}
.a11y-panel-footer a {
    color: var(--clr-primary);
    text-decoration: underline;
}

/* ============================================================
   ACTIVE ACCESSIBILITY STATES (applied to <body>)
   ============================================================ */

/* High contrast — applied to sections only, not body (filter on body breaks position:fixed) */
body.a11y-high-contrast .hero,
body.a11y-high-contrast .events-videos,
body.a11y-high-contrast .testimonials,
body.a11y-high-contrast .contact-section,
body.a11y-high-contrast .site-footer {
    filter: contrast(1.6) saturate(0);
}

/* Large cursor */
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 2l16 12-7 1 4 9-3 1-4-9-6 5z' fill='%23003a37' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E") 2 2, auto !important;
}

/* Stop animations */
body.a11y-no-anim *,
body.a11y-no-anim *::before,
body.a11y-no-anim *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
}

/* Highlight links */
body.a11y-links a {
    outline: 2px solid var(--clr-accent) !important;
    outline-offset: 2px;
    text-decoration: underline !important;
}

/* Readable font */
body.a11y-readable-font,
body.a11y-readable-font * {
    font-family: Arial, sans-serif !important;
    letter-spacing: 0.03em;
    word-spacing: 0.1em;
    line-height: 1.8 !important;
}

/* ── Mobile ──────────────────────────────── */
@media (max-width: 640px) {
    .a11y-toggle { bottom: 20px; right: 20px; width: 46px; height: 46px; }
    .a11y-panel  { right: 12px; bottom: 78px; width: calc(100vw - 24px); }
}
