/* ===== static/accessibility.css — Phase 148A =========================
   רכיב-נגישות משותף: כפתור צף + פאנל + מצבי-נגישות ברמת <html>, וכן
   שיפורי-בסיס (skip-link, focus מוצג) שחלים על כל דף שטוען את הקובץ הזה.
   נטען הן מדפי `public/*` (Phase 146B/C) והן מ-`login.html` — ראו
   docs/PHASE148A_PUBLIC_ACCESSIBILITY.md.
   עצמאי מ-`public.css`/`app.css`: לא תלוי במשתני-CSS שלהם, כדי לעבוד
   זהה בשני ההקשרים (עמוד ציבורי standalone מול `login.html` שיורש
   מ-`base.html`). ======================================================= */

/* ===== Skip link ===== */
.a11y-skip-link {
  position: absolute;
  right: 12px;
  top: -60px;
  z-index: 10000;
  background: #1a2e4a;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: top .15s ease;
}
.a11y-skip-link:focus {
  top: 12px;
  outline: 3px solid #e04b3f;
  outline-offset: 2px;
}

/* ===== Visible keyboard focus everywhere =====
   ⚠️ בכוונה בלי מחלקת-הקפה (למשל .a11y-scope): הקובץ הזה נטען אך ורק
   מ-6 הדפים שבתחום הפאזה (5 ציבוריים + /login) — הטעינה עצמה היא ה-scope,
   ואין דרך לכלול class חדש על <body> של login.html בלי לגעת ב-base.html
   באופן שמשפיע על כל האפליקציה הפנימית (מחוץ להיקף).
   Phase 148B: #ffd54a (צהוב) נמדד ב-1.41:1 מול רקע לבן — מתחת לסף
   3:1 הנדרש ב-WCAG 1.4.11 למחווני-מיקוד. #e04b3f נמדד 4.0:1 מול לבן
   ו-3.42:1 מול הכחול-כהה של ה-header/hero — עובר בשני ההקשרים. #}
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #e04b3f !important;
  outline-offset: 2px !important;
  border-radius: 4px;
}

/* ===== Floating toggle button ===== */
.a11y-toggle-btn {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 9999;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: #1a2e4a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  transition: background .15s;
}
.a11y-toggle-btn:hover { background: #2e6dc9; }
.a11y-toggle-btn:focus-visible {
  outline: 3px solid #e04b3f;
  outline-offset: 3px;
}

/* ===== Panel ===== */
.a11y-panel {
  position: fixed;
  left: 16px;
  bottom: 78px;
  z-index: 9999;
  width: 300px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  background: #fff;
  color: #1a2e4a;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.28);
  border: 1px solid #e1e8f0;
}
.a11y-panel[hidden] { display: none; }

.a11y-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e1e8f0;
}
.a11y-panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
  color: #1a2e4a;
}
.a11y-close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #5f768e;
  padding: 4px 8px;
  border-radius: 6px;
}
.a11y-close-btn:hover { background: #f4f8fb; color: #1a2e4a; }

.a11y-panel-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.a11y-row { display: flex; flex-direction: column; gap: 6px; }
.a11y-row-label { font-size: 0.88rem; color: #5f768e; font-weight: 600; }

.a11y-text-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.a11y-text-level {
  font-size: 0.88rem;
  color: #5f768e;
  min-width: 44px;
  text-align: center;
}

.a11y-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: #f4f8fb;
  color: #1a2e4a;
  border: 1px solid #e1e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.a11y-btn:hover { background: #eaf1f7; }
.a11y-text-controls .a11y-btn { width: 44px; padding: 8px 0; font-size: 1rem; }

.a11y-btn-toggle[aria-pressed="true"] {
  background: #1a2e4a;
  color: #fff;
  border-color: #1a2e4a;
}

.a11y-btn-reset {
  background: #fff;
  color: #dc3545;
  border-color: #dc3545;
}
.a11y-btn-reset:hover { background: #fdf1f2; }

.a11y-panel-footer {
  padding: 10px 16px 14px;
  border-top: 1px solid #e1e8f0;
  text-align: center;
}
.a11y-panel-footer a {
  font-size: 0.85rem;
  color: #2e6dc9;
}

@media (max-width: 480px) {
  .a11y-toggle-btn { left: 10px; bottom: 10px; }
  .a11y-panel { left: 10px; bottom: 68px; width: calc(100vw - 20px); }
}

/* ══════════════════════════════════════════════════════════════════════
   מצבי-נגישות — מוחלים ברמת <html> כדי לחול על כל הדף, כולל הרכיב עצמו
   (מלבד הרחבת-קישורים, שלא צריכה להשפיע על כפתורי הפאנל).
   ══════════════════════════════════════════════════════════════════════ */

/* ניגודיות גבוהה */
html.a11y-contrast body { background: #fff !important; color: #000 !important; }
html.a11y-contrast p, html.a11y-contrast li, html.a11y-contrast span,
html.a11y-contrast h1, html.a11y-contrast h2, html.a11y-contrast h3,
html.a11y-contrast label, html.a11y-contrast div { color: #000 !important; }
html.a11y-contrast a { color: #0000EE !important; text-decoration: underline !important; }
html.a11y-contrast .pub-hero, html.a11y-contrast .pub-security,
html.a11y-contrast .pub-header, html.a11y-contrast .pub-footer,
html.a11y-contrast .pub-section.alt { background: #000 !important; }
html.a11y-contrast .pub-hero *, html.a11y-contrast .pub-security *,
html.a11y-contrast .pub-header *, html.a11y-contrast .pub-footer * { color: #fff !important; }
html.a11y-contrast .pub-hero a, html.a11y-contrast .pub-security a,
html.a11y-contrast .pub-header a, html.a11y-contrast .pub-footer a { color: #ffd54a !important; }
html.a11y-contrast * { border-color: #000 !important; }
html.a11y-contrast .a11y-panel,
html.a11y-contrast .a11y-panel * { background: #fff !important; color: #000 !important; }
html.a11y-contrast .a11y-toggle-btn { background: #000 !important; color: #fff !important; }

/* גווני אפור */
html.a11y-grayscale { filter: grayscale(100%); }

/* הדגשת קישורים — לא תלוי ב-.pub-body כדי לחול גם על /login */
html.a11y-highlight-links a:not(.a11y-toggle-btn):not(.a11y-close-btn):not(.a11y-btn) {
  background: #fff59d !important;
  color: #000 !important;
  text-decoration: underline !important;
  outline: 1px solid #000;
  padding: 0 2px;
  border-radius: 2px;
}

/* גופן קריא */
html.a11y-readable-font body {
  font-family: Verdana, Arial, "Segoe UI", sans-serif !important;
  letter-spacing: 0.02em;
}

/* ריווח שורות מוגדל */
html.a11y-line-spacing body { line-height: 2 !important; }
html.a11y-line-spacing p, html.a11y-line-spacing li {
  line-height: 1.9 !important;
  margin-bottom: 1em !important;
}

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