/* ============================================================
   ACCESSIBILITY WIDGET - תקן ישראלי ת"י 5568
   רכיב עצמאי, ללא תוסף. נקודת כניסה ימין-למטה.
   הפילטרים (ניגודיות/אפור) מוחלים על תוכן העמוד דרך משתנה,
   ולא על ה-body - כדי שהווידג'ט עצמו לעולם לא ייעלם/יסונן.
   ============================================================ */
.a11y-widget {
  position: fixed;
  bottom: var(--space-8, 2rem);
  right: var(--space-8, 2rem); /* פיזי: הכפתור הצף יושב שמאל */
  z-index: 950;
  font-family: var(--font-base, "Noto Sans Hebrew", sans-serif);
}

/* --- כפתור הפתיחה --- */
.a11y-toggle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--color-ink, #1a1714);
  color: #fff;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .30);
  transition: transform .18s var(--ease, ease), background .18s var(--ease, ease), box-shadow .18s var(--ease, ease);
}
.a11y-toggle:hover { transform: scale(1.07); box-shadow: 0 14px 34px rgba(0, 0, 0, .38); }
.a11y-toggle:active { transform: scale(1.0); }
.a11y-toggle:focus-visible { outline: 3px solid var(--color-cta, #c3e85b); outline-offset: 3px; }

/* --- הפאנל --- */
.a11y-panel {
  position: absolute;
  bottom: 66px;
  right: 0;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border: 1px solid var(--color-border, #e4e4e7);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .22);
  padding: 16px;
  transform-origin: bottom right;
}
.a11y-panel[hidden] { display: none; }
.a11y-panel:not([hidden]) { animation: a11yPanelIn .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes a11yPanelIn {
  from { opacity: 0; transform: scale(.95) translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.a11y-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.a11y-panel__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-ink, #1a1714);
  margin: 0;
}
.a11y-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-muted, #6b7280);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.a11y-close:hover { background: rgba(0, 0, 0, .06); color: var(--color-ink, #1a1714); }
.a11y-close:focus-visible { outline: 2px solid var(--color-ink, #1a1714); outline-offset: 1px; }

/* --- גריד אריחים --- */
.a11y-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.a11y-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 78px;
  padding: 10px 6px;
  border: 1px solid var(--color-border, #e4e4e7);
  border-radius: 12px;
  background: #fff;
  color: var(--color-text-dark, #242424);
  cursor: pointer;
  text-align: center;
  transition: background .15s ease, border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
@media (hover: hover) {
  .a11y-tile:hover { background: #fafafa; border-color: #d4d4d8; transform: translateY(-1px); }
}
.a11y-tile:focus-visible { outline: 2px solid var(--color-ink, #1a1714); outline-offset: 1px; }
.a11y-tile__icon { width: 26px; height: 26px; color: var(--color-ink, #1a1714); }
.a11y-tile__icon svg { width: 100%; height: 100%; display: block; }
.a11y-tile__label { font-size: 11.5px; line-height: 1.25; font-weight: 500; color: var(--color-text-dark, #242424); }

.a11y-tile[aria-pressed="true"] {
  background: var(--color-cta, #c3e85b);
  border-color: var(--color-cta, #c3e85b);
  box-shadow: 0 4px 14px rgba(195, 232, 91, .5);
}
.a11y-tile[aria-pressed="true"] .a11y-tile__icon,
.a11y-tile[aria-pressed="true"] .a11y-tile__label { color: var(--color-ink, #1a1714); }

/* --- פוטר הפאנל --- */
.a11y-panel__foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border, #e4e4e7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.a11y-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--color-text-muted, #6b7280);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 2px;
  transition: color .15s ease;
}
.a11y-reset:hover { color: var(--color-ink, #1a1714); }
.a11y-reset:focus-visible { outline: 2px solid var(--color-ink, #1a1714); outline-offset: 2px; border-radius: 4px; }
.a11y-statement-link {
  font-size: 12px;
  color: var(--color-text-muted, #6b7280);
  text-decoration: none;
}
.a11y-statement-link:hover { color: var(--color-ink, #1a1714); text-decoration: underline; }

/* ============================================================
   מצבי תוכן - מוחלים על ילדי ה-body פרט לווידג'ט עצמו
   ============================================================ */
body.a11y-filtered > *:not(.a11y-widget) { filter: var(--a11y-filter, none); }

body.a11y-font-larger  { font-size: 112.5%; }
body.a11y-font-smaller { font-size: 90%; }

body.a11y-readable,
body.a11y-readable :where(p, li, a, span, h1, h2, h3, h4, button, input, label, td, th, blockquote) {
  font-family: Arial, "Noto Sans Hebrew", sans-serif !important;
  line-height: 1.9 !important;
  letter-spacing: normal !important;
  word-spacing: .05em !important;
}

body.a11y-links a {
  text-decoration: underline !important;
  text-underline-offset: 3px;
  outline: 1px dashed rgba(26, 23, 20, .55);
  outline-offset: 2px;
}

/* סמן גדול - SVG חץ 48px */
body.a11y-bigcursor,
body.a11y-bigcursor * {
  cursor: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M5 2l7 18 2.6-7.2L22 10 5 2z' fill='%23000' stroke='%23fff' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E") 4 2, auto !important;
}

/* סרגל קריאה - עוקב אחר העכבר */
body.a11y-reading::after {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  top: var(--a11y-reading-y, 50vh);
  height: 34px;
  background: rgba(255, 235, 100, .22);
  border-top: 2px solid rgba(214, 178, 0, .8);
  border-bottom: 2px solid rgba(214, 178, 0, .8);
  pointer-events: none;
  z-index: 9999;
  transition: top 50ms linear;
}

/* עצירת אנימציות */
body.a11y-noanim *,
body.a11y-noanim *::before,
body.a11y-noanim *::after {
  animation-duration: .001s !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001s !important;
  scroll-behavior: auto !important;
}

/* כיבוד העדפת מערכת להפחתת תנועה */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    transition-duration: .001s !important;
  }
}

/* --- רספונסיב --- */
@media (max-width: 768px) {
  .a11y-widget { bottom: var(--space-6, 1.5rem); right: var(--space-4, 1rem); }
  .a11y-panel { width: 296px; }
}

/* בזמן פתיחת הפאנל, אם הכפתור הצף מסתיר - מורידים אותו מעט מהדרך נשמר ב-z-index */
