/* Accessibility preferences — trigger and panel.
   2026-09-27, founder: "i dont want it to be in the header, put it how it
   was before". The trigger floats again at the bottom-left corner of the
   screen, in Hebrew too (not mirrored), with the panel opening above it.
   It keeps the lighter E33 look: a solid white circle with a hairline border,
   no hover lift; the panel has a hairline border and no shadow. Colours come
   from the site tokens.
   2026-09-28, founder: "make the accessibility widget more noticeable. add a
   little bit of shadow", then "more noticeable. maybe also more shadow":
   56×56, solid teal with a white icon and a 2px white ring (so it still
   stands out over the teal closing band), and a clear shadow (--fab-shadow,
   shared with the WhatsApp button at the bottom-right). */

.sod-a11y {
  position: fixed;
  left: calc(env(safe-area-inset-left, 0px) + 16px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  z-index: 9997;
  width: 56px;
  height: 56px;
}

.sod-a11y__trigger {
  display: inline-flex;
  width: 56px;
  height: 56px;
  flex: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #fff;
  background: var(--teal-700, #0b7566);   /* solid: stands out over any section it floats above */
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: var(--fab-shadow, 0 2px 6px rgb(17 20 18 / 0.18), 0 10px 28px rgb(17 20 18 / 0.26));
  cursor: pointer;
  transition: background-color 450ms var(--ease-out, ease-out), border-color 450ms var(--ease-out, ease-out), color 450ms var(--ease-out, ease-out);
}

.sod-a11y svg {
  display: block;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sod-a11y__trigger svg { width: 28px; height: 28px; stroke-width: 1.9; }
.sod-a11y__close svg { width: 18px; height: 18px; }

/* open: the same state as hover (a deeper teal), so the button reads as "on" */
.sod-a11y__trigger[aria-expanded="true"],
.sod-a11y__trigger:focus-visible {
  background: var(--teal-800, #085a4e);
}

@media (hover: hover) {
  .sod-a11y__trigger:hover {
    background: var(--teal-800, #085a4e);
  }
}

/* the site-wide focus ring (global.css) squares corners to 6px; keep the circle */
.sod-a11y__trigger:focus-visible,
.sod-a11y__close:focus-visible {
  outline: 2px solid var(--teal-700, #0b7566);
  outline-offset: 3px;
  border-radius: 50%;
}

/* Opens above the button, flush with its left edge (both languages), and
   never taller than the screen above it: 16px gap + 56px button + 12px gap
   + 16px clear at the top = 100px. */
.sod-a11y__panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 12px);
  width: min(300px, calc(100vw - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  max-height: calc(100vh - 100px);
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 100px);
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--ink, #0c0f12);
  background: var(--paper, #fff);
  border: 1px solid var(--line, #d5dedb);
  border-radius: var(--radius, 12px);
  font-family: var(--font, system-ui, sans-serif);
  text-align: start;
}

.sod-a11y__panel[hidden] { display: none; }

.sod-a11y__header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-block: 10px;
  padding-inline: 16px 10px;
  color: var(--ink, #0c0f12);
  background: var(--paper, #fff);
  border-block-end: 1px solid var(--line, #d5dedb);
}

.sod-a11y__title {
  margin: 0;
  color: inherit;
  font-family: var(--font, system-ui, sans-serif);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.3;
}

.sod-a11y__close {
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--ink, #0c0f12);
  background: var(--paper, #fff);
  border: 1px solid var(--line, #d5dedb);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 450ms var(--ease-out, ease-out), border-color 450ms var(--ease-out, ease-out);
}

.sod-a11y__close:focus-visible {
  background: var(--mint-100, #e3f8f3);
  border-color: var(--teal-700, #0b7566);
}

.sod-a11y__panel > button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  color: var(--ink, #0c0f12);
  background: var(--paper, #fff);
  border: 0;
  border-top: 1px solid var(--line, #d5dedb);
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: start;
  transition: background-color 450ms var(--ease-out, ease-out), color 450ms var(--ease-out, ease-out);
}

.sod-a11y__header + button { border-top: 0; }

.sod-a11y__panel > button:focus-visible {
  outline: 2px solid var(--teal-700, #0b7566);
  outline-offset: -3px;
  border-radius: 0;
  background: var(--mint-100, #e3f8f3);
}

@media (hover: hover) {
  .sod-a11y__close:hover {
    background: var(--mint-100, #e3f8f3);
    border-color: var(--teal-700, #0b7566);
  }
  .sod-a11y__panel > button:hover { background: var(--mint-100, #e3f8f3); }
  .sod-a11y__statement:hover { color: var(--teal-800, #085a4e); text-decoration-color: currentColor; }
}

/* switched on: the selected-state fill plus a tick, so the state never rests on colour alone */
.sod-a11y__panel > button[aria-pressed="true"] { color: var(--teal-900, #063f37); background: var(--mint-200, #c8f2ea); }
.sod-a11y .sod-a11y__tick { display: none; width: 18px; height: 18px; stroke-width: 1.8; }
.sod-a11y__panel > button[aria-pressed="true"] .sod-a11y__tick { display: block; }
.sod-a11y__panel > .sod-a11y__reset { color: var(--teal-800, #085a4e); }

.sod-a11y__statement {
  display: block;
  padding: 12px 16px;
  color: var(--teal-700, #0b7566);
  border-top: 1px solid var(--line, #d5dedb);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 0.2em;
  transition: color 450ms var(--ease-out, ease-out), text-decoration-color 450ms var(--ease-out, ease-out);
}

.sod-a11y__statement:focus-visible {
  outline: 2px solid var(--teal-700, #0b7566);
  outline-offset: -3px;
  border-radius: 0;
  color: var(--teal-800, #085a4e);
  text-decoration-color: currentColor;
}

html[data-a11y-font="-2"] { font-size: 85%; }
html[data-a11y-font="-1"] { font-size: 92%; }
html[data-a11y-font="1"] { font-size: 110%; }
html[data-a11y-font="2"] { font-size: 120%; }
html[data-a11y-font="3"] { font-size: 135%; }

body.a11y-high-contrast > :not(.sod-a11y):not(script):not(style) {
  filter: invert(1) hue-rotate(180deg);
}
/* <body> itself is not filtered: without this its white ground shows through
   the transparent sections and the inverted (now light) text vanishes */
body.a11y-high-contrast { background-color: #000; }
body.a11y-high-contrast img,
body.a11y-high-contrast svg,
body.a11y-high-contrast video {
  filter: invert(1) hue-rotate(180deg);
}
/* the widget sits outside the inverted page, so its icons must not get the
   photo flip-back above either */
body.a11y-high-contrast .sod-a11y svg { filter: none; }
/* the logo is dark letters for a white ground: invert it with the page, like
   text, or it vanishes on the now-black header and footer */
body.a11y-high-contrast :is(.wordmark__logo, .footer-brand__logo) { filter: none; }
body.a11y-low-contrast > :not(.sod-a11y):not(script):not(style) {
  filter: saturate(.55) contrast(.88);
}
body.a11y-highlight-links > :not(.sod-a11y) a {
  padding-inline: 4px;
  color: #111412 !important;
  background: #fbbf24 !important;
  border-radius: 4px;
  font-weight: 700 !important;
  text-decoration: underline solid 2px !important;
  text-underline-offset: 3px !important;
}

@media print {
  .sod-a11y { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sod-a11y__trigger,
  .sod-a11y__close,
  .sod-a11y__panel > button,
  .sod-a11y__statement { transition: none; }
}
