/* =========================================================
   נגישות – כפתור, פאנל וההתאמות עצמן
   הכללים חלים על header / main / footer בנפרד, כדי שהפאנל עצמו
   (שהוא אח שלהם ב-body) לא יושפע מהפילטרים ומהזום.
   ========================================================= */

:root{
  --a11y-zoom:1;
  --a11y-accent:#1352A6;
}

/* ---------- 1. גודל תצוגה ---------- */
body > header.site-header,
body > main,
body > footer.site-footer{
  zoom:var(--a11y-zoom);
}

/* ---------- 2. פילטרים: ניגודיות והיפוך ---------- */
html.a11y-invert body > header.site-header,
html.a11y-invert body > main,
html.a11y-invert body > footer.site-footer{
  filter:invert(1) hue-rotate(180deg);
  background:#fff;
}
/* תצלומים מוחזרים לצבעם המקורי אחרי ההיפוך.
   הלוגו לא נכלל כאן בכוונה: ההיפוך הופך אותו לבהיר, וכך הוא נשאר קריא על הרקע הכהה. */
html.a11y-invert img:not(.logo-mark){
  filter:invert(1) hue-rotate(180deg);
}

html.a11y-contrast body > header.site-header,
html.a11y-contrast body > main,
html.a11y-contrast body > footer.site-footer{
  filter:contrast(1.4) saturate(1.25);
}

html.a11y-gray body > header.site-header,
html.a11y-gray body > main,
html.a11y-gray body > footer.site-footer{
  filter:grayscale(1);
}

/* צירוף של כמה מצבים – הפילטרים מצטברים */
html.a11y-invert.a11y-gray body > main{ filter:invert(1) hue-rotate(180deg) grayscale(1) }
html.a11y-contrast.a11y-gray body > main{ filter:contrast(1.4) grayscale(1) }

/* ---------- 3. הדגשת קישורים ---------- */
html.a11y-links a{
  text-decoration:underline !important;
  text-underline-offset:3px !important;
  text-decoration-thickness:2px !important;
}
html.a11y-links a:not(.btn):not(.logo){
  outline:1px dashed currentColor;
  outline-offset:3px;
}

/* ---------- 4. פונט קריא ---------- */
html.a11y-readable body,
html.a11y-readable button,
html.a11y-readable input,
html.a11y-readable select,
html.a11y-readable textarea{
  font-family:Arial,"Segoe UI",Tahoma,sans-serif !important;
  letter-spacing:.02em;
}
html.a11y-readable h1,
html.a11y-readable h2,
html.a11y-readable h3,
html.a11y-readable h4{ letter-spacing:0 !important }

/* ---------- 5. ריווח מוגדל ---------- */
html.a11y-spacing body > main p,
html.a11y-spacing body > main li,
html.a11y-spacing body > main label,
html.a11y-spacing body > footer p,
html.a11y-spacing body > footer a{
  line-height:2.1 !important;
  letter-spacing:.06em !important;
  word-spacing:.14em !important;
}

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

/* ---------- 7. סמן גדול ---------- */
html.a11y-cursor,
html.a11y-cursor *{
  cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M6 2 L6 38 L15 30 L21 44 L28 41 L22 27 L34 27 Z' fill='%23000' stroke='%23fff' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 4 2, auto !important;
}
html.a11y-cursor a,
html.a11y-cursor button,
html.a11y-cursor select,
html.a11y-cursor [role="button"]{
  cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M18 4 a3.5 3.5 0 0 1 7 0 v14 a3.5 3.5 0 0 1 7 0 v3 a3.5 3.5 0 0 1 7 0 v13 a10 10 0 0 1-10 10 h-8 a12 12 0 0 1-10-6 L7 27 a3.5 3.5 0 0 1 6-3.5 l5 7 Z' fill='%23000' stroke='%23fff' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 14 2, pointer !important;
}

/* ---------- 8. הדגשת מיקוד מקלדת ---------- */
html.a11y-focus :focus-visible{
  outline:4px solid #FFB300 !important;
  outline-offset:3px !important;
  border-radius:4px;
}

/* =========================================================
   הכפתור והפאנל
   ========================================================= */
