/* ── Accessibility widget (public site) ─────────────────────────────────────
   A floating button + panel of display adjustments. Every effect is a class
   on <html> (set by a11y.js, remembered in localStorage) and targets the
   page's content only — `body > :not(.a11y-root)` — so the widget itself
   stays readable and operable whatever is switched on. Filters in particular
   must never touch the widget: a filter on an ancestor would also break its
   position: fixed. */

/* ── the button ── */
.a11y-root { position: fixed; bottom: 18px; left: 18px; z-index: 2147483000; font-family: Arial, Helvetica, sans-serif; }
.a11y-fab {
  width: 54px; height: 54px; border-radius: 50%;
  border: 3px solid #fff; background: #1757c2; color: #fff;
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.28);
  transition: transform .15s ease, background .15s ease;
}
.a11y-fab:hover { transform: scale(1.06); background: #0f47a6; }
.a11y-fab:focus-visible, .a11y-root button:focus-visible { outline: 3px solid #ffbf00; outline-offset: 3px; }
.a11y-fab svg { width: 30px; height: 30px; }

/* ── the panel ── */
.a11y-panel {
  position: absolute; bottom: 66px; left: 0;
  width: min(340px, calc(100vw - 36px));
  max-height: min(78vh, 620px); overflow-y: auto;
  background: #fff; color: #111; border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.3); border: 1px solid #d6d6d6;
  padding: 16px;
}
.a11y-panel[hidden] { display: none; }
.a11y-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.a11y-title { font-size: 17px; font-weight: 700; margin: 0; }
.a11y-close {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid #ccc;
  background: #f4f4f4; color: #111; font-size: 18px; line-height: 1; cursor: pointer;
}
.a11y-size { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; align-items: center; margin-bottom: 12px; }
.a11y-size span { text-align: center; font-size: 14px; font-weight: 600; }
.a11y-size button {
  height: 44px; border-radius: 10px; border: 1px solid #c9c9c9; background: #f4f4f4;
  color: #111; font-size: 20px; font-weight: 700; cursor: pointer;
}
.a11y-size button:disabled { opacity: .4; cursor: default; }
.a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a11y-opt {
  min-height: 64px; padding: 8px; border-radius: 12px;
  border: 2px solid #d9d9d9; background: #f7f7f7; color: #111;
  font-size: 13.5px; font-weight: 600; line-height: 1.25; cursor: pointer; text-align: center;
}
.a11y-opt[aria-pressed="true"] { border-color: #1757c2; background: #e7efff; color: #0b3a8a; }
.a11y-reset {
  width: 100%; margin-top: 12px; height: 42px; border-radius: 10px;
  border: 1px solid #c9c9c9; background: #fff; color: #111; font-size: 14px; font-weight: 700; cursor: pointer;
}
.a11y-note { margin: 10px 2px 0; font-size: 12px; color: #555; line-height: 1.4; }

/* ── effects (page content only) ── */

/* text size: zoom scales px- and rem-based layouts alike */
html.a11y-zoom-1 body > :not(.a11y-root) { zoom: 1.15; }
html.a11y-zoom-2 body > :not(.a11y-root) { zoom: 1.3; }
html.a11y-zoom-3 body > :not(.a11y-root) { zoom: 1.5; }

html.a11y-grayscale body > :not(.a11y-root) { filter: grayscale(1); }

html.a11y-contrast body { background: #000 !important; }
html.a11y-contrast body > :not(.a11y-root),
html.a11y-contrast body > :not(.a11y-root) * {
  background-color: #000 !important; background-image: none !important;
  color: #fff !important; border-color: #fff !important;
  text-shadow: none !important; box-shadow: none !important;
}
html.a11y-contrast body > :not(.a11y-root) a,
html.a11y-contrast body > :not(.a11y-root) a * { color: #ffe600 !important; }
html.a11y-contrast body > :not(.a11y-root) img,
html.a11y-contrast body > :not(.a11y-root) video { background: transparent !important; }

html.a11y-links body > :not(.a11y-root) a {
  text-decoration: underline !important; text-underline-offset: 3px;
  outline: 2px solid #ffbf00 !important; outline-offset: 2px;
}

html.a11y-font body > :not(.a11y-root),
html.a11y-font body > :not(.a11y-root) * {
  font-family: Arial, Helvetica, sans-serif !important;
  letter-spacing: .03em !important; word-spacing: .08em !important;
}

html.a11y-motion, html.a11y-motion * {
  animation: none !important; transition: none !important; scroll-behavior: auto !important;
}

html.a11y-cursor, html.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='M4 2l16 11-7 1.4 4 7.6-3 1.6-4-7.6L4 20z' fill='%23000' stroke='%23fff' stroke-width='1.3'/%3E%3C/svg%3E") 6 3, auto !important;
}

@media print { .a11y-root { display: none !important; } }
