/* Explain: Styles for the accessibility button, panel, and site-wide adjustments. */
/* =============================================================
   Accessibility — ערכת הנגשה (כפתור צידי, פאנל והתאמות באתר)
   ============================================================= */

/* קישור "דלג לתוכן הראשי" — מוסתר עד לקבלת פוקוס במקלדת */
.skip-link {
    position: fixed;
    top: 0.75rem;
    right: 50%;
    transform: translate(50%, -220%);
    z-index: 400;
    background: var(--primary-color);
    color: #ffffff;
    padding: 0.85rem 1.5rem;
    border-radius: 0 0 0.9rem 0.9rem;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    transition: transform 0.25s ease;
}

.skip-link:focus {
    transform: translate(50%, 0);
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* כפתור הנגישות הצידי */
.a11y-launcher {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 320;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 0.7rem 0.9rem 1rem;
    border: none;
    border-radius: 0 1.1rem 1.1rem 0;
    background: var(--primary-color);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    transition: background 0.25s ease, transform 0.25s ease;
}

.a11y-launcher:hover,
.a11y-launcher:focus-visible {
    background: var(--primary-hover);
    transform: translateY(-50%) scale(1.05);
}

.a11y-launcher i {
    font-size: 1.6rem;
    line-height: 1;
}

.a11y-launcher-label {
    display: none;
}

@media (min-width: 1024px) {
    .a11y-launcher-label {
        display: inline;
    }
}

@media (max-width: 480px) {
    .a11y-launcher {
        padding: 0.7rem 0.55rem;
    }

    .a11y-launcher i {
        font-size: 1.35rem;
    }
}

/* פאנל הנגישות */
.a11y-panel {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translate(-110%, -50%);
    z-index: 330;
    width: min(93vw, 23rem);
    max-height: 92vh;
    overflow-y: auto;
    padding: 1.25rem 1.25rem 1.5rem;
    background: rgba(6, 18, 34, 0.98);
    border: 1px solid var(--border-color);
    border-radius: 0 1.6rem 1.6rem 0;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(14px);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.a11y-panel.is-open {
    transform: translate(0, -50%);
}

.a11y-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.35rem;
}

.a11y-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
}

.a11y-title i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.a11y-close {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.25s ease;
}

.a11y-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.a11y-sub {
    margin: 0 0 1.1rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.a11y-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.a11y-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 5.5rem;
    padding: 0.75rem 0.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.a11y-btn i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.a11y-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.a11y-btn[aria-pressed="true"] {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.a11y-btn[aria-pressed="true"] i {
    color: #ffffff;
}

.a11y-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    margin-top: 1rem;
    min-height: 3rem;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    background: transparent;
    color: var(--clay-color);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.a11y-reset:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--clay-color);
}

/* ===== התאמות הנגישות המופעלות על האתר ===== */

/* שינוי גודל טקסט — מקנה קנה מידה לכל גדלי ה-rem */
html.a11y-fs-1 { font-size: 106.25%; }
html.a11y-fs-2 { font-size: 112.5%; }
html.a11y-fs-3 { font-size: 119%; }

/* גווני אפור וניגודיות גבוהה — בטוח על אלמנט השורש (לא שובר אלמנטים קבועים) */
html.a11y-grayscale { filter: grayscale(1); }
html.a11y-contrast { filter: contrast(1.35) saturate(1.2); }
html.a11y-grayscale.a11y-contrast { filter: grayscale(1) contrast(1.35) saturate(1.2); }

/* הדגשת קישורים */
html.a11y-links a {
    text-decoration: underline !important;
    text-underline-offset: 3px;
    outline: 2px solid var(--clay-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* עצירת אנימציות ותנועה */
html.a11y-no-motion *,
html.a11y-no-motion *::before,
html.a11y-no-motion *::after {
    animation: none !important;
    transition: none !important;
}

html.a11y-no-motion,
html.a11y-no-motion body {
    scroll-behavior: auto !important;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}