/*
 * Accessibility menu — bzzat.com and find.bzzat.com (see a11y-menu.js).
 *
 * Colours come from the host through --bz-a11y-accent, --bz-a11y-on-accent,
 * --bz-a11y-surface and --bz-a11y-ink, with CSS system colours as the
 * fallback. The widget is sized in px so "large text" (which scales rem)
 * cannot push it off screen. The host positions the trigger; this file only
 * draws it. Everything here is unlayered on purpose: it must win over a
 * site's own rules, including Tailwind's layered utilities.
 */

/* ---- Trigger ------------------------------------------------------------- */
/* A small tab on the page's start edge (left, right in RTL): a half circle, the wheelchair
   (design/app-icons/svg/wheelchair.png) as a mask so it takes the tab's ink. Shown only once the
   script has run: without it the button would do nothing. */
.bz-a11y-trigger { display: none; }
html.bz-a11y-ready .bz-a11y-trigger {
  display: grid;
  place-items: center;
  inline-size: 30px;
  block-size: 44px;
  padding: 0;
  padding-inline-end: 2px;
  border: 0;
  border-start-end-radius: 999px;
  border-end-end-radius: 999px;
  background: var(--bz-a11y-trigger-bg, rgb(22 20 44 / 90%));
  color: var(--bz-a11y-trigger-ink, white);
  box-shadow: 0 2px 8px rgb(16 24 40 / 25%);
  cursor: pointer;
  transition: inline-size 0.15s;
}
.bz-a11y-trigger::before {
  content: '';
  inline-size: 20px;
  block-size: 20px;
  background: currentColor;
  -webkit-mask: url('a11y-wheelchair.png') center / contain no-repeat;
  mask: url('a11y-wheelchair.png') center / contain no-repeat;
}
.bz-a11y-trigger:hover { inline-size: 36px; }
.bz-a11y-trigger:focus-visible { outline: 3px solid var(--bz-a11y-accent, Highlight); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .bz-a11y-trigger { transition: none; }
}
@media (forced-colors: active) {
  .bz-a11y-trigger { border: 1px solid ButtonText; }
  .bz-a11y-trigger::before { background: ButtonText; }
}

/* ---- Panel --------------------------------------------------------------- */
.bz-a11y-panel {
  position: fixed;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  inline-size: min(340px, calc(100vw - 16px));
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px;
  border-radius: 20px;
  background: var(--bz-a11y-surface, Canvas);
  color: var(--bz-a11y-ink, CanvasText);
  box-shadow: 0 4px 12px rgb(16 24 40 / 14%), 0 18px 48px rgb(16 24 40 / 22%);
  font: 400 14px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Hebrew', Arial, sans-serif;
  letter-spacing: normal;
  word-spacing: normal;
  text-align: start;
}
.bz-a11y-panel[hidden] { display: none; }
.bz-a11y-panel *, .bz-a11y-panel *::before, .bz-a11y-panel *::after { box-sizing: border-box; }
.bz-a11y-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bz-a11y-title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.3; }
.bz-a11y-title:focus { outline: none; }
.bz-a11y-title:focus-visible { outline: 2px solid var(--bz-a11y-accent, Highlight); outline-offset: 2px; border-radius: 4px; }

.bz-a11y-panel button, .bz-a11y-panel a {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.bz-a11y-close {
  display: grid;
  place-items: center;
  inline-size: 36px;
  block-size: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
}
.bz-a11y-close:hover { background: color-mix(in srgb, var(--bz-a11y-ink, CanvasText) 8%, transparent); }

.bz-a11y-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(92px, 100%), 1fr)); gap: 8px; }
.bz-a11y-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-inline-size: 0;
  min-block-size: 92px;
  padding: 10px 6px;
  border: 1px solid color-mix(in srgb, var(--bz-a11y-ink, CanvasText) 14%, transparent);
  border-radius: 14px;
  background: var(--bz-a11y-surface, Canvas);
  text-align: center;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.bz-a11y-tile:hover { border-color: color-mix(in srgb, var(--bz-a11y-accent, Highlight) 60%, transparent); }
.bz-a11y-tile[aria-pressed='true'] {
  border-color: var(--bz-a11y-accent, Highlight);
  background: color-mix(in srgb, var(--bz-a11y-accent, Highlight) 12%, var(--bz-a11y-surface, Canvas));
  box-shadow: inset 0 0 0 1px var(--bz-a11y-accent, Highlight);
}
.bz-a11y-icon {
  display: grid;
  place-items: center;
  inline-size: 38px;
  block-size: 38px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bz-a11y-ink, CanvasText) 7%, transparent);
}
.bz-a11y-tile[aria-pressed='true'] .bz-a11y-icon { background: var(--bz-a11y-accent, Highlight); color: var(--bz-a11y-on-accent, HighlightText); }
.bz-a11y-icon svg { display: block; }
.bz-a11y-level { font-size: 11px; font-weight: 700; color: var(--bz-a11y-accent, Highlight); }
.bz-a11y-level:empty { display: none; }

