/* סרגל התאמות תצוגה: שכבה אופציונלית מעל אתר נגיש גם בלעדיה. */
:root { --a11y-scale: 1; }
html { font-size: calc(100% * var(--a11y-scale)); }
.a11y-widget[hidden], .a11y-panel[hidden] { display: none !important; }
.a11y-widget {
  position: fixed;
  inset-inline-end: 1rem;
  bottom: 1rem;
  z-index: 90;
  font-family: var(--sans);
  direction: rtl;
}
.a11y-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0.5rem 0.9rem;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: #0e3a44;
  box-shadow: 0 6px 20px rgba(14, 58, 68, 0.25);
  cursor: pointer;
  font: 700 0.92rem/1.2 var(--sans);
}
.a11y-trigger:hover, .a11y-trigger[aria-expanded="true"] { background: #082a32; }
.a11y-trigger svg { flex: none; width: 27px; height: 27px; }
.a11y-panel {
  position: absolute;
  inset-inline-end: 0;
  bottom: calc(100% + 0.6rem);
  width: min(360px, calc(100vw - 1.4rem));
  max-height: min(680px, calc(100dvh - 8rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.1rem;
  border: 2px solid #0e3a44;
  border-radius: 22px;
  color: #1c2a33;
  background: #fff;
  box-shadow: 0 18px 50px rgba(8, 42, 50, 0.3);
  text-align: right;
}
.a11y-panel__head { display: flex; align-items: center; gap: 0.75rem; justify-content: space-between; }
.a11y-panel__head h2 { margin: 0; color: #0e3a44; font: 700 1.16rem/1.35 var(--display); }
.a11y-panel__close, .a11y-panel__text button, .a11y-panel__options button, .a11y-panel__reset {
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  border: 1.5px solid #b6c9c9;
  color: #0e3a44;
  background: #fff;
  font: 700 0.92rem/1.35 var(--sans);
  cursor: pointer;
}
.a11y-panel__close { font-size: 1.55rem; line-height: 1; }
.a11y-panel__intro { margin: 0.45rem 0 1rem; font-size: 0.89rem; line-height: 1.45; }
.a11y-panel__text { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.8rem; }
.a11y-panel__text button { flex: 0 0 52px; font-size: 1.12rem; }
.a11y-panel__text span { font-weight: 700; font-variant-numeric: tabular-nums; }
.a11y-panel__options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
.a11y-panel__options button { padding: 0.5rem 0.4rem; white-space: normal; }
.a11y-panel__options button[aria-pressed="true"] { color: #fff; background: #0e3a44; border-color: #0e3a44; }
.a11y-panel__text button:disabled { opacity: 0.45; cursor: not-allowed; }
.a11y-panel button:hover:not(:disabled) { border-color: #0e3a44; }
.a11y-panel__reset { display: block; width: 100%; margin-top: 0.8rem; border-color: #0e3a44; }
.a11y-panel__links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; padding-top: 0.85rem; margin-top: 0.85rem; border-top: 1px solid #cfdcde; font-size: 0.9rem; }
.a11y-panel__links a { color: #006c65; text-decoration: underline; text-underline-offset: 3px; }
.a11y-panel :focus-visible, .a11y-trigger:focus-visible { outline: 3px solid #d9543c; outline-offset: 3px; }

/* הגדרות שמשפיעות על עמוד האתר, גם לאחר ניווט לעמוד הבא. */
html[data-a11y-underline="true"] a { text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 0.2em; }
html[data-a11y-readable="true"] body, html[data-a11y-readable="true"] button, html[data-a11y-readable="true"] input,
html[data-a11y-readable="true"] textarea, html[data-a11y-readable="true"] select,
html[data-a11y-readable="true"] h1, html[data-a11y-readable="true"] h2, html[data-a11y-readable="true"] h3 { font-family: Arial, sans-serif !important; }
html[data-a11y-spacing="true"] body { line-height: 2.05 !important; letter-spacing: 0.045em; word-spacing: 0.15em; }
html[data-a11y-spacing="true"] p, html[data-a11y-spacing="true"] li { line-height: 2.05 !important; }
html[data-a11y-motion="true"] { scroll-behavior: auto !important; }
html[data-a11y-motion="true"] *, html[data-a11y-motion="true"] *::before, html[data-a11y-motion="true"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}
/* סינון הגוף כולו יוצר containing block שמרחיק כפתורים position:fixed; מסננים את ילדיו בנפרד. */
html[data-a11y-grayscale="true"] body > * { filter: grayscale(1); }
@media (pointer: fine) {
  html[data-a11y-cursor="true"] body { cursor: url('/assets/img/accessibility-cursor.svg') 2 2, auto; }
  html[data-a11y-cursor="true"] a, html[data-a11y-cursor="true"] button, html[data-a11y-cursor="true"] summary { cursor: url('/assets/img/accessibility-cursor.svg') 2 2, pointer; }
}

/* ניגודיות גבוהה: הטקסט נשאר HTML רגיל, והתמונות אינן מתהפכות. */
html[data-a11y-contrast="dark"] { --paper:#080808; --paper-2:#101010; --paper-3:#181818; --ink:#fff; --ink-soft:#f4f4f4; --ink-mute:#e5e5e5; --night:#080808; --night-2:#101010; --night-3:#080808; --brand:#ffe66d; --brand-dark:#ffe66d; --brand-soft:#333006; --line:#eee; --line-strong:#fff; }
html[data-a11y-contrast="light"] { --paper:#fff; --paper-2:#fff; --paper-3:#f7f7f7; --ink:#080808; --ink-soft:#161616; --ink-mute:#333; --night:#111; --night-2:#222; --night-3:#111; --brand:#003c80; --brand-dark:#003c80; --brand-soft:#e5f0ff; --line:#333; --line-strong:#111; }
html[data-a11y-contrast] *, html[data-a11y-contrast] *::before, html[data-a11y-contrast] *::after {
  transition: none !important;
  animation: none !important;
}
html[data-a11y-contrast="dark"] body,
html[data-a11y-contrast="dark"] :is(.site-header,.site-footer,.page__head,.course__hero,.home-course,.cta,.card,.aside-card,.lead-form--panel,.callout,.tool,.a11y-panel,.a11y-trigger) {
  color: #fff !important; background: #080808 !important; background-image: none !important; border-color: #fff !important; box-shadow: none !important;
}
html[data-a11y-contrast="dark"] body :is(h1,h2,h3,h4,p,li,small,label,legend,span,strong,em,td,th,figcaption) { color: #fff !important; }
html[data-a11y-contrast="dark"] body a:not(.btn) { color: #ffe66d !important; text-decoration: underline !important; }
html[data-a11y-contrast="dark"] body :is(.btn,.mobile-bar__btn,.a11y-panel__options button[aria-pressed="true"]) { color: #080808 !important; background: #ffe66d !important; border: 2px solid #ffe66d !important; }
html[data-a11y-contrast="dark"] body :is(button,input,select,textarea):not(.btn):not(.a11y-trigger) { color: #fff !important; background: #080808 !important; border-color: #fff !important; }
html[data-a11y-contrast="dark"] body :is(button,input,select,textarea):focus-visible { outline: 3px solid #ffe66d !important; }
html[data-a11y-contrast="dark"] body .a11y-panel__options button[aria-pressed="true"] { color: #080808 !important; background: #ffe66d !important; }
html[data-a11y-contrast="light"] body,
html[data-a11y-contrast="light"] :is(.site-header,.site-footer,.page__head,.course__hero,.home-course,.cta,.card,.aside-card,.lead-form--panel,.callout,.tool,.a11y-panel,.a11y-trigger) {
  color: #080808 !important; background: #fff !important; background-image: none !important; border-color: #111 !important; box-shadow: none !important;
}
html[data-a11y-contrast="light"] body :is(h1,h2,h3,h4,p,li,small,label,legend,span,strong,em,td,th,figcaption) { color: #080808 !important; }
html[data-a11y-contrast="light"] body a:not(.btn) { color: #003c80 !important; text-decoration: underline !important; }
html[data-a11y-contrast="light"] body :is(.btn,.mobile-bar__btn,.a11y-panel__options button[aria-pressed="true"]) { color: #fff !important; background: #003c80 !important; border: 2px solid #003c80 !important; }
html[data-a11y-contrast="light"] body :is(button,input,select,textarea):not(.btn):not(.a11y-trigger) { color: #080808 !important; background: #fff !important; border-color: #111 !important; }
html[data-a11y-contrast="light"] body :is(button,input,select,textarea):focus-visible { outline: 3px solid #003c80 !important; }
html[data-a11y-contrast="light"] body .a11y-panel__options button[aria-pressed="true"] { color: #fff !important; background: #003c80 !important; }

@media (max-width: 700px) {
  .a11y-widget { inset-inline-end: 0.7rem; bottom: calc(5.6rem + env(safe-area-inset-bottom, 0px)); }
  .a11y-trigger { padding: 0.55rem; }
  .a11y-panel { max-height: calc(100dvh - 11rem); }
}
@media print { .a11y-widget { display: none !important; } }