.a11y-btn{
  position:fixed;inset-inline-start:20px;bottom:20px;z-index:9000;
  width:56px;height:56px;border-radius:50%;border:2px solid #fff;
  background:var(--a11y-accent);color:#fff;cursor:pointer;padding:0;
  display:grid;place-items:center;
  box-shadow:0 6px 20px -6px rgba(0,0,0,.5);
  transition:transform .2s ease,background .2s ease;
}
.a11y-btn:hover{transform:scale(1.06);background:#0E4287}
.a11y-btn svg{width:32px;height:32px;display:block}

.a11y-panel{
  position:fixed;inset-inline-start:20px;bottom:88px;z-index:9001;
  width:min(340px,calc(100vw - 40px));max-height:min(76vh,640px);
  background:#fff;color:#1F1F1F;border-radius:14px;
  border:1px solid #D5DBE2;box-shadow:0 24px 60px -20px rgba(0,0,0,.45);
  display:flex;flex-direction:column;overflow:hidden;
  font-family:Arial,"Segoe UI",sans-serif;
}
.a11y-panel[hidden]{display:none}

.a11y-head{
  background:var(--a11y-accent);color:#fff;
  padding:14px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px;
}
.a11y-head h2{margin:0;font-size:17px;font-weight:700;color:#fff}
.a11y-close{
  background:none;border:0;color:#fff;cursor:pointer;
  width:34px;height:34px;border-radius:8px;font-size:22px;line-height:1;
  display:grid;place-items:center;
}
.a11y-close:hover{background:rgba(255,255,255,.2)}

.a11y-body{padding:14px 16px 16px;overflow-y:auto}
.a11y-group{margin-bottom:16px}
.a11y-group h3{
  margin:0 0 8px;font-size:13px;font-weight:700;color:#4A5560;
  text-transform:none;letter-spacing:.02em;
}

.a11y-size{display:flex;gap:8px;align-items:center}
.a11y-size button{
  flex:1;padding:9px 0;border:1px solid #C9D2DB;border-radius:9px;
  background:#fff;color:#1F1F1F;font-size:15px;font-weight:700;cursor:pointer;
}
.a11y-size button:hover{border-color:var(--a11y-accent);color:var(--a11y-accent)}
.a11y-size output{
  min-width:56px;text-align:center;font-size:14px;font-weight:700;color:#4A5560;
}

.a11y-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.a11y-opt{
  display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;
  padding:12px 6px;border:1px solid #C9D2DB;border-radius:10px;
  background:#fff;color:#1F1F1F;font-size:12.5px;font-weight:600;
  cursor:pointer;line-height:1.3;
}
.a11y-opt svg{width:22px;height:22px;color:var(--a11y-accent)}
.a11y-opt:hover{border-color:var(--a11y-accent)}
.a11y-opt[aria-pressed="true"]{
  background:var(--a11y-accent);border-color:var(--a11y-accent);color:#fff;
}
.a11y-opt[aria-pressed="true"] svg{color:#fff}

.a11y-foot{
  border-top:1px solid #E1E6EB;padding:12px 16px;
  display:flex;flex-direction:column;gap:8px;background:#F7F9FB;
}
.a11y-reset{
  padding:10px;border:1px solid #C9D2DB;border-radius:9px;background:#fff;
  color:#1F1F1F;font-size:14px;font-weight:700;cursor:pointer;
}
.a11y-reset:hover{border-color:#B23A2E;color:#B23A2E}
.a11y-foot a{
  font-size:13px;color:var(--a11y-accent);text-align:center;
  text-decoration:underline;text-underline-offset:3px;
}

/* הכפתור והפאנל תמיד נשארים במלוא הניגודיות והגודל המקוריים */
.a11y-btn,.a11y-panel{zoom:1;filter:none !important}

@media (max-width:640px){
  .a11y-btn{width:50px;height:50px;inset-inline-start:14px;bottom:14px}
  .a11y-btn svg{width:28px;height:28px}
  .a11y-panel{inset-inline-start:14px;bottom:74px;width:calc(100vw - 28px)}
}

@media print{
  .a11y-btn,.a11y-panel{display:none !important}
}
