/* Accessibility menu and modes of the public pages (a11y.js) — the same choices as the staff panel (src/a11y.css). */

.a11y-btn { all: unset; box-sizing: border-box; flex: none; margin-inline-start: auto; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; color: var(--ink2); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.a11y-btn.floating { position: fixed; top: 12px; inset-inline-end: 12px; z-index: 30; }
.a11y-btn.on { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.a11y-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.a11y-back { position: fixed; inset: 0; z-index: 40; background: rgba(10, 14, 20, .38); }
.a11y-panel { position: fixed; z-index: 41; top: 12px; inset-inline-end: 12px; width: 290px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 32px rgba(16, 24, 40, .22); padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.a11y-panel[hidden], .a11y-back[hidden] { display: none; }
.a11y-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 6px 2px; }
.a11y-head h2 { margin: 0; font-size: 17px; font-weight: 700; text-wrap: balance; }
.a11y-x { all: unset; box-sizing: border-box; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; font-size: 18px; color: var(--ink2); }
.a11y-size { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 15px; }
.a11y-stepper { display: flex; align-items: center; border: 1px solid var(--ink2); border-radius: 10px; overflow: hidden; }
.a11y-stepper button { all: unset; box-sizing: border-box; cursor: pointer; height: 44px; min-width: 44px; display: grid; place-items: center; font-size: 20px; font-weight: 600; color: var(--ink); }
.a11y-stepper button:disabled { color: var(--muted); cursor: default; opacity: .55; }
.a11y-stepper .a11y-pct { min-width: 62px; font-size: 14px; font-variant-numeric: tabular-nums; border-inline: 1px solid var(--line); direction: ltr; }
.a11y-row { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 8px; border-radius: 10px; font-size: 15px; }
.a11y-row span:first-child { text-wrap: balance; }
/* Off: an outlined track with the knob at the start; on: a filled track with the knob at the end (and a ✓). */
.a11y-switch { box-sizing: border-box; width: 40px; height: 24px; border-radius: 12px; border: 2px solid var(--muted); background: var(--card); position: relative; flex: none; }
.a11y-switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: inset-inline-start 150ms ease; }
.a11y-row[aria-checked="true"] .a11y-switch { background: var(--accent); border-color: var(--accent); }
.a11y-row[aria-checked="true"] .a11y-switch::after { inset-inline-start: 19px; background: #fff; }
@media (prefers-color-scheme: dark) { .a11y-row[aria-checked="true"] .a11y-switch::after { background: #0E1117; } }
.a11y-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 6px 2px; margin-top: 4px; border-top: 1px solid var(--line); }
.a11y-link { all: unset; cursor: pointer; display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.a11y-link:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.a11y-panel :is(button, a):focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

/* ── visible focus everywhere on these pages (WCAG 2.4.7) ── */
:where(a, button, input, select, textarea, [tabindex]):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.cb input:focus-visible, .cb select:focus-visible, .cb textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.pill:has(select:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ── text size: the page's content scaled (CSS zoom reflows; it doesn't overflow sideways) ── */
html[data-a11y-zoom] main > *, html[data-a11y-zoom] .sheet > * { zoom: var(--a11y-z); }
/* The forms are a fixed page; with larger text they scroll, so nothing is cut off. */
html.form-page:is([data-a11y-zoom="110"], [data-a11y-zoom="125"], [data-a11y-zoom="140"], [data-a11y-zoom="160"]),
html.form-page:is([data-a11y-zoom="110"], [data-a11y-zoom="125"], [data-a11y-zoom="140"], [data-a11y-zoom="160"]) body { height: auto; overflow: visible; position: static; touch-action: auto; }
html.form-page:is([data-a11y-zoom="110"], [data-a11y-zoom="125"], [data-a11y-zoom="140"], [data-a11y-zoom="160"]) main.cb { height: auto; overflow: visible; }
html.form-page:is([data-a11y-zoom="110"], [data-a11y-zoom="125"], [data-a11y-zoom="140"], [data-a11y-zoom="160"]) .cb-card { overflow: visible; }
html[data-a11y-zoom] .cb textarea { height: auto !important; min-height: 4.6em !important; }

/* ── the modes ── */
html.a11y-contrast {
  --bg: #fff; --card: #fff; --ink: #000; --ink2: #111; --muted: #2b2e33; --line: #4a4f55; --soft: #f0f0f0;
  --accent: #0b3d91; --accent-soft: #dde8fb; --off: #7a3300; --off-soft: #fff; --study: #00524b; --study-soft: #fff;
  --mem: #2a2290; --mem-soft: #fff; --fast: #222; --fast-soft: #fff; --year: #0b5223; --year-soft: #fff; --shadow: none;
}
@media (prefers-color-scheme: dark) {
  html.a11y-contrast {
    --bg: #000; --card: #000; --ink: #fff; --ink2: #f2f2f2; --muted: #e0e0e0; --line: #bfbfbf; --soft: #1a1a1a;
    --accent: #9cc0ff; --accent-soft: #0f1f3d; --off: #ffc98a; --off-soft: #000; --study: #8ff0e4; --study-soft: #000;
    --mem: #c9c6ff; --mem-soft: #000; --fast: #e0e0e0; --fast-soft: #000; --year: #9cf0b5; --year-soft: #000;
  }
}
html.a11y-contrast :is(.chip, .pill, .cb-pill, .tile, .next-badge, .cb input, .cb select, .cb textarea, .group, .cb-card) { border: 1px solid var(--ink) !important; }
html.a11y-contrast .row.past { opacity: 1; }
html.a11y-links a { text-decoration: underline !important; text-underline-offset: 3px; text-decoration-thickness: 2px; outline: 1px dashed currentColor; outline-offset: 2px; }
html.a11y-font, html.a11y-font * { font-family: Arial, "Helvetica Neue", sans-serif !important; letter-spacing: .01em; }
html.a11y-font body { line-height: 1.65; word-spacing: .06em; }
html.a11y-still *, html.a11y-still *::before, html.a11y-still *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* ── consent on the forms (callback.html, release.html, absence.html) ── */
.cb-consent { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.45; color: var(--ink2); min-height: 44px; }
.cb-consent input[type="checkbox"] { -webkit-appearance: auto; appearance: auto; flex: none; width: 22px; height: 22px; min-width: 22px; margin: 1px 0 0; padding: 0; accent-color: var(--accent); background: none; border: 0; }
.cb-consent label { text-wrap: balance; cursor: pointer; }
.cb-consent a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.cb-consent .cb-sign { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); text-wrap: balance; }
.cb-submit[disabled] { opacity: .55; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cb ::placeholder, .sheet ::placeholder { color: var(--muted); opacity: 1; }
.cb-pick .who, .cb-pick .who > * { text-wrap: balance; }
