/* The accessibility widget (a11y-widget.css / .js) in this site's own colours — the tokens of src/styles/tokens.css,
   no colour of its own — and out of the way of the phone menu and the "דברו איתי" dialog. Loaded after a11y-widget.css.
   Below the widget's own look: how its "text size" and "high contrast" work on this page. Everything here applies only
   while the visitor has switched it on (a class on <html>); "איפוס הכל" removes the class and the page is as designed. */

:root {
  --a11y-accent: var(--blue); /* the round button: the site's blue, #4c64fa */
  --a11y-ink: var(--ink); /* the mark on it: white */
  --a11y-accent-panel: var(--blue-hi); /* on the panel: the site's lighter blue, #6a7dff — 4.54:1 on #222 */
}

/* (":root .a11y-root" outranks the widget's own ".a11y-root", whatever order the stylesheets end up in) */
:root .a11y-root {
  --a11y-panel-bg: var(--bg); /* the site's dark, #222, instead of the widget's navy */
  --a11y-panel-ink: var(--ink);
}
:root .a11y-root .a11y-btn__dot {
  border-color: var(--bg);
}

/* the phone menu and the dialog cover the whole page: the widget's button steps aside while one of them is open */
html.menu-open .a11y-root,
html.talk-open .a11y-root {
  display: none;
}

/* ================= the keyboard focus ring =================
   The widget outlines every link (highlight links, high contrast); the ring of the element that has the focus must
   still be the strongest outline on the page. */
:root.a11y-links body > :not(.a11y-root) a:focus-visible {
  outline: 2px solid var(--blue) !important;
  outline-offset: 3px !important;
}
:root.a11y-links body > :not(.a11y-root) :is(.menu, .talk-side) a:focus-visible {
  outline-color: #fff !important;
}
:root.a11y-contrast body > :not(.a11y-root) :focus-visible {
  outline: 3px solid #fff !important;
  outline-offset: 3px !important;
}
/* the logo link keeps its full-size box while the logo shrinks on scroll: its outline would be an empty frame */
:root:is(.a11y-links, .a11y-contrast) body > :not(.a11y-root) .hdr .logo:not(:focus-visible) {
  outline: none !important;
}

/* ================= high contrast (html.a11y-contrast) =================
   The widget paints every element black with white text. Here that also blackened the layers that lie over the whole
   screen (the flying squares' layer, the hero copy, the zoom's white) and everything drawn with a background (lines,
   the menu button's bars, dots): the page went black. So: layers keep no background of their own — the page under
   them is black — boxes that sit over other things are solid black, shapes are outlined in white, lines are white,
   pictures stay as they are. */
:root.a11y-contrast {
  --zbg: #000; /* about → closing → footer, which otherwise turn white */
  --zfg: 255, 255, 255;
  --header-glass: #000;
}
:root.a11y-contrast body > :not(.a11y-root),
:root.a11y-contrast body > :not(.a11y-root) *:not(img):not(video):not(svg):not(svg *):not(picture):not(canvas) {
  background-color: transparent !important;
}
/* solid black where something lies over other things: text over pictures, the header, the menu, the dialog, buttons */
:root.a11y-contrast body > :not(.a11y-root) :is(.menu, .talk-bg, .talk-box, .pj-bar, .pw-bar, .viewc, .wa, .cta, .pill, .menu-cta, .talk-x, .wa2, .ft-up, h1 .w, .lede, .tm h3, .xc) {
  background-color: #000 !important;
}
:root.a11y-contrast .zm + .about::before {
  top: 0 !important; /* "נעים להכיר" on black, not over the zoomed (white) letter */
}
/* shapes that were a colour: an outline */
:root.a11y-contrast body > :not(.a11y-root) :is(.tm h3, .talk-box, .viewc) {
  border: 1px solid #fff !important;
}
/* lines and bars drawn with a background: white (the background grid, which is only decoration, stays faint) */
:root.a11y-contrast body > :not(.a11y-root) :is(.st-prog, .st-sep, .burger i, .pp-dot) {
  background-color: #fff !important;
}
:root.a11y-contrast body > :not(.a11y-root) :is(.gl, .pp-gl, .ln) {
  background-color: rgba(255, 255, 255, 0.35) !important;
}
/* the big card numbers only outlined, so the card's text in front of them stays clear */
:root.a11y-contrast body > :not(.a11y-root) .xc .no {
  color: transparent !important;
  -webkit-text-stroke: 1px #fff;
}

/* ================= text size (html.a11y-text, --a11y-text 1.25 / 1.5 / 2) =================
   The widget enlarges the whole page with zoom. This page sizes its type AND its layout on the width of the window,
   so that zoom also widened the layout past the screen and cut it. Here the widget only sets the size: the page grows
   its text itself (src/textScale.ts reads --a11y-text into --kw / --ts; src/styles/textscale.css; src/engine/fitText.ts). */
:root.a11y-text body > :not(.a11y-root) {
  zoom: 1;
}
