/* ============================================================
   Accessibility Widget — Start With Samantha
   ============================================================ */

/* ── Reading Bar (fixed top) ── */
#a11y-reading-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: #12355B;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 12px rgba(18, 53, 91, 0.35);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

#a11y-reading-bar.visible {
    transform: translateY(0);
}

#a11y-reading-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.a11y-bar-controls {
    display: flex;
    gap: 10px;
}

.a11y-bar-controls button {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.a11y-bar-controls button:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* Read Aloud option highlighted */
.a11y-option-highlight {
    background: #f0fafa;
    border-bottom: 1px solid #b2e0e0 !important;
}

/* ── Widget ── */
#a11y-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Inter', system-ui, sans-serif;
}

/* ── Trigger Button ── */
#a11y-trigger {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #12355B;
    border: 2.5px solid #1CA7A8;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(18, 53, 91, 0.38);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    z-index: 2;
}

#a11y-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 26px rgba(18, 53, 91, 0.48);
}

#a11y-trigger:focus-visible {
    outline: 3px solid #1CA7A8;
    outline-offset: 3px;
}

#a11y-trigger svg {
    width: 26px;
    height: 26px;
    fill: white;
}

/* ── Panel ── */
#a11y-panel {
    position: absolute;
    bottom: 66px;
    right: 0;
    width: 300px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(18, 53, 91, 0.22);
    border: 1px solid #C8E4EE;
    overflow: hidden;
    transform: translateY(12px);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    pointer-events: none;
}

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

/* ── Panel Header ── */
.a11y-header {
    background: #12355B;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.a11y-header h2 {
    font-size: 14px;
    font-weight: 700;
    color: white;
    margin: 0;
    letter-spacing: 0.3px;
}

#a11y-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    font-size: 18px;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

#a11y-close:hover { color: white; background: rgba(255,255,255,0.1); }

/* ── Font Size Row ── */
.a11y-font-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 18px;
    border-bottom: 1px solid #EAF6FA;
    background: #f8fcfe;
}

.a11y-font-label {
    font-size: 13px;
    font-weight: 600;
    color: #12355B;
}

.a11y-font-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.a11y-font-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1.5px solid #C8E4EE;
    background: white;
    color: #12355B;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}

.a11y-font-btn:hover { background: #EAF6FA; border-color: #1CA7A8; }

.a11y-font-size-display {
    font-size: 12px;
    font-weight: 600;
    color: #4A5568;
    min-width: 36px;
    text-align: center;
}

/* ── Option Rows ── */
.a11y-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid #EAF6FA;
    transition: background 0.15s;
}

.a11y-option:last-of-type { border-bottom: none; }
.a11y-option:hover { background: #f8fcfe; }

.a11y-option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #2B2B2B;
    cursor: pointer;
    user-select: none;
}

.a11y-option-icon { font-size: 16px; line-height: 1; }

