/* ==========================================================================
   רכיב נגישות צף — זיגזג הדר
   עצמאי לחלוטין: לא תלוי ב-style.css ולא מושפע מההתאמות שהוא עצמו מפעיל.
   כל המידות ב-px בכוונה, כדי שהגדלת הטקסט באתר לא תנפח את הפאנל עצמו.
   ========================================================================== */

.a11y-root {
  position: fixed;
  inset-block-end: var(--a11y-bottom, 16px);
  left: 16px;                 /* פיזי — פינה שמאלית תחתונה בכל כיוון כתיבה */
  z-index: 2147483000;
  font-family: 'Assistant', 'Arial Hebrew', Arial, sans-serif;
  direction: rtl;
  line-height: 1.45;
}

/* ─── הכפתור הצף ─────────────────────────────────────────────────────── */

.a11y-fab {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #D6336C;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .55);
  transition: transform .18s ease, box-shadow .18s ease;
  padding: 0;
}
.a11y-fab:hover { transform: scale(1.06); box-shadow: 0 10px 30px rgba(0, 0, 0, .65); }
.a11y-fab svg { width: 30px; height: 30px; display: block; }

.a11y-root :focus-visible {
  outline: 3px solid #4da3ff;
  outline-offset: 3px;
}

/* ─── הפאנל ──────────────────────────────────────────────────────────── */

.a11y-panel {
  position: absolute;
  inset-block-end: 66px;
  left: 0;
  width: 290px;
  max-width: calc(100vw - 32px);
  max-height: min(70vh, 540px);
  overflow-y: auto;
  background: #141413;
  color: #f5f3ef;
  border: 1px solid rgba(244, 166, 192, .45);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .65);
}
.a11y-panel[hidden] { display: none; }