.bz-a11y-range { display: grid; gap: 6px; padding-block: 4px; }
.bz-a11y-range-label { font-weight: 600; }
.bz-a11y-range input { inline-size: 100%; margin: 0; accent-color: var(--bz-a11y-accent, Highlight); }

.bz-a11y-reset, .bz-a11y-statement {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-block-size: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
}
.bz-a11y-reset { border: 0; background: color-mix(in srgb, var(--bz-a11y-ink, CanvasText) 7%, transparent); }
.bz-a11y-reset:hover { background: color-mix(in srgb, var(--bz-a11y-ink, CanvasText) 12%, transparent); }
.bz-a11y-statement { background: var(--bz-a11y-accent, Highlight); color: var(--bz-a11y-on-accent, HighlightText) !important; }

.bz-a11y-panel :focus-visible { outline: 2px solid var(--bz-a11y-accent, Highlight); outline-offset: 2px; }

@media print {
  .bz-a11y-trigger, .bz-a11y-panel { display: none !important; }
}

/* ---- The settings, applied to the page --------------------------------------
 * `:not(.bz-a11y-ui, .bz-a11y-ui *)` keeps the menu itself readable whatever
 * is switched on. */

/* Large text: rem-based sites scale with the root size. */
html.bz-a11y-text-1 { font-size: 115% !important; }
html.bz-a11y-text-2 { font-size: 130% !important; }
html.bz-a11y-text-3 { font-size: 150% !important; }

/* High contrast: light text on black, links in yellow. */
html.bz-a11y-contrast,
html.bz-a11y-contrast body,
html.bz-a11y-contrast body :not(.bz-a11y-ui, .bz-a11y-ui *, img, video, canvas, svg *) {
  background-color: black !important;
  background-image: none !important;
  color: white !important;
  border-color: white !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
html.bz-a11y-contrast body :is(a, a *):not(.bz-a11y-ui, .bz-a11y-ui *) { color: yellow !important; }
html.bz-a11y-contrast body :is(button, [role='button'], summary, input, select, textarea):not(.bz-a11y-ui, .bz-a11y-ui *) { outline: 1px solid white; }

/* Invert colours: the root filter (a11y-menu.js) flips the page; pictures and the menu flip back. */
html.bz-a11y-invert :is(img, video, canvas, .bz-a11y-ui) { filter: invert(1) hue-rotate(180deg); }

/* Highlight links. */
html.bz-a11y-links body a:not(.bz-a11y-ui, .bz-a11y-ui *) {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important;
  outline: 2px dashed currentColor !important;
  outline-offset: 2px !important;
}

/* Text spacing and line height: the WCAG 1.4.12 values, and a roomier line. */
html.bz-a11y-spacing body :not(.bz-a11y-ui, .bz-a11y-ui *) { letter-spacing: 0.12em !important; word-spacing: 0.16em !important; }
html.bz-a11y-line-height body :not(.bz-a11y-ui, .bz-a11y-ui *) { line-height: 2 !important; }

/* Readable font: plain, open shapes with clear letter forms, already on every device. */
html.bz-a11y-font body :not(.bz-a11y-ui, .bz-a11y-ui *, svg, svg *) { font-family: Verdana, Tahoma, 'Arial Hebrew', Arial, sans-serif !important; }

/* Large cursor: a 48 px arrow; outlined the other way over anything clickable. */
html.bz-a11y-cursor, html.bz-a11y-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M5 2.5 19.5 10l-6.3 2.1-2.6 6.6Z' fill='black' stroke='white' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E") 10 5, auto !important;
}
html.bz-a11y-cursor :is(a, button, summary, label, select, [role='button'], [role='switch'], input[type='checkbox'], input[type='radio'], input[type='range']),
html.bz-a11y-cursor :is(a, button, summary, label, [role='button']) * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M5 2.5 19.5 10l-6.3 2.1-2.6 6.6Z' fill='white' stroke='black' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E") 10 5, pointer !important;
}

/* Focus highlight: a ring that shows on light and dark backgrounds alike. */
html.bz-a11y-focus :focus {
  outline: 3px solid black !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 6px yellow !important;
}
