/* Accessibility menu and the settings it applies (see assets/js/a11y.js). Shared by every page; uses the page's color tokens. */

/* ---------- settings ---------- */
html.a11y-size-1{font-size:112.5%}
html.a11y-size-2{font-size:125%}

/* high contrast: secondary text takes the main text color, lines and accents get stronger */
html:root.a11y-contrast{--fg-2:var(--fg);--line:rgba(24,62,53,.45);--line-2:rgba(24,62,53,.75);--spark-ink:#8C3A17;--glass:rgba(244,241,234,.97);--band-fg-2:var(--band-fg);--band-line:rgba(244,241,234,.42);--band-line-2:rgba(244,241,234,.72);--band-spark:#FFB38F;--band-glass:rgba(24,62,53,.97)}
@media (prefers-color-scheme:dark){
  html:root.a11y-contrast:not([data-theme="light"]){--fg-2:var(--fg);--line:rgba(241,237,227,.42);--line-2:rgba(241,237,227,.72);--spark-ink:#FFB38F;--glass:rgba(14,38,32,.97)}
}
html:root.a11y-contrast[data-theme="dark"]{--fg-2:var(--fg);--line:rgba(241,237,227,.42);--line-2:rgba(241,237,227,.72);--spark-ink:#FFB38F;--glass:rgba(14,38,32,.97)}

html.a11y-links a:not(.logo){text-decoration:underline!important;text-decoration-thickness:2px!important;text-underline-offset:.22em!important}
html.a11y-links a:not(.logo):not(.btn):not(.fab){background-image:none!important}

html.a11y-still{scroll-behavior:auto!important}
html.a11y-still *,html.a11y-still *::before,html.a11y-still *::after{animation-duration:.01ms!important;animation-delay:0s!important;animation-iteration-count:1!important;transition-duration:.01ms!important;transition-delay:0s!important}
html.a11y-still .rv{opacity:1!important;transform:none!important}

/* ---------- header button ---------- */
.a11y-ico{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.a11y-ico circle{fill:currentColor;stroke:none}

/* ---------- panel ---------- */
.a11y{position:fixed;z-index:60;display:grid;gap:10px;width:min(330px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain;padding:14px 16px 16px;border:1px solid var(--line-2);border-radius:20px;background:var(--surface);color:var(--fg);box-shadow:0 30px 70px -30px rgba(14,38,32,.55);font-family:var(--f-he);font-size:1rem;line-height:1.4;text-align:start}
.a11y[hidden]{display:none}
.a11y:focus{outline:none}
.a11y:focus-visible{outline:2px solid var(--focus);outline-offset:3px}
.a11y-hd{display:flex;align-items:center;justify-content:space-between;gap:12px}
.a11y-ttl{margin:0;font-size:1.0625rem;font-weight:500;line-height:1.3;letter-spacing:0}
.a11y-x{display:grid;place-items:center;width:40px;height:40px;flex:none;padding:0;border:0;border-radius:50%;background:transparent;color:var(--fg);cursor:pointer}
.a11y-x:hover{background:var(--bg-alt)}
.a11y-x svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.a11y-lbl{margin:0 0 6px;font-size:.875rem;color:var(--fg-2)}
.a11y-seg{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:4px;border:1px solid var(--line);border-radius:14px}
.a11y-seg button{min-height:40px;padding:0 6px;border:0;border-radius:10px;background:transparent;color:var(--fg);font:inherit;font-size:.9375rem;cursor:pointer}
.a11y-seg button:hover{background:var(--bg-alt)}
.a11y-seg button[aria-pressed="true"]{background:var(--fg);color:var(--bg)}
.a11y-tg{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:52px;padding:0 14px;border:1px solid var(--line);border-radius:14px;background:transparent;color:var(--fg);font:inherit;font-size:1rem;text-align:start;cursor:pointer}
.a11y-tg:hover{border-color:var(--line-2)}
.a11y-tg i{position:relative;flex:none;width:42px;height:26px;border:2px solid var(--fg-2);border-radius:999px;transition:background-color .25s,border-color .25s}
.a11y-tg i::after{content:"";position:absolute;top:3px;right:3px;width:16px;height:16px;border-radius:50%;background:var(--fg-2);transition:transform .3s cubic-bezier(.22,1,.36,1),background-color .25s}
.a11y-tg[aria-pressed="true"] i{border-color:var(--fg);background:var(--fg)}
.a11y-tg[aria-pressed="true"] i::after{background:var(--surface);transform:translateX(-16px)}
.a11y-ft{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px 16px;padding-top:2px;font-size:.9375rem}
.a11y-reset{padding:8px 0;border:0;background:none;color:var(--fg);font:inherit;text-decoration:underline;text-underline-offset:.22em;cursor:pointer}
.a11y-ft a{padding-block:8px;color:var(--fg);text-underline-offset:.22em}
@media print{.a11y{display:none!important}}
