/* ============================================================
   נגישות — Accessibility (ת"י 5568 / WCAG 2.0 AA + WCAG 2.1 AA)
   נטען בכל משטח: דף הבית (React) וכל עמודי המראה/DB (boot).
   ============================================================ */

/* Skip-to-content link — נגלה רק בפוקוס */
.skip-link {
  position: fixed;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 100000;
  background: #1a1a1a;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.15s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 3px solid #ffeb3b;
  outline-offset: 2px;
}

/* פוקוס נראה גלובלי */
*:focus-visible {
  outline: 3px solid #1a3a5c;
  outline-offset: 2px;
  border-radius: 4px;
}
*:focus:not(:focus-visible) { outline: none; }

/* פוקוס לרכיבים שאנחנו הזרקנו (חצי תפריט, טאבים) */
.sub-arrow:focus-visible,
.elementor-nav-menu--main .menu-item-has-children > a:focus-visible,
.e-n-tab-title:focus-visible,
[role="tab"]:focus-visible {
  outline: 3px solid #1a3a5c !important;
  outline-offset: 2px !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- ניגודיות (בלעדיות זו את זו) ---- */
html.a11y-c-high, html.a11y-c-high body { background: #fff !important; color: #000 !important; }
html.a11y-c-high *:not(.a11y-ui):not(.a11y-ui *) {
  background-color: #fff !important; color: #000 !important;
  border-color: #000 !important; box-shadow: none !important; text-shadow: none !important;
}
html.a11y-c-high a:not(.a11y-ui *), html.a11y-c-high a:not(.a11y-ui *) * { color: #0000ee !important; text-decoration: underline !important; }
html.a11y-c-high button:not(.a11y-ui):not(.a11y-ui *) { border: 2px solid #000 !important; }
html.a11y-c-high img, html.a11y-c-high video { filter: grayscale(100%) contrast(1.2); }

html.a11y-c-inverted, html.a11y-c-inverted body { background: #000 !important; color: #fff !important; }
html.a11y-c-inverted *:not(.a11y-ui):not(.a11y-ui *) {
  background-color: #000 !important; color: #fff !important;
  border-color: #fff !important; box-shadow: none !important; text-shadow: none !important;
}
html.a11y-c-inverted a:not(.a11y-ui *), html.a11y-c-inverted a:not(.a11y-ui *) * { color: #ffff00 !important; text-decoration: underline !important; }
html.a11y-c-inverted img, html.a11y-c-inverted video { filter: invert(1) hue-rotate(180deg); }

html.a11y-c-monochrome { filter: grayscale(100%) contrast(1.1); }
html.a11y-c-lowsat { filter: saturate(0.4); }

/* ---- מרווח שורות / אותיות / יישור ---- */
html.a11y-lh-medium *:not(.a11y-ui *) { line-height: 1.8 !important; }
html.a11y-lh-large *:not(.a11y-ui *) { line-height: 2.2 !important; }
html.a11y-ls-medium *:not(.a11y-ui *) { letter-spacing: 0.05em !important; word-spacing: 0.1em !important; }
html.a11y-ls-large *:not(.a11y-ui *) { letter-spacing: 0.12em !important; word-spacing: 0.18em !important; }
html.a11y-align-right p, html.a11y-align-right li, html.a11y-align-right h1, html.a11y-align-right h2, html.a11y-align-right h3, html.a11y-align-right h4 { text-align: right !important; }
html.a11y-align-center p, html.a11y-align-center li, html.a11y-align-center h1, html.a11y-align-center h2, html.a11y-align-center h3, html.a11y-align-center h4 { text-align: center !important; }
html.a11y-align-justify p, html.a11y-align-justify li { text-align: justify !important; }

/* ---- גופן קריא ---- */
html.a11y-readable-font,
html.a11y-readable-font *:not(.a11y-ui *) {
  font-family: Arial, "Heebo", "Noto Sans Hebrew", sans-serif !important;
  letter-spacing: 0.02em !important;
  word-spacing: 0.05em !important;
}

/* ---- הדגשות ---- */
html.a11y-highlight-links a:not(.a11y-ui *) {
  background: #ffff00 !important; color: #000 !important;
  text-decoration: underline !important; text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important; padding: 0 2px;
  border-radius: 2px; outline: 2px solid #000 !important;
}
html.a11y-highlight-headings h1:not(.a11y-ui *),
html.a11y-highlight-headings h2:not(.a11y-ui *),
html.a11y-highlight-headings h3:not(.a11y-ui *),
html.a11y-highlight-headings h4:not(.a11y-ui *),
html.a11y-highlight-headings h5:not(.a11y-ui *),
html.a11y-highlight-headings h6:not(.a11y-ui *) {
  outline: 2px dashed #1a3a5c !important; outline-offset: 4px !important;
  background: #fffbe6 !important; padding: 4px 8px !important;
}

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

/* ---- סמן גדול ---- */
html.a11y-big-cursor,
html.a11y-big-cursor * {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'><path d='M4 4 L4 40 L14 30 L20 44 L26 42 L20 28 L34 28 Z' fill='%23000' stroke='%23fff' stroke-width='2'/></svg>") 4 4, auto !important;
}
html.a11y-big-cursor a,
html.a11y-big-cursor button,
html.a11y-big-cursor [role="button"],
html.a11y-big-cursor input {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'><path d='M14 4 L14 30 L22 24 L28 40 L34 38 L28 24 L38 24 Z' fill='%23fff' stroke='%23000' stroke-width='2'/></svg>") 14 4, pointer !important;
}

/* ---- הסתרת תמונות ---- */
html.a11y-hide-images img:not(.a11y-ui *),
html.a11y-hide-images picture:not(.a11y-ui *),
html.a11y-hide-images video:not(.a11y-ui *) {
  visibility: hidden !important;
}
html.a11y-hide-images .e-con:not(.a11y-ui *),
html.a11y-hide-images [style*="background-image"]:not(.a11y-ui *) {
  background-image: none !important;
}

/* ---- הדגשת פוקוס מקלדת מוגברת ---- */
html.a11y-keyboard-focus *:focus,
html.a11y-keyboard-focus *:focus-visible {
  outline: 4px solid #ffeb3b !important; outline-offset: 3px !important;
  box-shadow: 0 0 0 6px #1a3a5c !important;
}

/* utility */
.a11y-sr-only {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0,0,0,0) !important;
  white-space: nowrap !important; border: 0 !important;
}

/* ============================================================
   סרגל הנגישות עצמו (a11y-ui — חסין מפני מצבי הניגודיות)
   ============================================================ */
.a11y-ui, .a11y-ui * { box-sizing: border-box; font-family: "Heebo", Arial, sans-serif; }

#a11y-trigger.a11y-ui {
  /* מוגבה מעל ווידג'ט הביקורות שיושב בפינה התחתונה */
  position: fixed; bottom: 120px; inset-inline-start: 16px; z-index: 99998;
  width: 56px; height: 56px; min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 2px solid #ffffff;
  background: #1a3a5c !important; color: #ffffff !important;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35); cursor: pointer; padding: 0;
}
#a11y-trigger.a11y-ui:hover { background: #0f2540 !important; }
#a11y-trigger.a11y-ui:focus-visible { outline: 4px solid #ffeb3b !important; outline-offset: 2px; }
#a11y-trigger.a11y-ui svg { width: 30px; height: 30px; fill: currentColor; }

#a11y-panel.a11y-ui {
  position: fixed; bottom: 186px; inset-inline-start: 16px; z-index: 99999;
  width: 360px; max-width: calc(100vw - 2rem); max-height: 82vh; overflow-y: auto;
  background: #ffffff !important; color: #111111 !important;
  border: 2px solid #1a3a5c; border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4); direction: rtl; text-align: right;
  font-size: 14px; line-height: 1.5;
}
#a11y-panel.a11y-ui[hidden] { display: none; }
.a11y-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  background: #1a3a5c !important; color: #fff !important; padding: 12px 16px;
  border-bottom: 2px solid #1a3a5c;
}
.a11y-head h2 { margin: 0; font-size: 16px; font-weight: 700; color: #fff !important; }
.a11y-close {
  background: transparent !important; color: #fff !important; border: 0; cursor: pointer;
  min-width: 44px; min-height: 44px; font-size: 22px; line-height: 1; border-radius: 6px;
}
.a11y-close:hover { background: rgba(255,255,255,0.2) !important; }
.a11y-body { padding: 14px 16px 20px; }
.a11y-section { border: 0; border-top: 2px solid #e5e7eb; margin: 0 0 14px; padding: 10px 0 0; }
.a11y-section > legend { font-size: 13px; font-weight: 700; color: #1a3a5c !important; padding: 0 6px; }
.a11y-label { font-size: 13px; font-weight: 600; margin: 8px 0 6px; color: #111 !important; }
.a11y-row { display: flex; flex-wrap: wrap; gap: 6px; }
.a11y-btn {
  min-height: 44px; min-width: 44px; padding: 6px 12px; cursor: pointer;
  border: 2px solid #1a3a5c; border-radius: 8px;
  background: #fff !important; color: #1a3a5c !important; font-size: 13px; font-weight: 600;
}
.a11y-btn:hover { background: #eaf0f6 !important; }
.a11y-btn[aria-pressed="true"] { background: #1a3a5c !important; color: #fff !important; }
.a11y-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.a11y-btn:focus-visible { outline: 3px solid #ffeb3b !important; outline-offset: 2px; }
.a11y-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-height: 44px; padding: 8px 12px; margin-bottom: 6px; cursor: pointer;
  border: 2px solid #d4d9e0; border-radius: 8px; background: #fff !important; color: #111 !important;
  font-size: 13px; font-weight: 600; text-align: start;
}
.a11y-toggle[aria-pressed="true"] { border-color: #1a3a5c; background: #eaf0f6 !important; }
.a11y-toggle .a11y-state { font-size: 12px; font-weight: 700; color: #1a3a5c !important; }
.a11y-reset {
  width: 100%; min-height: 44px; margin-bottom: 14px; cursor: pointer;
  border: 2px solid #b91c1c; border-radius: 8px; background: #fff !important; color: #b91c1c !important;
  font-weight: 700; font-size: 13px;
}
.a11y-link {
  display: block; min-height: 44px; padding: 11px 12px; margin-bottom: 6px;
  border: 2px solid #1a3a5c; border-radius: 8px; text-align: center; text-decoration: none;
  background: #fff !important; color: #1a3a5c !important; font-weight: 600; font-size: 13px;
}
.a11y-link:hover { background: #1a3a5c !important; color: #fff !important; }
.a11y-note { font-size: 11.5px; color: #444 !important; margin: 8px 0 0; line-height: 1.6; }

#a11y-guide { position: fixed; left: 0; right: 0; height: 30px; background: rgba(253,224,71,0.45); border-top: 2px solid #eab308; border-bottom: 2px solid #eab308; pointer-events: none; z-index: 99990; }
.a11y-mask { position: fixed; left: 0; right: 0; background: rgba(0,0,0,0.7); pointer-events: none; z-index: 99989; }

/* מסתירים את הווידג'ט המקורי (pojo) אם הוא בכל זאת נטען — שלא יופיעו שני כפתורים */
#pojo-a11y-toolbar, .pojo-a11y-toolbar, #pojo-a11y-skip-content { display: none !important; }

/* 22: keep the trigger clear of the floating WhatsApp/phone bar on mobile */
@media (max-width: 767px) {
  #a11y-trigger.a11y-ui { bottom: 160px; width: 48px; height: 48px; }
  #a11y-panel.a11y-ui { bottom: 218px; }
}
