/* =========================================================
   Accessibility widget — floating launcher + adjustments panel
   ========================================================= */

.a11y-fab {
    position: fixed;
    bottom: 24px;
    inset-inline-end: 24px;
    z-index: 165;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--ink-700);
    color: var(--gold-light);
    border: 1px solid rgba(175, 163, 123, .45);
    box-shadow: var(--shadow-deep);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease),
                background-color .3s var(--ease), opacity .25s var(--ease);
}
.a11y-fab svg { width: 27px; height: 27px; }
.a11y-fab:hover {
    background: var(--ink-600);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 18px 34px -8px rgba(175, 163, 123, .55);
}
.a11y-fab[aria-expanded="true"] {
    opacity: 0;
    pointer-events: none;
    transform: scale(.6);
}

.a11y-panel {
    position: fixed;
    bottom: calc(24px + 66px);
    inset-inline-end: 24px;
    z-index: 165;
    width: min(320px, calc(100vw - 32px));
    max-height: min(560px, calc(100vh - 120px));
    display: flex;
    flex-direction: column;
    background: var(--ink-900);
    border: 1px solid rgba(175, 163, 123, .3);
    border-radius: var(--radius);
    box-shadow: var(--shadow-deep);
    overflow: hidden;
    transform-origin: bottom left;
}
[dir="rtl"] .a11y-panel { transform-origin: bottom right; }
.a11y-panel[hidden] { display: none; }

.a11y-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(175, 163, 123, .22);
    flex: none;
}
.a11y-head strong {
    font-family: var(--font-display);
    font-size: 16.5px;
    font-weight: 700;
    color: var(--tx-inverse);
}
.a11y-close {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--tx-inverse-soft);
    font-size: 20px;
    line-height: 1;
    transition: background-color .2s var(--ease), color .2s var(--ease);
}
.a11y-close:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.a11y-body {
    padding: 14px 16px 6px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.a11y-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
}
.a11y-row-label {
    font-size: 14.5px;
    font-weight: 500;
    color: var(--tx-inverse);
}
.a11y-font-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}
.a11y-font-controls button {
    min-width: 38px;
    height: 38px;
    border-radius: 8px;
    color: var(--tx-inverse);
    font-weight: 600;
    font-size: 14px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.a11y-font-controls button:hover { background: rgba(175, 163, 123, .18); border-color: rgba(175, 163, 123, .5); }
#a11yFontVal { min-width: 46px; font-size: 12.5px; color: var(--tx-inverse-soft); }

.a11y-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid transparent;
    color: var(--tx-inverse);
    font-size: 14.5px;
    font-weight: 500;
    text-align: start;
    transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.a11y-toggle:hover { background: rgba(255, 255, 255, .07); }
.a11y-toggle svg { flex: none; width: 20px; height: 20px; color: var(--gold-light); }
.a11y-toggle-switch {
    margin-inline-start: auto;
    flex: none;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    position: relative;
    transition: background-color .25s var(--ease);
}
.a11y-toggle-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: inset-inline-start .25s var(--ease);
}
.a11y-toggle[aria-pressed="true"] {
    background: rgba(175, 163, 123, .16);
    border-color: rgba(175, 163, 123, .5);
}
.a11y-toggle[aria-pressed="true"] .a11y-toggle-switch { background: var(--gold); }
.a11y-toggle[aria-pressed="true"] .a11y-toggle-switch::after { inset-inline-start: 19px; }

.a11y-foot {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px 16px;
    margin-top: 4px;
}
.a11y-reset {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--tx-inverse-soft);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color .2s var(--ease);
}
.a11y-reset:hover { color: #fff; }
.a11y-statement-link {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gold-light);
    transition: color .2s var(--ease);
}
.a11y-statement-link:hover { color: #fff; }

@media (max-width: 560px) {
    .a11y-fab { width: 52px; height: 52px; bottom: 18px; inset-inline-end: 18px; }
    .a11y-panel { bottom: calc(18px + 62px); inset-inline-end: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .a11y-fab, .a11y-panel, .a11y-toggle, .a11y-toggle-switch, .a11y-toggle-switch::after,
    .a11y-close, .a11y-font-controls button { transition: none !important; }
}

/* =========================================================
   Effect classes — applied on <html> by js/accessibility.js
   ========================================================= */

html.a11y-underline a { text-decoration: underline !important; text-underline-offset: 3px; }

html.a11y-readable body {
    letter-spacing: .02em !important;
}
html.a11y-readable p,
html.a11y-readable li,
html.a11y-readable .hero-lead,
html.a11y-readable .card-sub {
    line-height: 1.95 !important;
    word-spacing: .04em;
}

html.a11y-stop-anim *,
html.a11y-stop-anim *::before,
html.a11y-stop-anim *::after {
    animation-play-state: paused !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

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

/* High contrast: blunt, deliberate overrides — guarantees AAA-level contrast
   regardless of the section's normal design tokens. */
html.a11y-contrast body { background: #000 !important; }
html.a11y-contrast * {
    background-color: #000 !important;
    background-image: none !important;
    color: #fff !important;
    border-color: #808080 !important;
    text-shadow: none !important;
    box-shadow: none !important;
}
html.a11y-contrast a,
html.a11y-contrast button,
html.a11y-contrast .hero-title em {
    color: #FFD84D !important;
    -webkit-text-fill-color: #FFD84D !important;
}
html.a11y-contrast .btn-gold,
html.a11y-contrast .btn { border: 2px solid #FFD84D !important; }
html.a11y-contrast img { filter: grayscale(1) contrast(1.15); opacity: .92; }
html.a11y-contrast .a11y-toggle[aria-pressed="true"] { background: #1a1a1a !important; }