/* ── Toggle Switch ── */
.a11y-toggle {
    position: relative;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

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

.a11y-toggle-slider {
    position: absolute;
    inset: 0;
    background: #CBD5E0;
    border-radius: 100px;
    transition: background 0.2s;
}

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

.a11y-toggle input:checked + .a11y-toggle-slider { background: #1CA7A8; }
.a11y-toggle input:checked + .a11y-toggle-slider::before { transform: translateX(18px); }

.a11y-toggle input:focus-visible + .a11y-toggle-slider {
    outline: 2px solid #1CA7A8;
    outline-offset: 2px;
}

/* ── Reset Button ── */
.a11y-reset-wrap {
    padding: 12px 18px;
    background: #f8fcfe;
    border-top: 1px solid #EAF6FA;
}

#a11y-reset {
    width: 100%;
    padding: 9px;
    border: 1.5px solid #C8E4EE;
    border-radius: 8px;
    background: white;
    color: #12355B;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

#a11y-reset:hover { background: #EAF6FA; border-color: #1CA7A8; }

/* ============================================================
   Accessibility Mode Overrides (applied to <html>)
   ============================================================ */

/* Dark Mode */
html.a11y-dark-mode {
    background: #0f172a;
    color: #e2e8f0;
}

html.a11y-dark-mode body {
    background: #0f172a;
    color: #e2e8f0;
}

html.a11y-dark-mode .site-header {
    background: #0a1628;
    border-bottom-color: #1e3a5f;
}

html.a11y-dark-mode .header-logo { color: #e2e8f0; }

html.a11y-dark-mode .hero {
    background: #0f172a;
    border-bottom-color: #1e293b;
}

html.a11y-dark-mode .hero-headline  { color: #f1f5f9; }
html.a11y-dark-mode .hero-subheadline { color: #cbd5e1; }
html.a11y-dark-mode .hero-trust     { color: #94a3b8; }

html.a11y-dark-mode .hero-form-card {
    background: #1e293b;
    border-color: #334155;
}

html.a11y-dark-mode .hero-form-title { color: #f1f5f9; }

html.a11y-dark-mode .form-group input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

html.a11y-dark-mode .form-group input::placeholder { color: #64748b; }
html.a11y-dark-mode .form-privacy { color: #94a3b8; }

html.a11y-dark-mode .section-white,
html.a11y-dark-mode .section-alt  { background: #1e293b; }

html.a11y-dark-mode .section-coral { background: #2d1f1c; border-color: #4a2820; }

html.a11y-dark-mode .section-heading,
html.a11y-dark-mode .cta-heading   { color: #f1f5f9; }

html.a11y-dark-mode .section-subheading,
html.a11y-dark-mode .brand-intro-text,
html.a11y-dark-mode .about-text,
html.a11y-dark-mode .social-desc,
html.a11y-dark-mode p              { color: #cbd5e1; }

html.a11y-dark-mode .benefit-card,
html.a11y-dark-mode .share-card,
html.a11y-dark-mode .tool-card     {
    background: #0f172a;
    border-color: #334155;
}

html.a11y-dark-mode .benefit-card h3,
html.a11y-dark-mode .share-card h3,
html.a11y-dark-mode .tool-card h3  { color: #f1f5f9; }

html.a11y-dark-mode .benefit-card p,
html.a11y-dark-mode .share-card p,
html.a11y-dark-mode .tool-card p   { color: #94a3b8; }

html.a11y-dark-mode .checklist-bullets li { color: #cbd5e1; border-bottom-color: #334155; }

html.a11y-dark-mode .highlight-box {
    background: #0f172a;
    border-color: #334155;
}

html.a11y-dark-mode .highlight-label { color: #94a3b8; }

html.a11y-dark-mode .warning-item {
    background: #1a1015;
    border-color: #4a2820;
}

html.a11y-dark-mode .warning-content h3 { color: #f1f5f9; }
html.a11y-dark-mode .warning-content p  { color: #94a3b8; }

html.a11y-dark-mode .value-cta-text {
    background: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}

html.a11y-dark-mode .checklist-mockup {
    background: #1e293b;
    border-color: #C9A054;
}

html.a11y-dark-mode .mockup-title    { color: #f1f5f9; }
html.a11y-dark-mode .mockup-subtitle { color: #94a3b8; }
html.a11y-dark-mode .mockup-item     { color: #cbd5e1; border-bottom-color: #334155; }
html.a11y-dark-mode .mockup-footer   { color: #64748b; border-top-color: #334155; }

html.a11y-dark-mode .affiliate-disclosure-inline {
    background: #1e2d1a;
    border-color: #4a6030;
    color: #a3b899;
}

html.a11y-dark-mode .site-footer { background: #070e1a; }

html.a11y-dark-mode .footer-brand-name { color: #f1f5f9; }
html.a11y-dark-mode .footer-tagline    { color: #64748b; }
html.a11y-dark-mode .footer-copy       { color: #64748b; }
html.a11y-dark-mode .disclaimer h4     { color: #f1f5f9; }
html.a11y-dark-mode .disclaimer p      { color: #64748b; }

html.a11y-dark-mode .btn-outline-navy {
    border-color: #1CA7A8;
    color: #1CA7A8;
}

html.a11y-dark-mode .btn-outline-navy:hover {
    background: #1CA7A8;
    color: #0f172a;
}

html.a11y-dark-mode .coral-eyebrow { color: #f87171; }

/* High Contrast */
html.a11y-high-contrast { filter: contrast(1.6); }
html.a11y-grayscale     { filter: grayscale(100%); }
html.a11y-high-contrast.a11y-grayscale { filter: contrast(1.6) grayscale(100%); }

html.a11y-dyslexia * {
    font-family: Arial, Verdana, Geneva, sans-serif !important;
    letter-spacing: 0.05em !important;
    word-spacing: 0.12em !important;
    line-height: 1.85 !important;
}

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

html.a11y-large-cursor,
html.a11y-large-cursor * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Cpath fill='%2312355B' stroke='white' stroke-width='2' d='M9 3L9 27L15 21L19 31L23 29.5L19 20L27 20Z'/%3E%3C/svg%3E") 0 0, auto !important;
}

html.a11y-pause-animations *,
html.a11y-pause-animations *::before,
html.a11y-pause-animations *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
}

html.a11y-focus-highlights *:focus,
html.a11y-focus-highlights *:focus-visible {
    outline: 3px solid #F26D5B !important;
    outline-offset: 3px !important;
    border-radius: 3px;
}
