/* ============================================================
   THE LIGHT METHOD - Accessibility Addon
   WCAG 2.1 AA  |  RTL Hebrew  |  Website Version
   ============================================================ */

/* ── Skip to Main Content ── */
.skip-link {
    position: absolute;
    top: -100%;
    right: 0;
    left: 0;
    width: fit-content;
    margin: 0 auto;
    padding: 12px 28px;
    background: #2E2E2E;
    color: #fff;
    font-family: 'Heebo', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    z-index: 999999;
    border-radius: 0 0 10px 10px;
    text-align: center;
    transition: top 0.15s ease;
}
.skip-link:focus {
    top: 0;
    outline: 3px solid var(--gold, #C9A96E);
    outline-offset: 2px;
}

/* ── Floating Widget Container ── */
#a11y-widget {
    position: fixed;
    left: 20px;
    bottom: 24px;
    z-index: 99990;
    direction: rtl;
    font-family: 'Heebo', sans-serif;
}

/* ── Toggle Button ── */
#a11y-toggle-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--sage-dark, #8BA888);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}
#a11y-toggle-btn:hover {
    transform: scale(1.07);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
}
#a11y-toggle-btn:focus-visible {
    outline: 3px solid var(--gold, #C9A96E);
    outline-offset: 3px;
}
#a11y-toggle-btn .a11y-sr-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ── Panel ── */
#a11y-panel {
    position: absolute;
    bottom: 66px;
    left: 0;
    width: 310px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 48px rgba(0, 0, 0, 0.16);
    overflow: hidden;
    direction: rtl;
    transition: opacity 0.18s ease, transform 0.18s ease;
    transform-origin: bottom left;
}
#a11y-panel[hidden] {
    display: none;
}

/* Panel header */
.a11y-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--sage-dark, #8BA888);
    color: #fff;
}
.a11y-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.a11y-header-icon {
    font-size: 1.3rem;
    line-height: 1;
}
.a11y-header h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: #fff;
}
#a11y-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    line-height: 1;
    display: flex;
    align-items: center;
}
#a11y-close-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Panel body */
.a11y-body {
    padding: 14px 18px;
    max-height: 68vh;
    overflow-y: auto;
}

/* Group */
.a11y-group {
    margin-bottom: 12px;
}
.a11y-group-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 7px;
}

