/* Site Director - native accessibility menu. The panel inherits the site's tokens; map them once here. */
:root {
  --a11y-ground: var(--ground, #ffffff);
  --a11y-ink: var(--ink, #111111);
  --a11y-accent: var(--accent, var(--ink, #111111));
  --a11y-scale: 1;
}

/* ---------- the panel ---------- */
.a11y-menu { inline-size: min(26rem, 94vw); max-block-size: 90dvh; overflow: auto; padding: 1.25rem; border: 2px solid var(--a11y-ink);
  background: var(--a11y-ground); color: var(--a11y-ink); font: inherit; line-height: 1.5; }
.a11y-menu::backdrop { background: rgba(0, 0, 0, .55); }
.a11y-menu__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-block-end: 1rem; }
.a11y-menu__head h2 { margin: 0; font-size: 1.25rem; }
.a11y-menu button { font: inherit; min-block-size: 44px; padding: .5rem .9rem; border: 2px solid var(--a11y-ink); background: var(--a11y-ground);
  color: var(--a11y-ink); cursor: pointer; text-align: start; }
.a11y-menu button[aria-pressed="true"] { background: var(--a11y-ink); color: var(--a11y-ground); }
.a11y-menu button[aria-pressed="true"]::after { content: " ✓"; }
.a11y-menu button:disabled { opacity: .45; cursor: not-allowed; }
.a11y-menu :focus-visible { outline: 3px solid var(--a11y-accent); outline-offset: 3px; }
.a11y-menu__size { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .6rem; margin-block-end: 1rem; }
.a11y-menu__size button { text-align: center; }
.a11y-menu__label { grid-column: 1 / -1; font-weight: 700; }
.a11y-menu__level { min-inline-size: 6.5rem; text-align: center; font-variant-numeric: tabular-nums; }
.a11y-menu__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.a11y-menu__list button { inline-size: 100%; }
.a11y-menu__foot { display: flex; flex-wrap: wrap; gap: .9rem 1.2rem; align-items: center; margin-block-start: 1.1rem; }
.a11y-menu__foot a { color: inherit; padding-block: .6rem; }
.a11y-menu__status { margin: .8rem 0 0; min-block-size: 1.5em; font-size: .95rem; }

/* ---------- what the options do (attributes on <html>) ---------- */
html[data-a11y-text="1"] { font-size: 115%; }
html[data-a11y-text="2"] { font-size: 130%; }
html[data-a11y-text="3"] { font-size: 150%; }
html[data-a11y-text="4"] { font-size: 200%; }

html[data-a11y-contrast="dark"] { --ground: #000; --ink: #fff; --accent: #ffe600; --a11y-ground: #000; --a11y-ink: #fff; --a11y-accent: #ffe600; }
html[data-a11y-contrast="light"] { --ground: #fff; --ink: #000; --accent: #00309c; --a11y-ground: #fff; --a11y-ink: #000; --a11y-accent: #00309c; }
html[data-a11y-contrast="dark"] body, html[data-a11y-contrast="dark"] body *:not(img):not(video):not(svg):not(svg *):not(picture) {
  background-color: #000 !important; background-image: none !important; color: #fff !important; border-color: #fff !important; box-shadow: none !important; text-shadow: none !important; }
html[data-a11y-contrast="dark"] a, html[data-a11y-contrast="dark"] a * { color: #ffe600 !important; }
html[data-a11y-contrast="dark"] button[aria-pressed="true"] { background-color: #fff !important; color: #000 !important; }
html[data-a11y-contrast="light"] body, html[data-a11y-contrast="light"] body *:not(img):not(video):not(svg):not(svg *):not(picture) {
  background-color: #fff !important; background-image: none !important; color: #000 !important; border-color: #000 !important; box-shadow: none !important; text-shadow: none !important; }
html[data-a11y-contrast="light"] a, html[data-a11y-contrast="light"] a * { color: #00309c !important; }
html[data-a11y-contrast="light"] button[aria-pressed="true"] { background-color: #000 !important; color: #fff !important; }
html[data-a11y-contrast] a { text-decoration: underline !important; }
/* text painted by a gradient (transparent fill) would vanish once backgrounds are removed */
html[data-a11y-contrast] body * { -webkit-text-fill-color: currentColor !important; }
/* icons drawn with CSS masks take their colour from the background: paint them in the text colour (marked by a11y-menu.js) */
html[data-a11y-contrast] [data-a11y-mask] { background-color: currentColor !important; }
/* focus must stay visible even where the site drew it with box-shadow */
html[data-a11y-contrast] :focus-visible { outline: 3px solid var(--a11y-accent) !important; outline-offset: 3px !important; }
html[data-a11y-contrast] svg { fill: currentColor; }

html[data-a11y-mono="1"] { filter: grayscale(1); }   /* on the root element a filter does not break fixed positioning */

html[data-a11y-font="1"] body, html[data-a11y-font="1"] body * { font-family: Arial, "Arial Hebrew", "Noto Sans Hebrew", "Noto Sans Arabic", Tahoma, sans-serif !important; font-style: normal !important; }

html[data-a11y-spacing="1"] body * { line-height: 1.8 !important; word-spacing: .16em !important; }
html[data-a11y-spacing="1"] body *:not(:lang(ar)) { letter-spacing: .08em !important; }   /* never track Arabic: it breaks the joins */
html[data-a11y-spacing="1"] p { margin-block-end: 2em !important; }

html[data-a11y-links="1"] a { text-decoration: underline !important; text-decoration-thickness: .14em !important; text-underline-offset: .2em; outline: 2px solid currentColor; outline-offset: 2px; }
html[data-a11y-headings="1"] :is(h1, h2, h3, h4, h5, h6) { outline: 3px solid currentColor; outline-offset: 4px; }

html[data-a11y-motion="1"] *, html[data-a11y-motion="1"] *::before, html[data-a11y-motion="1"] *::after {
  animation: none !important; transition: none !important; scroll-behavior: auto !important; }
/* view transitions (same-document and cross-document) become instant swaps */
html[data-a11y-motion="1"]::view-transition-group(*), html[data-a11y-motion="1"]::view-transition-old(*), html[data-a11y-motion="1"]::view-transition-new(*) { animation: none !important; }

html[data-a11y-focus="1"] :focus { outline: 4px solid var(--a11y-accent) !important; outline-offset: 4px !important; box-shadow: 0 0 0 8px var(--a11y-ground) !important; }

html[data-a11y-cursor="black"], html[data-a11y-cursor="black"] * { 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='M4 2l15 11h-7l4 8-3 1.5-4-8-5 5z' fill='%23000' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E") 6 3, auto !important; }
html[data-a11y-cursor="white"], html[data-a11y-cursor="white"] * { 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='M4 2l15 11h-7l4 8-3 1.5-4-8-5 5z' fill='%23fff' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") 6 3, auto !important; }

.a11y-alt { display: block; margin-block: .3rem .9rem; padding: .35rem .6rem; border-inline-start: 4px solid currentColor; font-size: .95rem; }

@media (forced-colors: active) { .a11y-menu button[aria-pressed="true"] { border-style: double; border-width: 5px; } }