.a11y-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.a11y-title { font-size: 15px; font-weight: 800; margin: 0; color: #F4A6C0; }
.a11y-close {
  background: none;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  color: #f5f3ef;
  width: 28px; height: 28px;
  font-size: 16px; line-height: 1;
  cursor: pointer;
}
.a11y-close:hover { background: rgba(255, 255, 255, .08); }

.a11y-group { margin-bottom: 12px; }
.a11y-label {
  font-size: 12px;
  color: rgba(245, 243, 239, .6);
  margin: 0 0 6px;
}

/* שורת גודל הטקסט */
.a11y-size { display: flex; gap: 6px; }
.a11y-size button {
  flex: 1;
  background: #1f1e1c;
  border: 1px solid rgba(255, 255, 255, .14);
  color: #f5f3ef;
  border-radius: 9px;
  padding: 9px 4px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.a11y-size button:hover { background: #2a2825; }
.a11y-steps {
  font-size: 12px;
  color: rgba(245, 243, 239, .55);
  text-align: center;
  margin-top: 5px;
}

/* מתגים */
.a11y-opt {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #1f1e1c;
  border: 1px solid rgba(255, 255, 255, .14);
  color: #f5f3ef;
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  text-align: start;
  cursor: pointer;
  margin-bottom: 6px;
}
.a11y-opt:hover { background: #2a2825; }
.a11y-opt .tick {
  width: 17px; height: 17px;
  flex: none;
  border-radius: 5px;
  border: 1.5px solid rgba(255, 255, 255, .34);
  display: grid; place-items: center;
  font-size: 11px; line-height: 1;
  color: #0c0900;
}
.a11y-opt[aria-pressed="true"] { border-color: #F4A6C0; background: rgba(244, 166, 192, .12); }
.a11y-opt[aria-pressed="true"] .tick { background: #F4A6C0; border-color: #F4A6C0; }
.a11y-opt[aria-pressed="true"] .tick::after { content: "✓"; }

.a11y-reset {
  width: 100%;
  background: none;
  border: 1px solid rgba(255, 255, 255, .22);
  color: #f5f3ef;
  border-radius: 10px;
  padding: 9px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.a11y-reset:hover { background: rgba(255, 255, 255, .08); }

.a11y-foot {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: 12px;
}
.a11y-foot a { color: #F4A6C0; text-decoration: underline; }

/* ==========================================================================
   ההתאמות עצמן
   ========================================================================== */

/* ─── גודל טקסט ─── */
/* zoom ולא font-size: דף /chitov/ כתוב כולו ב-px, ושם font-size של html לא היה משנה כלום.
   מגדילים רק את בלוקי הטקסט (ולא את כל הפריסה), כדי שהטקסט יירד שורה בתוך הקופסה
   ולא ידחוף תמונות ורשתות אל מחוץ למסך. :not(X *) מונע הגדלה כפולה בבלוקים מקוננים. */
html[data-a11y-font] body :is(p, h1, h2, h3, h4, li, label, blockquote, summary, figcaption, input, textarea, .btn, .btn-cta, .btn-next, .btn-back, .opt, .goal-btn, .eyebrow):not(:where(.a11y-root, .a11y-root *, :is(p, h1, h2, h3, h4, li, label, blockquote, summary, figcaption, .btn, .btn-cta, .opt, .goal-btn) *)) { zoom: var(--a11y-font, 1); }

/* ─── גווני אפור ───
   הפילטר מוחל על ילדי body ולא על html, כי filter על אב הופך אותו ל-containing
   block ושובר position:fixed. כך הכפתור הצף נשאר במקומו — וגם נשאר צבעוני. */
html[data-a11y-gray] body > *:not(.a11y-root) { filter: grayscale(1); }

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

/* ─── פונט קריא ─── */
html[data-a11y-font-readable] body :not(:where(.a11y-root, .a11y-root *)) {
  font-family: Arial, 'Arial Hebrew', sans-serif !important;
  letter-spacing: .01em;
}

/* ─── עצירת אנימציות ─── */
html[data-a11y-still] body *:not(:where(.a11y-root, .a11y-root *)) {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
html[data-a11y-still] .reveal { opacity: 1 !important; transform: none !important; }

/* ─── סמן גדול ─── */
html[data-a11y-cursor] body, html[data-a11y-cursor] body * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M5 2l14 10-6 1 3.5 7-2.6 1.2L10.5 14 5 18z' fill='%23fff' stroke='%23000' stroke-width='1.4'/%3E%3C/svg%3E") 4 2, auto !important;
}

/* ─── ניגודיות גבוהה ───
   שחור מלא, טקסט לבן, הדגשות צהוב. חייב !important כי בדף יש style inline.
   החרגות הווידג'ט עטופות ב-:where() בכוונה: :not() רגיל היה מוסיף ספציפיות
   לכלל הגורף ומנצח את הכללים הממוקדים מתחתיו (ה-CTA יצא שחור במקום צהוב). */
html[data-a11y-contrast] body,
html[data-a11y-contrast] body *:not(:where(.a11y-root, .a11y-root *)) {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
html[data-a11y-contrast] body h1,
html[data-a11y-contrast] body h2,
html[data-a11y-contrast] body h3 { color: #ffff00 !important; }
html[data-a11y-contrast] body a { color: #4da3ff !important; text-decoration: underline !important; }
/* כפתורי פעולה: צהוב מלא על שחור, כדי שיישארו הדבר הבולט בעמוד */
html[data-a11y-contrast] body .btn,
html[data-a11y-contrast] body .btn-cta,
html[data-a11y-contrast] body .btn-next,
html[data-a11y-contrast] body button[type="submit"] {
  background-image: none !important;
  background-color: #ffff00 !important;
  color: #000 !important;
  border: 2px solid #fff !important;
  text-decoration: none !important;   /* זה כפתור, לא קישור בתוך טקסט */
}
/* הזוהרים והתמונות הדקורטיביות רק מפריעים בניגודיות גבוהה */
/* תשובה שנבחרה בשאלון — בלי זה היא נבלעת ברקע השחור */
html[data-a11y-contrast] body .opt[aria-pressed="true"],
html[data-a11y-contrast] body .goal-btn.selected {
  outline: 3px solid #ffff00 !important;
  outline-offset: -3px;
  color: #ffff00 !important;
}
html[data-a11y-contrast] body input,
html[data-a11y-contrast] body input::placeholder { color: #fff !important; }

/* ─── קישור דילוג לתוכן ─── */
.a11y-skip {
  position: fixed;
  inset-block-start: -100px;
  inset-inline-start: 12px;
  z-index: 2147483001;
  background: #F4A6C0;
  color: #0c0900;
  font-family: 'Assistant', 'Arial Hebrew', Arial, sans-serif;
  font-weight: 800;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 0 0 10px 10px;
  text-decoration: none;
  transition: inset-block-start .18s ease;
}
.a11y-skip:focus { inset-block-start: 0; }

@media (prefers-reduced-motion: reduce) {
  .a11y-fab, .a11y-skip { transition: none; }
}