/* Segmented buttons */
.a11y-btn-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.a11y-btn {
    padding: 7px 12px;
    border-radius: 8px;
    border: 2px solid #ddd;
    background: #fff;
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
    color: #444;
}
.a11y-btn:hover {
    border-color: var(--sage-dark, #8BA888);
    background: #f5f5f5;
}
.a11y-btn[aria-pressed="true"] {
    border-color: var(--sage-dark, #8BA888);
    background: var(--sage-dark, #8BA888);
    color: #fff;
}
.a11y-btn:focus-visible {
    outline: 2px solid var(--sage-dark, #8BA888);
    outline-offset: 2px;
}

/* Toggle buttons */
.a11y-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 13px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    background: #fff;
    font-family: inherit;
    font-size: 0.86rem;
    cursor: pointer;
    transition: all 0.15s;
    color: #333;
    text-align: right;
}
.a11y-toggle-btn:hover {
    border-color: var(--sage-dark, #8BA888);
    background: #fafafa;
}
.a11y-toggle-btn[aria-pressed="true"] {
    border-color: var(--sage-dark, #8BA888);
    background: rgba(139, 168, 136, 0.08);
}
.a11y-toggle-btn:focus-visible {
    outline: 2px solid var(--sage-dark, #8BA888);
    outline-offset: 2px;
}

/* Toggle switch indicator */
.a11y-switch {
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: #ccc;
    position: relative;
    flex-shrink: 0;
    margin-right: 10px;
    transition: background 0.2s;
}
.a11y-switch::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    top: 2px;
    right: 2px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.a11y-toggle-btn[aria-pressed="true"] .a11y-switch {
    background: var(--sage-dark, #8BA888);
}
.a11y-toggle-btn[aria-pressed="true"] .a11y-switch::after {
    transform: translateX(-16px);
}

/* Divider */
.a11y-divider {
    height: 1px;
    background: #eee;
    margin: 10px 0;
}

/* Reset button */
.a11y-reset-btn {
    width: 100%;
    padding: 9px;
    background: none;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.82rem;
    color: #777;
    cursor: pointer;
    margin-bottom: 0;
    transition: all 0.15s;
}
.a11y-reset-btn:hover {
    border-color: #bbb;
    color: #444;
}
.a11y-reset-btn:focus-visible {
    outline: 2px solid var(--sage-dark, #8BA888);
    outline-offset: 2px;
}

/* Statement link */
.a11y-statement-link {
    display: block;
    text-align: center;
    padding: 11px;
    font-size: 0.82rem;
    color: var(--sage-dark, #8BA888);
    text-decoration: underline;
    border-top: 1px solid #eee;
    background: #fafafa;
}
.a11y-statement-link:hover {
    color: var(--sage, #A3B8A0);
}
.a11y-statement-link:focus-visible {
    outline: 2px solid var(--sage-dark, #8BA888);
    outline-offset: 2px;
}

/* ── Responsive: mobile ── */
@media (max-width: 380px) {
    #a11y-panel {
        width: calc(100vw - 40px);
        left: 0;
    }
}

/* ═══════════════════════════════════════════
   ACCESSIBILITY MODE CLASSES (on <html>)
   ═══════════════════════════════════════════ */

/* Text Sizes */
html.a11y-text-large { font-size: 18.4px; }
html.a11y-text-xlarge { font-size: 20.8px; }

/* High Contrast */
html.a11y-high-contrast body {
    background: #000 !important;
    color: #fff !important;
}
html.a11y-high-contrast .navbar {
    background: #000 !important;
    border-bottom: 2px solid #fff !important;
}
html.a11y-high-contrast .navbar a,
html.a11y-high-contrast .navbar button {
    color: #fff !important;
}
html.a11y-high-contrast .hero {
    background: #000 !important;
}
html.a11y-high-contrast a {
    color: #ffff00 !important;
}
html.a11y-high-contrast .btn-primary {
    background: #ffff00 !important;
    color: #000 !important;
    border: 2px solid #fff !important;
}
html.a11y-high-contrast .btn-secondary {
    background: #000 !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
}
html.a11y-high-contrast .light-card,
html.a11y-high-contrast .pillar-card,
html.a11y-high-contrast .audience-card,
html.a11y-high-contrast .not-card,
html.a11y-high-contrast .timeline-step {
    background: #111 !important;
    border: 2px solid #fff !important;
    color: #fff !important;
}
html.a11y-high-contrast .section-title,
html.a11y-high-contrast .section-description,
html.a11y-high-contrast h1, html.a11y-high-contrast h2, html.a11y-high-contrast h3,
html.a11y-high-contrast p {
    color: #fff !important;
}
html.a11y-high-contrast .footer {
    background: #000 !important;
    border-top: 2px solid #fff !important;
    color: #fff !important;
}
html.a11y-high-contrast .gold-sep {
    background: #fff !important;
}

/* No Animations */
html.a11y-no-animations *,
html.a11y-no-animations *::before,
html.a11y-no-animations *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}
html.a11y-no-animations html {
    scroll-behavior: auto !important;
}
/* Make reveal elements visible immediately */
html.a11y-no-animations .reveal {
    opacity: 1 !important;
    transform: none !important;
}

/* Grayscale */
html.a11y-grayscale {
    filter: grayscale(100%);
}

/* Dyslexia-Friendly Font */
html.a11y-dyslexia-font body,
html.a11y-dyslexia-font p,
html.a11y-dyslexia-font span,
html.a11y-dyslexia-font li,
html.a11y-dyslexia-font label,
html.a11y-dyslexia-font input,
html.a11y-dyslexia-font textarea,
html.a11y-dyslexia-font button {
    font-family: 'Arial', 'Helvetica', sans-serif !important;
    letter-spacing: 0.06em;
    word-spacing: 0.12em;
    line-height: 1.9 !important;
}

/* Enhanced Focus Indicators */
html.a11y-focus-mode *:focus {
    outline: 3px solid #e65c00 !important;
    outline-offset: 3px !important;
    border-radius: 3px;
}

/* ── Global baseline focus (always-on, subtle) ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--sage-dark, #8BA888);
    outline-offset: 2px;
    border-radius: 4px;
}
