/* Writrex accessibility menu. Everything here is opt-in: nothing changes unless the visitor picks an option
   (the choices are stored in this browser only, under "wx_a11y"). Classes are set on <html> by a11y.js. */

/* ---------- Button + panel ---------- */
.a11y-btn { position: fixed; left: 16px; bottom: 16px; z-index: 130; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--mint); background: var(--surface); color: var(--mint); display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.6); padding: 0; }
.a11y-btn:hover { background: var(--surface-2); }
.a11y-btn svg { width: 26px; height: 26px; fill: currentColor; }
@media (max-width: 720px) { body:has(#cookie-banner:not([hidden])) .a11y-btn { bottom: 210px; } }

.a11y-panel { position: fixed; left: 16px; bottom: 76px; z-index: 131; width: min(360px, calc(100vw - 32px)); max-height: calc(100vh - 100px); overflow: auto; background: var(--surface); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 16px 18px 18px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.7); font-size: 14px; line-height: 1.45; }
.a11y-panel[hidden] { display: none; }
.a11y-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.a11y-head h2 { font-size: 16px; margin: 0; padding: 0; }
.a11y-x { background: none; border: 1px solid var(--line-2); color: var(--text); border-radius: 8px; width: 32px; height: 32px; font-size: 18px; line-height: 1; cursor: pointer; }
.a11y-group { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; }
.a11y-group legend { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 0; margin-bottom: 6px; }
.a11y-row { display: flex; flex-wrap: wrap; gap: 6px; }
.a11y-opt { flex: 1 1 auto; font: inherit; font-size: 13px; color: var(--text); background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; min-height: 36px; cursor: pointer; text-align: center; }
.a11y-opt:hover { border-color: var(--mint-line); }
.a11y-opt[aria-pressed="true"] { background: var(--mint); color: var(--mint-ink); border-color: var(--mint); font-weight: 600; }
.a11y-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.a11y-size { align-self: center; flex: 0 0 auto; min-width: 52px; text-align: center; color: var(--muted); }
.a11y-read select { font: inherit; font-size: 13px; color: var(--text); background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 8px; min-height: 36px; }
.a11y-status { margin: 8px 0 0; color: var(--muted); min-height: 1.4em; }
.a11y-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.a11y-foot small { color: var(--muted); font-size: 12px; }
.a11y-btn:focus-visible, .a11y-panel button:focus-visible, .a11y-panel select:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; }

/* ---------- Text size (browser zoom style; steps 1 to 3) ---------- */
html.a11y-text-1 { zoom: 1.15; }
html.a11y-text-2 { zoom: 1.3; }
html.a11y-text-3 { zoom: 1.5; }

/* ---------- Readable font and text spacing ---------- */
html.a11y-font { --font-sans: "Atkinson Hyperlegible", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --font-mono: "Atkinson Hyperlegible", "Inter", system-ui, sans-serif; }
html.a11y-font body { font-family: var(--font-sans); }
html.a11y-spacing body { line-height: 1.9; letter-spacing: 0.05em; word-spacing: 0.14em; }
html.a11y-spacing p, html.a11y-spacing li { margin-bottom: 0.9em; }

/* ---------- Links, focus, cursor ---------- */
html.a11y-links a:not(.btn):not([class*="btn-"]), html.a11y-contrast a:not(.btn):not([class*="btn-"]) { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
html.a11y-focus :focus-visible { outline: 4px solid #ffbf00 !important; outline-offset: 3px !important; border-radius: 4px; box-shadow: 0 0 0 7px rgba(0, 0, 0, 0.85) !important; }
html.a11y-cursor, html.a11y-cursor body { cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24'><path d='M4 2l16 9-7 2 4 8-3 1.5-4-8-5 5z' fill='white' stroke='black' stroke-width='1.6' stroke-linejoin='round'/></svg>") 4 2, auto; }
html.a11y-cursor a, html.a11y-cursor button, html.a11y-cursor [role="button"], html.a11y-cursor select, html.a11y-cursor summary { cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24'><path d='M4 2l16 9-7 2 4 8-3 1.5-4-8-5 5z' fill='%23ffe14d' stroke='black' stroke-width='1.6' stroke-linejoin='round'/></svg>") 4 2, pointer; }

/* ---------- Pause animations (same rules the site applies for "reduce motion") ---------- */
html.a11y-still { scroll-behavior: auto; }
html.a11y-still *, html.a11y-still *::before, html.a11y-still *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; transition-delay: 0s !important; }
html.a11y-still .marquee .track { animation: none; }
html.a11y-still .marquee-builders { -webkit-mask-image: none; mask-image: none; }
html.a11y-still .marquee-builders .track { width: auto; flex-wrap: wrap; justify-content: center; padding-inline: var(--gutter); }
html.a11y-still .marquee-builders .track [aria-hidden="true"] { display: none; }
html.a11y-still .js .reveal { opacity: 1; transform: none; }

/* ---------- Light colours ---------- */
html.a11y-light { color-scheme: light; --bg: #f7f9fc; --bg-2: #eef2f8; --surface: #ffffff; --surface-2: #f1f5fb; --line: #d5dde9; --line-2: #b9c5d6; --text: #0b1322; --muted: #3d4c5f; --dim: #4f5f75; --mint: #00785a; --mint-ink: #ffffff; --mint-soft: rgba(0, 120, 90, 0.09); --mint-line: rgba(0, 120, 90, 0.4); --blue: #1d5fd1; --amber: #8a5200; --red: #b3261e; }
html.a11y-light .a11y-btn, html.a11y-light .a11y-panel, html.a11y-light .cookie-banner { box-shadow: 0 14px 34px -14px rgba(11, 19, 34, 0.35); }

/* ---------- High contrast (dark) ---------- */
html.a11y-contrast { --bg: #000000; --bg-2: #000000; --surface: #000000; --surface-2: #0d0d0d; --line: #8c8c8c; --line-2: #bdbdbd; --text: #ffffff; --muted: #ffffff; --dim: #f0f0f0; --mint: #4dffc4; --mint-ink: #000000; --mint-soft: rgba(77, 255, 196, 0.14); --mint-line: #4dffc4; --blue: #9ccaff; --amber: #ffd08a; --red: #ff8a89; }


/* Light colours: parts of the site use fixed dark-theme colours, so override them here. */
html.a11y-light .site-header { background: rgba(247, 249, 252, 0.94); border-bottom-color: var(--line); }
html.a11y-light .section-alt { background: linear-gradient(180deg, transparent, rgba(226, 233, 244, 0.8) 12%, rgba(226, 233, 244, 0.8) 88%, transparent); }
html.a11y-light .fig { background: linear-gradient(180deg, #ffffff, #f3f6fb); }
html.a11y-light .prose p, html.a11y-light .prose ul, html.a11y-light .prose ol, html.a11y-light .callout.answer { color: #2f3d50; }
html.a11y-light .prose pre code { color: #1c2a3d; }
html.a11y-light .plan.agency { color: #6b2fa8; }
html.a11y-light .notice { color: #a02020; }
@media print { .a11y-btn, .a11y-panel { display: none !important; } }
