/* Accessibility menu kit, by DetailedByDenise. Pair with a11y.js.
   Brand it by changing the four variables below (or override them in your own CSS). */
:root {
  --a11y-brand: #0b5a5e;        /* button, header, switches, active tiles */
  --a11y-brand-ink: #ffffff;    /* text on the brand color */
  --a11y-accent: #f47aa2;       /* highlight-titles outline and reading guide edge */
  --a11y-font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- The button and menu ---------- */
html { font-size: calc(100% * var(--a11y-font, 1)); }
.a11y-ui, .a11y-ui * { box-sizing: border-box; }
.a11y-open { position: fixed; bottom: 16px; z-index: 2147483000; width: 56px; height: 56px; border-radius: 50%; border: 3px solid #fff; background: var(--a11y-brand); color: var(--a11y-brand-ink); display: grid; place-items: center; cursor: pointer; padding: 0; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); }
.a11y-open.a11y-left, .a11y-panel.a11y-left { left: 16px; }
.a11y-open.a11y-right, .a11y-panel.a11y-right { right: 16px; }
.a11y-menu-open .a11y-open { display: none; }
.a11y-panel { position: fixed; z-index: 2147483001; bottom: 16px; width: min(400px, calc(100vw - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: #fff; color: #1d1d1f; border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); overflow: hidden; font: 16px/1.4 var(--a11y-font-ui); text-align: left; }
.a11y-panel[hidden] { display: none; }
.a11y-panel * { font-family: var(--a11y-font-ui) !important; letter-spacing: 0 !important; text-transform: none !important; text-align: left !important; line-height: 1.4 !important; filter: none !important; margin: 0; }
.a11y-head { display: flex; align-items: center; justify-content: space-between; background: var(--a11y-brand); color: var(--a11y-brand-ink); padding: 14px 14px 14px 20px; }
.a11y-head h2 { font-size: 20px; font-weight: 600; color: inherit; }
.a11y-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.16); color: inherit; font-size: 28px !important; line-height: 1 !important; cursor: pointer; text-align: center !important; }
.a11y-body { overflow-y: auto; padding: 16px 18px 20px; overscroll-behavior: contain; }
.a11y-body section { margin-top: 18px; }
.a11y-body h3 { margin-bottom: 10px; font-size: 13px; font-weight: 600; text-transform: uppercase !important; letter-spacing: 0.12em !important; color: var(--a11y-brand); }
.a11y-reset { width: 100%; min-height: 46px; border: 2px solid var(--a11y-brand); border-radius: 999px; background: #fff; color: var(--a11y-brand); font-size: 15px; font-weight: 600; cursor: pointer; text-align: center !important; }
.a11y-profiles { list-style: none; padding: 0; }
.a11y-prof { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eee; }
.a11y-prof-name { display: block; font-weight: 600; }
.a11y-prof-desc { display: block; font-size: 13px; color: #555; }
.a11y-switch { flex: none; display: flex; width: 92px; height: 40px; border-radius: 999px; border: 2px solid #c8c8cc; background: #f1f1f3; padding: 2px; cursor: pointer; }
.a11y-switch span { flex: 1; display: grid; place-items: center; border-radius: 999px; font-size: 13px; font-weight: 600; color: #555; text-align: center !important; }
.a11y-switch[aria-checked="false"] span:first-child, .a11y-switch[aria-checked="true"] span:last-child { background: #fff; color: #1d1d1f; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); }
.a11y-switch[aria-checked="true"] { background: var(--a11y-brand); border-color: var(--a11y-brand); }
.a11y-switch[aria-checked="true"] span:first-child { color: var(--a11y-brand-ink); }
.a11y-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px !important; }
.a11y-tile { min-height: 52px; padding: 8px 10px; border: 2px solid #e2e2e6; border-radius: 12px; background: #f6f6f8; color: #1d1d1f; font-size: 14px; font-weight: 600; cursor: pointer; text-align: center !important; }
.a11y-tile[aria-pressed="true"] { border-color: var(--a11y-brand); box-shadow: inset 0 0 0 1px var(--a11y-brand); background: #fff; }
.a11y-tile[aria-pressed="true"]::before { content: "\2713  "; color: var(--a11y-brand); }
.a11y-step { background: #f6f6f8; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px !important; }
.a11y-step-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px !important; }
.a11y-step-row { display: flex; align-items: center; gap: 10px; }
.a11y-step-row button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--a11y-brand); color: var(--a11y-brand-ink); font-size: 22px; cursor: pointer; text-align: center !important; }
.a11y-step-row button:disabled { opacity: 0.35; cursor: default; }
.a11y-step-row output { flex: 1; text-align: center !important; font-weight: 600; color: var(--a11y-brand); }
.a11y-note { margin-top: 18px !important; font-size: 13px; color: #555; }
.a11y-panel :focus-visible, .a11y-open:focus-visible { outline: 3px solid #000; outline-offset: 2px; box-shadow: 0 0 0 6px #fff200; }
.a11y-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
@media (max-width: 480px) {
  /* Phone: a shorter bottom sheet, so the page stays visible above it and visitors can see each setting take effect */
  .a11y-panel.a11y-left, .a11y-panel.a11y-right { left: 0; right: 0; bottom: 0; width: 100%; max-height: 62vh; max-height: 62dvh; border-radius: 18px 18px 0 0; }
  .a11y-head { padding: 8px 10px 8px 16px; }
  .a11y-head h2 { font-size: 18px; }
  .a11y-body { padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0px)); -webkit-overflow-scrolling: touch; }
  .a11y-body section { margin-top: 14px; }
  .a11y-prof { padding: 7px 0; }
  .a11y-prof-desc { font-size: 12.5px; }
  .a11y-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .a11y-tile { min-height: 46px; padding: 6px 8px; font-size: 13.5px; }
  .a11y-step { padding: 8px 10px; margin-bottom: 6px !important; }
  .a11y-step-row { gap: 8px; }
  .a11y-open { width: 50px; height: 50px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .a11y-open.a11y-left { left: 12px; } .a11y-open.a11y-right { right: 12px; }
}

/* ---------- What each setting does to the page ----------
   "The page" = every direct child of <body> except the menu itself. */
.a11y-readable body > :not(.a11y-ui), .a11y-readable body > :not(.a11y-ui) * { font-family: Verdana, Arial, Helvetica, sans-serif !important; }
.a11y-line-1 body > :not(.a11y-ui) :is(p, li, dd, dt, label, h1, h2, h3, h4, h5, h6, a, span, td, th, blockquote) { line-height: 2 !important; }
.a11y-line-2 body > :not(.a11y-ui) :is(p, li, dd, dt, label, h1, h2, h3, h4, h5, h6, a, span, td, th, blockquote) { line-height: 2.4 !important; }
.a11y-spacing-1 body > :not(.a11y-ui) :is(p, li, dd, dt, label, h1, h2, h3, h4, h5, h6, a, span, td, th, blockquote) { letter-spacing: 0.08em !important; word-spacing: 0.12em !important; }
.a11y-spacing-2 body > :not(.a11y-ui) :is(p, li, dd, dt, label, h1, h2, h3, h4, h5, h6, a, span, td, th, blockquote) { letter-spacing: 0.16em !important; word-spacing: 0.24em !important; }
.a11y-titles body > :not(.a11y-ui) :is(h1, h2, h3, h4, h5, h6) { outline: 3px solid var(--a11y-accent) !important; outline-offset: 4px; }
.a11y-links body > :not(.a11y-ui) a { background: #fff200 !important; color: #000 !important; text-decoration: underline !important; text-decoration-thickness: 2px !important; outline: 2px solid #000 !important; }
.a11y-align-left { --a11y-align: left; } .a11y-align-center { --a11y-align: center; } .a11y-align-right { --a11y-align: right; }
html[class*="a11y-align-"] body > :not(.a11y-ui) :is(p, h1, h2, h3, h4, h5, h6, li, label, blockquote) { text-align: var(--a11y-align) !important; }
body > :not(.a11y-ui) { filter: var(--a11y-filter, none); }
.a11y-dark body { background: #000 !important; }
.a11y-dark body > :not(.a11y-ui), .a11y-dark body > :not(.a11y-ui) *:not(img):not(video):not(svg):not(svg *):not(picture):not(canvas) { background-color: #000 !important; background-image: none !important; color: #fff !important; border-color: #fff !important; box-shadow: none !important; text-shadow: none !important; }
.a11y-dark body > :not(.a11y-ui) svg text { fill: #fff !important; }
.a11y-light body { background: #fff !important; }
.a11y-light body > :not(.a11y-ui), .a11y-light body > :not(.a11y-ui) *:not(img):not(video):not(svg):not(svg *):not(picture):not(canvas) { background-color: #fff !important; background-image: none !important; color: #000 !important; border-color: #000 !important; box-shadow: none !important; text-shadow: none !important; }
.a11y-light body > :not(.a11y-ui) svg text { fill: #000 !important; }
:is(.a11y-dark, .a11y-light) body > :not(.a11y-ui) :is(button, input, select, textarea, a[class*="btn"], a[class*="button"]) { border: 2px solid currentColor !important; }
.a11y-noimg body > :not(.a11y-ui) :is(img, video, picture, svg:not([aria-hidden="true"]), iframe) { visibility: hidden !important; }
.a11y-noimg body > :not(.a11y-ui), .a11y-noimg body > :not(.a11y-ui) * { background-image: none !important; }
/* :focus-visible, so a tap on a phone does not leave a big box behind */
.a11y-focus body > :not(.a11y-ui) :focus-visible { outline: 4px solid #fff200 !important; outline-offset: 2px !important; box-shadow: 0 0 0 8px #000 !important; }
.a11y-stop, .a11y-stop * { scroll-behavior: auto !important; }
.a11y-stop body > :not(.a11y-ui), .a11y-stop body > :not(.a11y-ui) *, .a11y-stop body > :not(.a11y-ui) *::before, .a11y-stop body > :not(.a11y-ui) *::after { animation: none !important; transition: none !important; }
/* Reading guide: one full-screen layer that dims everything except a band centred on --a11y-guide-y.
   Painted as a gradient (no giant box-shadow), which stays smooth on phones. */
.a11y-guidebar { display: none; position: fixed; inset: 0; z-index: 2147482999; pointer-events: none;
  --a11y-guide-y: 38vh; --a11y-guide-h: max(44px, 2.75rem); --a11y-dim: rgba(0, 0, 0, 0.4);
  --a11y-t: calc(var(--a11y-guide-y) - var(--a11y-guide-h) / 2); --a11y-b: calc(var(--a11y-guide-y) + var(--a11y-guide-h) / 2);
  background: linear-gradient(to bottom,
    var(--a11y-dim) 0, var(--a11y-dim) calc(var(--a11y-t) - 3px),
    var(--a11y-accent) calc(var(--a11y-t) - 3px), var(--a11y-accent) var(--a11y-t),
    transparent var(--a11y-t), transparent var(--a11y-b),
    var(--a11y-accent) var(--a11y-b), var(--a11y-accent) calc(var(--a11y-b) + 3px),
    var(--a11y-dim) calc(var(--a11y-b) + 3px), var(--a11y-dim) 100%); }
html.a11y-guide .a11y-guidebar { display: block; }
/* Highlight links wins over dark/light contrast */
html.a11y-links body > :not(.a11y-ui) a:not(img):not(video):not(svg):not(svg *):not(picture):not(canvas),
html.a11y-links body > a:not(.a11y-ui) { background: #fff200 !important; color: #000 !important; }
