/* ============================================================
   THE LIGHT METHOD - Accessibility Addon
   WCAG 2.1 AA  |  RTL Hebrew  |  App 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: #3D3D3D;
    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(--muted-teal, #7EBFB5);
    outline-offset: 2px;
}

/* ── Floating Widget Container ──
   Positioned above the bottom navigation bar (~65px) */
#a11y-widget {
    position: fixed;
    left: 16px;
    bottom: 80px;
    z-index: 99990;
    direction: rtl;
    font-family: 'Heebo', sans-serif;
}

/* ── Toggle Button ── */
#a11y-toggle-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--muted-teal-dark, #5EA99E);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}
#a11y-toggle-btn:hover {
    transform: scale(1.07);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.26);
}
#a11y-toggle-btn:focus-visible {
    outline: 3px solid var(--muted-teal, #7EBFB5);
    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: 60px;
    left: 0;
    width: 290px;
    background: var(--white, #fff);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    direction: rtl;
    transform-origin: bottom left;
}
#a11y-panel[hidden] {
    display: none;
}

/* Panel header */
.a11y-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--muted-teal-dark, #5EA99E);
    color: #fff;
}
.a11y-header-left {
    display: flex;
    align-items: center;
    gap: 7px;
}
.a11y-header-icon {
    font-size: 1.15rem;
    line-height: 1;
}
.a11y-header h2 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    color: #fff;
}
#a11y-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    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: 12px 16px;
    max-height: 55vh;
    overflow-y: auto;
}

/* Group */
.a11y-group {
    margin-bottom: 10px;
}
.a11y-group-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

/* Segmented buttons */
.a11y-btn-row {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
.a11y-btn {
    padding: 6px 10px;
    border-radius: 7px;
    border: 2px solid #ddd;
    background: #fff;
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s;
    color: #444;
}
.a11y-btn:hover {
    border-color: var(--muted-teal-dark, #5EA99E);
    background: #f5f5f5;
}
.a11y-btn[aria-pressed="true"] {
    border-color: var(--muted-teal-dark, #5EA99E);
    background: var(--muted-teal-dark, #5EA99E);
    color: #fff;
}
.a11y-btn:focus-visible {
    outline: 2px solid var(--muted-teal-dark, #5EA99E);
    outline-offset: 2px;
}

/* Toggle buttons */
.a11y-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 11px;
    border: 2px solid #e8e8e8;
    border-radius: 9px;
    background: #fff;
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
    color: #333;
    text-align: right;
}
.a11y-toggle-btn:hover {
    border-color: var(--muted-teal-dark, #5EA99E);
    background: #fafafa;
}
.a11y-toggle-btn[aria-pressed="true"] {
    border-color: var(--muted-teal-dark, #5EA99E);
    background: rgba(94, 169, 158, 0.08);
}
.a11y-toggle-btn:focus-visible {
    outline: 2px solid var(--muted-teal-dark, #5EA99E);
    outline-offset: 2px;
}

/* Toggle switch indicator */
.a11y-switch {
    width: 34px;
    height: 19px;
    border-radius: 10px;
    background: #ccc;
    position: relative;
    flex-shrink: 0;
    margin-right: 8px;
    transition: background 0.2s;
}
.a11y-switch::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    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(--muted-teal-dark, #5EA99E);
}
.a11y-toggle-btn[aria-pressed="true"] .a11y-switch::after {
    transform: translateX(-15px);
}

/* Divider */
.a11y-divider {
    height: 1px;
    background: #eee;
    margin: 8px 0;
}

/* Reset button */
.a11y-reset-btn {
    width: 100%;
    padding: 8px;
    background: none;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.8rem;
    color: #777;
    cursor: pointer;
    transition: all 0.15s;
}
.a11y-reset-btn:hover {
    border-color: #bbb;
    color: #444;
}
.a11y-reset-btn:focus-visible {
    outline: 2px solid var(--muted-teal-dark, #5EA99E);
    outline-offset: 2px;
}

/* Statement link */
.a11y-statement-link {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: 0.78rem;
    color: var(--muted-teal-dark, #5EA99E);
    text-decoration: underline;
    border-top: 1px solid #eee;
    background: #fafafa;
}
.a11y-statement-link:hover {
    color: var(--muted-teal, #7EBFB5);
}
.a11y-statement-link:focus-visible {
    outline: 2px solid var(--muted-teal-dark, #5EA99E);
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 360px) {
    #a11y-panel {
        width: calc(100vw - 36px);
        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,
html.a11y-high-contrast #app {
    background: #000 !important;
    color: #fff !important;
}
html.a11y-high-contrast .app-header {
    background: #000 !important;
    border-bottom: 2px solid #fff !important;
}
html.a11y-high-contrast .action-btn.primary {
    background: #ffff00 !important;
    color: #000 !important;
    border: 2px solid #fff !important;
}
html.a11y-high-contrast .action-btn.secondary {
    background: #000 !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
}
html.a11y-high-contrast a {
    color: #ffff00 !important;
}
html.a11y-high-contrast .bottom-nav {
    background: #111 !important;
    border-top: 2px solid #fff !important;
}
html.a11y-high-contrast .nav-tab {
    color: #fff !important;
}
html.a11y-high-contrast .nav-tab.active {
    color: #ffff00 !important;
}
html.a11y-high-contrast .view {
    background: #000 !important;
    color: #fff !important;
}
html.a11y-high-contrast h2,
html.a11y-high-contrast h3,
html.a11y-high-contrast p,
html.a11y-high-contrast span,
html.a11y-high-contrast div {
    color: #fff !important;
}
html.a11y-high-contrast .light-card,
html.a11y-high-contrast .timeline-step,
html.a11y-high-contrast .profile-card {
    background: #111 !important;
    border: 2px solid #fff !important;
    color: #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;
}
html.a11y-no-animations .breathing-circle {
    animation: 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 ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--muted-teal-dark, #5EA99E);
    outline-offset: 2px;
    border-radius: 4px;
}
