/* ═══════════════════════════════════════════════════════════════
   תפריט נגישות - מובנה באתר, ללא תלות בשירות חיצוני
   כל ההתאמות נשמרות ב-localStorage ונטענות מחדש בכניסה הבאה
   ═══════════════════════════════════════════════════════════════ */

/* ── כפתור הפתיחה ─────────────────────────────────────────────── */
.a11y-btn{
  position:fixed; inset-block-end:22px; inset-inline-start:22px; z-index:9998;
  width:52px; height:52px; border-radius:50%; border:2px solid rgba(255,255,255,.28);
  background:linear-gradient(140deg,#1f6fd0,#0b4c9c); color:#fff;
  display:grid; place-items:center; cursor:pointer;
  box-shadow:0 10px 30px rgba(0,0,0,.4); transition:transform .25s, box-shadow .25s;
}
.a11y-btn:hover{transform:scale(1.08)}
.a11y-btn:focus-visible{outline:3px solid #ffd34d; outline-offset:3px}
.a11y-btn svg{width:30px;height:30px}

/* ── החלונית ──────────────────────────────────────────────────── */
.a11y-panel{
  position:fixed; inset-block:0; inset-inline-start:0; z-index:9999;
  width:min(360px,92vw); overflow-y:auto; padding:18px;
  background:#0d1117; color:#f2f4f8; border-inline-end:1px solid rgba(255,255,255,.12);
  box-shadow:14px 0 44px rgba(0,0,0,.5);
  transform:translateX(-102%); visibility:hidden;
  transition:transform .3s cubic-bezier(.19,1,.22,1), visibility .3s;
  font-family:Heebo,system-ui,sans-serif; font-size:14px; line-height:1.5;
}
[dir="rtl"] .a11y-panel{transform:translateX(102%)}
.a11y-panel.on{transform:none; visibility:visible}

.a11y-head{display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding-bottom:12px;margin-bottom:12px;border-bottom:1px solid rgba(255,255,255,.14)}
.a11y-head h2{margin:0;font-size:1.05rem;font-weight:800;color:#fff}
.a11y-x{width:36px;height:36px;border-radius:10px;border:1px solid rgba(255,255,255,.2);
  background:transparent;color:#fff;font-size:1.3rem;line-height:1;cursor:pointer}
.a11y-x:hover{background:rgba(255,255,255,.1)}

.a11y-reset{display:block;width:100%;margin-bottom:14px;padding:11px;
  border:0;border-radius:10px;background:#c2255c;color:#fff;
  font-weight:800;font-size:.92rem;cursor:pointer;font-family:inherit}
.a11y-reset:hover{background:#a61e4d}

.a11y-sec{margin-bottom:16px}
.a11y-sec > h3{margin:0 0 8px;font-size:.78rem;font-weight:800;letter-spacing:.06em;
  text-transform:uppercase;color:#9fb2c9}
.a11y-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}

.a11y-opt{display:flex;align-items:center;gap:8px;padding:11px 10px;
  border:1px solid rgba(255,255,255,.14);border-radius:10px;
  background:#161b22;color:#e8edf4;font-size:.83rem;font-weight:600;
  text-align:start;cursor:pointer;font-family:inherit;line-height:1.25}
.a11y-opt:hover{background:#1d242e;border-color:rgba(255,255,255,.28)}
.a11y-opt:focus-visible{outline:3px solid #ffd34d;outline-offset:2px}
.a11y-opt[aria-pressed="true"]{background:#1f6fd0;border-color:#3b8ae8;color:#fff}
.a11y-opt svg{width:17px;height:17px;flex:none}

.a11y-steps{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px}
.a11y-size{padding:11px 6px;font-size:.82rem;justify-content:center}
.a11y-val{grid-column:1/-1;text-align:center;font-size:.78rem;color:#9fb2c9;padding-top:2px}

.a11y-foot{border-top:1px solid rgba(255,255,255,.14);padding-top:12px;margin-top:4px}
.a11y-foot a{display:block;padding:9px 0;color:#8ec5ff;font-size:.85rem;text-decoration:underline}
.a11y-note{font-size:.74rem;color:#8496ab;line-height:1.6;margin:8px 0 0}

/* ═══ ההתאמות עצמן - מוחלות על :root ═══════════════════════════ */

/* ניגודיות גבוהה - ממעטת את ממשק הנגישות עצמו כדי שיישאר שמיש */
html[data-a11y-contrast="high"] body,
html[data-a11y-contrast="high"] body *:not(svg):not(path):not(.a11y-panel):not(.a11y-panel *):not(.a11y-btn):not(.a11y-btn *){
  background-color:#000!important; color:#fff!important; border-color:#fff!important}
/* הקישורים חייבים ספציפיות גבוהה מהכלל הגורף שמעליהם */
/* אותה שרשרת :not כמו בכלל הגורף, אחרת הוא מנצח בספציפיות */
html[data-a11y-contrast="high"] body a:not(.a11y-panel):not(.a11y-panel *):not(.a11y-btn):not(.a11y-btn *):not(svg):not(path),
html[data-a11y-contrast="high"] body a *:not(.a11y-panel):not(.a11y-panel *):not(.a11y-btn):not(.a11y-btn *):not(svg):not(path){color:#ffdd33!important}
html[data-a11y-contrast="high"] body button:not(.a11y-panel button):not(.a11y-btn),
html[data-a11y-contrast="high"] body .btn{
  background:#000!important;color:#fff!important;border:2px solid #fff!important}
html[data-a11y-contrast="high"] body img,html[data-a11y-contrast="high"] body video{
  filter:grayscale(1) contrast(1.2)}

/* ניגודיות בהירה */
html[data-a11y-contrast="bright"] body,
html[data-a11y-contrast="bright"] body *:not(svg):not(path):not(.a11y-panel):not(.a11y-panel *):not(.a11y-btn):not(.a11y-btn *){
  background-color:#fff!important;color:#000!important;border-color:#000!important}
/* אותה שרשרת :not כמו בכלל הגורף, אחרת הוא מנצח בספציפיות */
html[data-a11y-contrast="bright"] body a:not(.a11y-panel):not(.a11y-panel *):not(.a11y-btn):not(.a11y-btn *):not(svg):not(path),
html[data-a11y-contrast="bright"] body a *:not(.a11y-panel):not(.a11y-panel *):not(.a11y-btn):not(.a11y-btn *):not(svg):not(path){color:#0033cc!important}
html[data-a11y-contrast="bright"] body button:not(.a11y-panel button):not(.a11y-btn),
html[data-a11y-contrast="bright"] body .btn{
  background:#fff!important;color:#000!important;border:2px solid #000!important}

/* מונוכרום / היפוך - על העטיפה כדי לא להשפיע על החלונית עצמה */
html[data-a11y-filter="mono"] body>*:not(.a11y-panel):not(.a11y-btn){filter:grayscale(1)}
html[data-a11y-filter="invert"] body>*:not(.a11y-panel):not(.a11y-btn){filter:invert(1) hue-rotate(180deg)}
html[data-a11y-filter="sepia"] body>*:not(.a11y-panel):not(.a11y-btn){filter:sepia(.7)}

/* הדגשת קישורים */
html[data-a11y-links="on"] a{
  text-decoration:underline!important; text-underline-offset:3px!important;
  outline:1px dashed currentColor; outline-offset:2px}

/* גופן קריא */
html[data-a11y-font="readable"] body,
html[data-a11y-font="readable"] body *:not(i):not(.a11y-panel):not(.a11y-panel *){
  font-family:Arial,"Segoe UI",Tahoma,sans-serif!important}

/* ריווח אותיות, מילים, גובה שורה */
html[data-a11y-letter="on"] body *:not(.a11y-panel):not(.a11y-panel *){letter-spacing:.09em!important}
html[data-a11y-word="on"] body *:not(.a11y-panel):not(.a11y-panel *){word-spacing:.28em!important}
html[data-a11y-line="on"] body *:not(.a11y-panel):not(.a11y-panel *){line-height:2.05!important}

/* עצירת אנימציות */
html[data-a11y-motion="off"] body *:not(.a11y-panel):not(.a11y-panel *){
  animation:none!important; transition:none!important; scroll-behavior:auto!important}
html[data-a11y-motion="off"] .rv{opacity:1!important; transform:none!important}

/* הסתרת תמונות */
html[data-a11y-img="off"] img:not(.a11y-panel img){visibility:hidden}
html[data-a11y-img="off"] [style*="background-image"]:not(.a11y-btn){background-image:none!important}

/* סמן גדול */
html[data-a11y-cursor="big"] body,html[data-a11y-cursor="big"] body *{
  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='M8 4 8 38 16 30 21 43 27 40 22 28 33 28Z' fill='%23000' stroke='%23fff' stroke-width='2.5'/%3E%3C/svg%3E") 6 3,auto!important}

/* מיקוד מוגבר */
html[data-a11y-focus="on"] :focus{outline:4px solid #ffd34d!important; outline-offset:3px!important}

/* קו קריאה שנע עם העכבר */
.a11y-ruler{position:fixed;inset-inline:0;height:34px;z-index:9997;pointer-events:none;
  border-block:2px solid #ffd34d;background:rgba(255,211,77,.14);display:none}
html[data-a11y-ruler="on"] .a11y-ruler{display:block}

/* החלונית תמיד חסינה מההתאמות שהיא עצמה מפעילה */
.a11y-panel,.a11y-panel *,.a11y-btn,.a11y-btn *{
  filter:none!important; letter-spacing:normal!important; word-spacing:normal!important;
  line-height:1.5!important}
.a11y-btn{background:linear-gradient(140deg,#1f6fd0,#0b4c9c)!important;color:#fff!important;
  border:2px solid rgba(255,255,255,.28)!important}
.a11y-panel{background:#0d1117!important;color:#f2f4f8!important}
.a11y-opt{background:#161b22!important;color:#e8edf4!important}
.a11y-opt[aria-pressed="true"]{background:#1f6fd0!important;color:#fff!important}
.a11y-reset{background:#c2255c!important;color:#fff!important}
.a11y-foot a{color:#8ec5ff!important}

@media print{.a11y-btn,.a11y-panel,.a11y-ruler{display:none!important}}
