/* ==========================================================
   a11y.css — תפריט נגישות ומצבי הנגישות
   ========================================================== */
.a11y-ui { position: fixed; z-index: 60; inset-inline-start: 14px; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); font-family: "IBM Plex Sans Hebrew", Arial, sans-serif; direction: rtl; }
.a11y-btn {
  width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%;
  background: #0b57d0; color: #fff; border: 3px solid #fff; box-shadow: 0 6px 20px rgb(0 0 0 / 0.4); cursor: pointer;
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
.a11y-btn:hover { transform: scale(1.07); }
.a11y-btn:active { transform: scale(0.95); }
.a11y-btn svg { width: 28px; height: 28px; fill: currentColor; }
.a11y-btn:focus-visible, .a11y-ui button:focus-visible, .a11y-ui a:focus-visible { outline: 3px solid #ffd54f; outline-offset: 3px; }

.a11y-panel {
  position: absolute; inset-inline-start: 0; bottom: 64px; width: min(340px, calc(100vw - 28px)); max-height: min(78dvh, 640px); overflow: auto;
  background: #14181f; color: #fff; border: 2px solid #fff; border-radius: 16px; padding: 14px; box-shadow: 0 20px 60px rgb(0 0 0 / 0.55);
  font-size: 16px; line-height: 1.4;
}
.a11y-panel[hidden] { display: none; }
.a11y-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 18px; }
.a11y-x { width: 40px; height: 40px; border-radius: 50%; color: #fff; font-size: 18px; cursor: pointer; }
.a11y-x:hover { background: rgb(255 255 255 / 0.15); }
.a11y-size { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 8px; margin-bottom: 10px; text-align: center; }
.a11y-size button { height: 48px; border-radius: 12px; background: #fff; color: #14181f; font-weight: 700; font-size: 20px; cursor: pointer; }
.a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a11y-opt {
  min-height: 52px; padding: 8px 10px; border-radius: 12px; border: 2px solid rgb(255 255 255 / 0.5); color: #fff; background: transparent;
  font-size: 15px; font-weight: 600; line-height: 1.25; cursor: pointer; text-align: center;
}
.a11y-opt:hover { background: rgb(255 255 255 / 0.12); }
.a11y-opt[aria-pressed="true"] { background: #ffd54f; border-color: #ffd54f; color: #14181f; }
.a11y-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 12px; font-size: 15px; }
.a11y-reset { padding: 10px 14px; border-radius: 12px; background: #fff; color: #14181f; font-weight: 700; cursor: pointer; }
.a11y-foot a { color: #9ec1ff; }

/* ---- מצבים ---- */
html.a11y-filtered { filter: var(--a11y-filter); }
html.a11y-filtered img, html.a11y-filtered video, html.a11y-filtered iframe { filter: none; }

html.a11y-links a:not(.a11y-ui a) { text-decoration: underline !important; text-underline-offset: 0.2em; }
html.a11y-hl a:not(.a11y-ui a), html.a11y-hl button:not(.a11y-ui button) { outline: 2px solid #000 !important; background-color: #ffeb3b !important; color: #000 !important; }
html.a11y-font body, html.a11y-font body *:not(.a11y-ui):not(.a11y-ui *) { font-family: Arial, "Arial Hebrew", Helvetica, sans-serif !important; }
html.a11y-space body *:not(.a11y-ui):not(.a11y-ui *) { line-height: 1.85 !important; letter-spacing: 0.05em !important; word-spacing: 0.1em !important; }
html.a11y-cursor, html.a11y-cursor * {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'><path d='M4 2l15 9-6.5 1.5L9 19z' fill='black' stroke='white' stroke-width='1.5' stroke-linejoin='round'/></svg>") 4 2, auto !important;
}
html.a11y-focus *:focus-visible { outline: 4px solid #ffeb3b !important; outline-offset: 3px !important; box-shadow: 0 0 0 7px #000 !important; }

html.a11y-nomotion *, html.a11y-nomotion *::before, html.a11y-nomotion *::after {
  animation: none !important; transition: none !important; scroll-behavior: auto !important;
}
html.a11y-nomotion .grain, html.a11y-nomotion .scroll-progress, html.a11y-nomotion .hero__bar { display: none !important; }

/* ניגודיות גבוהה: כהה / בהירה */
html.a11y-hc-dark, html.a11y-hc-light { background: var(--hc-bg) !important; }
html.a11y-hc-dark { --hc-bg: #000; --hc-fg: #fff; --hc-link: #ffeb3b; }
html.a11y-hc-light { --hc-bg: #fff; --hc-fg: #000; --hc-link: #0000d6; }
html.a11y-hc-dark .bg-gl, html.a11y-hc-light .bg-gl, html.a11y-hc-dark .grain, html.a11y-hc-light .grain { display: none !important; }
:is(html.a11y-hc-dark, html.a11y-hc-light) body :not(.a11y-ui):not(.a11y-ui *):not(img):not(svg):not(svg *):not(video):not(iframe):not(canvas):not(.ph-trailer *) {
  background-color: var(--hc-bg) !important; color: var(--hc-fg) !important; border-color: var(--hc-fg) !important;
  box-shadow: none !important; text-shadow: none !important; background-image: none !important;
  -webkit-text-stroke: 0 !important; filter: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
:is(html.a11y-hc-dark, html.a11y-hc-light) body a:not(.a11y-ui a), :is(html.a11y-hc-dark, html.a11y-hc-light) body a *:not(.a11y-ui *) {
  color: var(--hc-link) !important; text-decoration: underline !important;
}
:is(html.a11y-hc-dark, html.a11y-hc-light) body :is(.btn, button, input, textarea):not(.a11y-ui *) { border: 2px solid var(--hc-fg) !important; }
:is(html.a11y-hc-dark, html.a11y-hc-light) body :is(svg, svg *):not(.a11y-ui *) { fill: currentColor; }

/* ---- נייד: כפתור הנגישות בפינה העליונה, כדי שלא יכסה תוכן וטפסים ---- */
@media (max-width: 899px) {
  .a11y-ui { bottom: auto; top: calc(12px + env(safe-area-inset-top, 0px)); inset-inline-start: auto; inset-inline-end: 14px; }
  .a11y-btn { width: 44px; height: 44px; border-width: 2px; }
  .a11y-btn svg { width: 24px; height: 24px; }
  .a11y-panel { bottom: auto; top: 54px; inset-inline-start: auto; inset-inline-end: 0; }
}
