/* Accessibility sidebar and the visual adjustments it applies.
   Panel sizes are in px so they stay fixed when visitors enlarge the page text. */
@font-face {
  font-family: "OpenDyslexic";
  src: url("../fonts/opendyslexic/opendyslexic-regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- Launcher and panel ---------- */
.a11y-root { --a11y-accent: #1a5fd9; --a11y-ink: #1b1d29; --a11y-bg: #f2f3f7; --a11y-card: #fff; --a11y-line: #dfe2ea; font: 400 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; letter-spacing: normal; word-spacing: normal; text-align: left; color: var(--a11y-ink); }
.a11y-root *, .a11y-root *::before, .a11y-root *::after { box-sizing: border-box; letter-spacing: normal; word-spacing: normal; font-family: inherit; text-align: inherit; }
.a11y-launch { position: fixed; bottom: 20px; right: 20px; z-index: 9000; width: 58px; height: 58px; display: grid; place-items: center; border: 3px solid #fff; border-radius: 50%; background: var(--a11y-accent); color: #fff; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.28); transition: transform .15s; }
.a11y-launch:hover { transform: scale(1.06); }
.a11y-launch:focus-visible { outline: 3px solid #ffbf47; outline-offset: 3px; }
.a11y-launch .a11y-ico { width: 32px; height: 32px; stroke-width: 2; }
.a11y-pos-left .a11y-launch { right: auto; left: 20px; }
.a11y-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 9001; width: min(420px, 100vw); display: flex; flex-direction: column; background: var(--a11y-bg); box-shadow: -10px 0 40px rgba(0,0,0,.25); outline: none; animation: a11y-in .2s ease-out; }
.a11y-pos-left .a11y-panel { right: auto; left: 0; box-shadow: 10px 0 40px rgba(0,0,0,.25); animation-name: a11y-in-left; }
.a11y-panel[hidden] { display: none; }
@keyframes a11y-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes a11y-in-left { from { transform: translateX(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
.a11y-head { display: flex; align-items: center; gap: 8px; padding: 16px 16px 16px 20px; background: var(--a11y-accent); color: #fff; }
.a11y-head > div { flex: 1; }
.a11y-title { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.2; color: #fff; }
.a11y-sub { margin: 2px 0 0; font-size: 13px; opacity: .9; }
.a11y-sub kbd { display: inline-block; padding: 0 5px; border: 1px solid rgba(255,255,255,.6); border-radius: 4px; font: inherit; font-size: 12px; }
.a11y-icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(0,0,0,.22); color: #fff; cursor: pointer; }
.a11y-icon-btn:hover { background: rgba(0,0,0,.35); }
.a11y-icon-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.a11y-icon-btn .a11y-ico { width: 20px; height: 20px; }
.a11y-body { flex: 1; overflow-y: auto; padding: 4px 16px 20px; overscroll-behavior: contain; }
.a11y-h { margin: 18px 4px 10px; font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--a11y-ink); }
.a11y-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.a11y-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.a11y-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 104px; padding: 12px 8px 16px; background: var(--a11y-card); color: var(--a11y-ink); border: 2px solid var(--a11y-line); border-radius: 12px; font-size: 13px; font-weight: 600; line-height: 1.25; text-align: center; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.a11y-profile { flex-direction: row; justify-content: flex-start; min-height: 60px; padding: 10px 12px; text-align: left; }
.a11y-tile:hover { border-color: var(--a11y-accent); }
.a11y-tile:focus-visible, .a11y-round:focus-visible, .a11y-reset-all:focus-visible, .a11y-foot a:focus-visible { outline: 3px solid var(--a11y-accent); outline-offset: 2px; }
.a11y-tile[aria-pressed="true"] { border-color: var(--a11y-accent); background: #e9f0fd; box-shadow: 0 0 0 4px rgba(26,95,217,.15); color: #0e3f99; }
.a11y-tile[aria-pressed="true"]::after { content: ""; position: absolute; top: 7px; right: 7px; width: 16px; height: 16px; border-radius: 50%; background: var(--a11y-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2l2.6 2.6L12 5.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.a11y-tile:disabled { opacity: .45; cursor: not-allowed; }
.a11y-tile .a11y-ico { width: 30px; height: 30px; flex: none; }
.a11y-profile .a11y-ico { width: 26px; height: 26px; }
.a11y-tile-state { font-size: 11px; font-weight: 500; color: #4a5068; min-height: 0; }
.a11y-tile-state:empty { display: none; }
.a11y-dots { position: absolute; bottom: 7px; left: 50%; display: flex; gap: 4px; transform: translateX(-50%); }
.a11y-dots span { width: 12px; height: 3px; border-radius: 2px; background: var(--a11y-line); }
.a11y-dots span.on { background: var(--a11y-accent); }
.a11y-size { margin-bottom: 10px; padding: 12px; background: var(--a11y-card); border: 2px solid var(--a11y-line); border-radius: 12px; }
.a11y-size-label { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 14px; font-weight: 700; }
.a11y-size-label .a11y-ico { width: 28px; height: 28px; }
.a11y-size-row { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; }
.a11y-round { width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--a11y-accent); color: #fff; cursor: pointer; }
.a11y-round .a11y-ico { width: 22px; height: 22px; stroke-width: 2.4; }
.a11y-size-value { min-width: 96px; padding: 9px 0; border-radius: 999px; background: #e7e9ef; font-size: 15px; font-weight: 700; text-align: center; color: #0e3f99; }
.a11y-note { margin: 10px 4px 0; padding: 10px 12px; border-radius: 10px; background: #fff7d6; font-size: 13px; color: #4d3b00; }
.a11y-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; background: var(--a11y-card); border-top: 1px solid var(--a11y-line); }
.a11y-foot a { color: var(--a11y-ink); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.a11y-reset-all { min-height: 40px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--a11y-ink); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.a11y-root .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.a11y-guide { position: fixed; top: 0; left: 0; right: 0; z-index: 8999; height: 14px; margin-top: -7px; pointer-events: none; background: rgba(255, 213, 0, .35); border-top: 3px solid #1b1d29; border-bottom: 3px solid #1b1d29; will-change: transform; }
.a11y-guide[hidden] { display: none; }
@media (max-width: 420px) { .a11y-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .a11y-launch { width: 52px; height: 52px; bottom: 14px; right: 14px; } .a11y-pos-left .a11y-launch { left: 14px; } }
@media print { .a11y-root { display: none !important; } }

/* ---------- Adjustments applied to the page (never to the sidebar) ---------- */
html.a11y-fs { font-size: calc(100% * var(--a11y-fs, 1)); }

html.a11y-titles :is(h1, h2, h3, h4, h5, h6):not(.a11y-root *) { outline: 3px solid #1a5fd9 !important; outline-offset: 4px; border-radius: 2px; }
html.a11y-links a:not(.a11y-root *) { outline: 2px solid #1a5fd9 !important; outline-offset: 2px; background-color: #fff3a8 !important; color: #111 !important; text-decoration: underline !important; }

html.a11y-dyslexia body :not(.a11y-root, .a11y-root *, svg, svg *, code, pre, kbd) { font-family: "OpenDyslexic", "Comic Sans MS", sans-serif !important; }
html.a11y-bold body :not(.a11y-root, .a11y-root *, svg, svg *) { font-weight: 700 !important; }

html.a11y-ls-1 body :not(.a11y-root, .a11y-root *) { letter-spacing: .06em !important; word-spacing: .12em !important; }
html.a11y-ls-2 body :not(.a11y-root, .a11y-root *) { letter-spacing: .12em !important; word-spacing: .2em !important; }
html.a11y-ls-3 body :not(.a11y-root, .a11y-root *) { letter-spacing: .18em !important; word-spacing: .3em !important; }

html.a11y-lh-1 :is(p, li, dt, dd, blockquote, td, th, figcaption, address, label, summary, .prose, .lead):not(.a11y-root *) { line-height: 1.9 !important; }
html.a11y-lh-2 :is(p, li, dt, dd, blockquote, td, th, figcaption, address, label, summary, .prose, .lead):not(.a11y-root *) { line-height: 2.3 !important; }
html.a11y-lh-3 :is(p, li, dt, dd, blockquote, td, th, figcaption, address, label, summary, .prose, .lead):not(.a11y-root *) { line-height: 2.7 !important; }
html:is(.a11y-lh-1, .a11y-lh-2, .a11y-lh-3) :is(h1, h2, h3, h4, h5, h6):not(.a11y-root *) { line-height: 1.5 !important; }

html.a11y-align-left :is(p, li, h1, h2, h3, h4, h5, h6, dt, dd, blockquote, td, th, figcaption, address, label, .lead):not(.a11y-root *) { text-align: left !important; }
html.a11y-align-center :is(p, li, h1, h2, h3, h4, h5, h6, dt, dd, blockquote, td, th, figcaption, address, label, .lead):not(.a11y-root *) { text-align: center !important; }
html.a11y-align-right :is(p, li, h1, h2, h3, h4, h5, h6, dt, dd, blockquote, td, th, figcaption, address, label, .lead):not(.a11y-root *) { text-align: right !important; }

/* Contrast modes recolour the page but leave photos, video and embeds untouched. */
html.a11y-c-dark, html.a11y-c-dark body { background: #121212 !important; }
html.a11y-c-dark body :not(.a11y-root, .a11y-root *, img, picture, video, iframe, svg, svg *) { background-color: #121212 !important; color: #ececec !important; border-color: #454545 !important; box-shadow: none !important; }
html.a11y-c-dark body a:not(.a11y-root *), html.a11y-c-dark body a:not(.a11y-root *) * { color: #9cc2ff !important; }
html.a11y-c-dark body :is(button, .btn, input, select, textarea):not(.a11y-root *) { background-color: #1f1f1f !important; border-color: #8a8a8a !important; }

html.a11y-c-light, html.a11y-c-light body { background: #fff !important; }
html.a11y-c-light body :not(.a11y-root, .a11y-root *, img, picture, video, iframe, svg, svg *) { background-color: #fff !important; color: #111 !important; border-color: #8c8c8c !important; text-shadow: none !important; }
html.a11y-c-light body a:not(.a11y-root *), html.a11y-c-light body a:not(.a11y-root *) * { color: #0645ad !important; }
html.a11y-c-light body :is(button, .btn):not(.a11y-root *) { border: 2px solid #111 !important; }
html.a11y-c-light .brand-logo { background: #111 !important; border-radius: 6px; padding: 4px; }

html.a11y-c-high, html.a11y-c-high body { background: #000 !important; }
html.a11y-c-high body :not(.a11y-root, .a11y-root *, img, picture, video, iframe, svg, svg *) { background-color: #000 !important; color: #fff !important; border-color: #fff !important; box-shadow: none !important; text-shadow: none !important; }
html.a11y-c-high body a:not(.a11y-root *), html.a11y-c-high body a:not(.a11y-root *) * { color: #ffff00 !important; text-decoration: underline !important; }
html.a11y-c-high body :is(button, .btn, input, select, textarea):not(.a11y-root *) { border: 2px solid #fff !important; }
html.a11y-c-high body :focus-visible:not(.a11y-root *) { outline: 3px solid #ffff00 !important; outline-offset: 3px !important; }
html:is(.a11y-c-dark, .a11y-c-high) body [class*="hero"]:not(.a11y-root *) { background-image: none !important; }

/* Saturation filters go on the page content, not on <html>, so the fixed sidebar keeps working. */
html.a11y-s-low body > :not(.a11y-root) { filter: saturate(.4); }
html.a11y-s-high body > :not(.a11y-root) { filter: saturate(1.9); }
html.a11y-s-mono body > :not(.a11y-root) { filter: grayscale(1); }

html.a11y-still *, html.a11y-still *::before, html.a11y-still *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; animation-play-state: paused !important; transition: none !important; scroll-behavior: auto !important; }
html.a11y-still .a11y-panel { animation: none !important; }

html.a11y-cursor, html.a11y-cursor * { cursor: url("../icons/a11y-cursor.svg") 4 2, auto !important; }
html.a11y-cursor :is(a, button, label, summary, select, [role="button"]), html.a11y-cursor :is(a, button, label, summary, select, [role="button"]) * { cursor: url("../icons/a11y-pointer.svg") 14 3, pointer !important; }
