/* Accessibility kit 1.0.3. Link it before the site's adapter:
     <link rel="stylesheet" href="/assets/a11y/a11y.css"><link rel="stylesheet" href="/assets/a11y/adapter.css">
   The panel takes every colour, typeface and radius from the --a11y-* tokens below; each site's adapter maps them to
   its own design tokens, so the panel reads as part of the site. Effects are keyed on data-a11y-* attributes that
   a11y-boot.js sets on <html>; none touches the panel itself. Fonts: SIL OFL 1.1 (see fonts/). */

/* ---------- reading typefaces (downloaded only when chosen) ---------- */
@font-face { font-family: "A11y Legible"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/atkinson-hyperlegible-next/atkinson-hyperlegible-next-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "A11y Legible"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/atkinson-hyperlegible-next/atkinson-hyperlegible-next-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "A11y Legible"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/atkinson-hyperlegible-next/atkinson-hyperlegible-next-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "A11y Legible"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/atkinson-hyperlegible-next/atkinson-hyperlegible-next-latin-ext-700-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "A11y Dyslexic"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/opendyslexic/opendyslexic-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "A11y Dyslexic"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/opendyslexic/opendyslexic-latin-700-normal.woff2) format("woff2"); }

/* ---------- tokens: neutral defaults at zero specificity, so any adapter rule wins ---------- */
:where(:root) {
  --a11y-bg: #f7f4ee;
  --a11y-surface: #fffdf8;
  --a11y-ink: #14181f;
  --a11y-muted: #545a66;
  --a11y-line: rgba(20, 24, 31, .14);
  --a11y-accent: #7a5c1e;            /* switches, values, eyebrow: the site's gold or metal, at 4.5:1 on --a11y-bg */
  --a11y-accent-ink: #fffdf8;        /* text on --a11y-accent */
  --a11y-focus: #1f3f8a;
  --a11y-mark: #8a6a1f;              /* outlines drawn on the page (links, headings, guide): at least 3:1 on the page */
  --a11y-display: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --a11y-ui: system-ui, -apple-system, "Segoe UI", sans-serif;
  --a11y-radius: 2px;                /* buttons and segments; 999px for pill sites */
  --a11y-sheet-radius: 0px;
  --a11y-shadow: 0 30px 80px -30px rgba(10, 16, 30, .45);
  --a11y-backdrop: rgba(10, 16, 30, .32);
  --a11y-width: 400px;
  --a11y-ease: cubic-bezier(.2, .7, .2, 1);
  --a11y-k: 1;                       /* panel text scale, set by a11y.js from the visitor's text size */
}
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"]):not([data-mode="light"])) {
    --a11y-bg: #0e131c; --a11y-surface: #151b26; --a11y-ink: #efeae0; --a11y-muted: #aeb4bf;
    --a11y-line: rgba(239, 234, 224, .16); --a11y-accent: #d6b676; --a11y-accent-ink: #0e131c;
    --a11y-focus: #a9bdf7; --a11y-mark: #d6b676; --a11y-backdrop: rgba(0, 0, 0, .5);
  }
}

/* ---------- the panel: a quiet side sheet, typeset like the site ---------- */
dialog.a11y {
  position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; border: 0;
  width: min(var(--a11y-width), 100vw); max-width: 100vw; height: 100%; max-height: none;
  background: transparent; color: var(--a11y-ink); overflow: visible;
  font: 400 calc(15px * var(--a11y-k)) / 1.45 var(--a11y-ui);
  letter-spacing: normal; word-spacing: normal; text-align: left; text-transform: none;
  -webkit-font-smoothing: antialiased; color-scheme: inherit;
}
dialog.a11y::backdrop { background: var(--a11y-backdrop); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.a11y *, .a11y *::before, .a11y *::after { box-sizing: border-box; }
.a11y__sheet {
  display: flex; flex-direction: column; height: 100%;
  background: var(--a11y-bg); border-left: 1px solid var(--a11y-line);
  border-radius: var(--a11y-sheet-radius) 0 0 var(--a11y-sheet-radius); box-shadow: var(--a11y-shadow);
}
dialog.a11y[open] .a11y__sheet { animation: a11y-in .42s var(--a11y-ease); }
@keyframes a11y-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.a11y__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 28px 28px 18px; border-bottom: 1px solid var(--a11y-line);
}
.a11y__eyebrow, .a11y__label {
  margin: 0; font: 600 calc(11px * var(--a11y-k)) / 1.2 var(--a11y-ui);
  letter-spacing: .16em; text-transform: uppercase; color: var(--a11y-accent);
}
.a11y__title {
  margin: 6px 0 0; font: var(--a11y-display-weight, 500) calc(32px * var(--a11y-k)) / 1.05 var(--a11y-display);
  letter-spacing: .005em; color: var(--a11y-ink);
}
.a11y__close {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: -6px -10px 0 0;
  border: 1px solid transparent; border-radius: 999px; background: none; color: var(--a11y-ink); cursor: pointer;
}
.a11y__close:hover { border-color: var(--a11y-line); }
.a11y svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }

.a11y__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 28px 24px; scrollbar-width: thin; }
.a11y__section { padding: 22px 0 18px; border-bottom: 1px solid var(--a11y-line); }
.a11y__section:last-child { border-bottom: 0; }
.a11y__label { margin-bottom: 12px; }

/* profiles: four quiet cards */
.a11y__profiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a11y__profile {
  display: flex; flex-direction: column; gap: 4px; min-height: 44px; padding: 12px 14px; text-align: left;
  background: var(--a11y-surface); color: var(--a11y-ink); cursor: pointer;
  border: 1px solid var(--a11y-line); border-radius: var(--a11y-radius);
  font: inherit; transition: border-color .25s var(--a11y-ease), background-color .25s var(--a11y-ease);
}
.a11y__profile:hover { border-color: var(--a11y-accent); }
.a11y__profile[aria-pressed="true"] { border-color: var(--a11y-accent); box-shadow: inset 0 0 0 1px var(--a11y-accent); }
.a11y__profile-name { font: var(--a11y-display-weight, 500) calc(19px * var(--a11y-k)) / 1.1 var(--a11y-display); }
.a11y__profile-desc { font-size: calc(12.5px * var(--a11y-k)); line-height: 1.35; color: var(--a11y-muted); }

/* rows */
.a11y__row, .a11y__switch, .a11y__choice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 48px; margin: 0; padding: 4px 0;
}
.a11y__name { color: var(--a11y-ink); }
.a11y__stepper { display: inline-flex; align-items: center; gap: 2px; }
.a11y__step {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0; cursor: pointer;
  border: 1px solid var(--a11y-line); border-radius: var(--a11y-radius); background: var(--a11y-surface); color: var(--a11y-ink);
}
.a11y__step:hover:not([aria-disabled="true"]) { border-color: var(--a11y-accent); }
.a11y__step[aria-disabled="true"] { opacity: .38; cursor: default; }
.a11y__value {
  min-width: 78px; text-align: center; font-variant-numeric: tabular-nums;
  font-size: calc(13px * var(--a11y-k)); color: var(--a11y-accent); font-weight: 600; letter-spacing: .02em;
}

/* switches */
.a11y__switch { background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.a11y__track {
  flex: none; position: relative; width: 40px; height: 22px; border-radius: 999px;
  border: 1px solid var(--a11y-muted); transition: background-color .25s var(--a11y-ease), border-color .25s var(--a11y-ease);
}
.a11y__knob {
  position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--a11y-muted); transition: transform .25s var(--a11y-ease), background-color .25s var(--a11y-ease);
}
.a11y__switch[aria-checked="true"] .a11y__track { background: var(--a11y-accent); border-color: var(--a11y-accent); }
.a11y__switch[aria-checked="true"] .a11y__knob { transform: translateX(18px); background: var(--a11y-accent-ink); }

/* segmented choices: native radios, drawn as hairline segments */
.a11y__choice { border: 0; flex-wrap: wrap; }
.a11y__choice legend { float: left; padding: 0; margin-right: auto; }
.a11y__segments { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--a11y-line); border-radius: var(--a11y-radius); overflow: hidden; }
.a11y__segment { position: relative; display: inline-flex; cursor: pointer; }
.a11y__segment + .a11y__segment { border-left: 1px solid var(--a11y-line); }
.a11y__radio { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.a11y__segment span {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px;
  font-size: calc(13px * var(--a11y-k)); color: var(--a11y-muted); background: var(--a11y-surface);
  transition: background-color .25s var(--a11y-ease), color .25s var(--a11y-ease);
}
.a11y__radio:checked + span { background: var(--a11y-accent); color: var(--a11y-accent-ink); }
.a11y__segment:hover .a11y__radio:not(:checked) + span { color: var(--a11y-ink); }

/* buttons, read aloud, outline, footer */
.a11y__actions, .a11y__foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.a11y__foot-row { justify-content: space-between; }
.a11y__button {
  min-height: 44px; padding: 0 18px; cursor: pointer; font: 600 calc(13px * var(--a11y-k)) / 1 var(--a11y-ui); letter-spacing: .04em;
  border: 1px solid var(--a11y-accent); border-radius: var(--a11y-radius); background: var(--a11y-accent); color: var(--a11y-accent-ink);
}
.a11y__button--quiet { background: transparent; color: var(--a11y-ink); border-color: var(--a11y-line); }
.a11y__button--quiet:hover { border-color: var(--a11y-accent); }
.a11y__button:disabled { opacity: .4; cursor: default; }
.a11y__button[hidden] { display: none; }
.a11y__hint { margin: 10px 0 0; color: var(--a11y-muted); font-size: calc(13px * var(--a11y-k)); }
.a11y__hint[hidden] { display: none; }
.a11y__outline { list-style: none; margin: 0; padding: 0; }
.a11y__outline-item--h3 { padding-left: 16px; }
.a11y__outline-link {
  display: block; width: 100%; min-height: 40px; padding: 8px 0; text-align: left; cursor: pointer;
  border: 0; border-bottom: 1px solid var(--a11y-line); background: none; color: var(--a11y-ink); font: inherit;
}
.a11y__outline-link:hover { color: var(--a11y-accent); }
.a11y__foot { padding: 16px 28px 22px; border-top: 1px solid var(--a11y-line); background: var(--a11y-bg); }
.a11y__link { color: var(--a11y-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--a11y-accent); }
.a11y__note { margin: 12px 0 0; font-size: calc(12px * var(--a11y-k)); color: var(--a11y-muted); }

.a11y :focus-visible { outline: 2px solid var(--a11y-focus); outline-offset: 2px; }
/* two-tone ring drawn inside the segment, visible on the filled (checked) and the plain segment alike */
.a11y__radio:focus-visible + span { outline: 2px solid var(--a11y-focus); outline-offset: -2px;
  box-shadow: inset 0 0 0 4px var(--a11y-accent-ink), inset 0 0 0 6px var(--a11y-ink); }

@media (max-width: 520px) {
  dialog.a11y { inset: auto 0 0 0; width: 100vw; height: 88dvh; }
  .a11y__sheet { border-left: 0; border-top: 1px solid var(--a11y-line); border-radius: var(--a11y-sheet-radius) var(--a11y-sheet-radius) 0 0; }
  dialog.a11y[open] .a11y__sheet { animation-name: a11y-up; }
  .a11y__head, .a11y__body, .a11y__foot { padding-left: 20px; padding-right: 20px; }
  .a11y__profiles { grid-template-columns: 1fr; }
}
@keyframes a11y-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .a11y *, dialog.a11y[open] .a11y__sheet { animation: none !important; transition: none !important; } }
@media (forced-colors: active) {
  .a11y__sheet { border: 1px solid CanvasText; }
  .a11y__track, .a11y__knob { forced-color-adjust: none; border-color: CanvasText; }
  .a11y__knob { background: CanvasText; }
  .a11y__switch[aria-checked="true"] .a11y__track { background: Highlight; border-color: Highlight; }
  .a11y__switch[aria-checked="true"] .a11y__knob { background: HighlightText; }
  .a11y__radio:checked + span { background: Highlight; color: HighlightText; forced-color-adjust: none; }
  .a11y__profile[aria-pressed="true"] { border: 3px solid Highlight; }
  .a11y__radio:focus-visible + span { outline: 2px solid CanvasText; box-shadow: none; }
}

/* ---------- layer: reading guide, mask, magnifier ---------- */
.a11y-layer { position: fixed; inset: 0; pointer-events: none; z-index: 2147483000; }
.a11y-guide, .a11y-mask, .a11y-magnifier { display: none; position: fixed; left: 0; top: 0; }
html[data-a11y-guide] .a11y-guide {
  display: block; width: 100%; height: 0; border-top: 3px solid var(--a11y-mark);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 6px 18px -6px rgba(0, 0, 0, .35); margin-top: 14px;
}
html[data-a11y-mask] .a11y-mask { display: block; width: 100%; background: rgba(6, 10, 18, .62); }
.a11y-mask--top { top: 0; }
.a11y-mask--bottom { top: auto; bottom: 0; }
.a11y-magnifier.is-on {
  display: block; max-width: min(560px, calc(100vw - 24px)); padding: 14px 18px;
  font: 500 28px/1.3 var(--a11y-ui); color: var(--a11y-ink); background: var(--a11y-surface);
  border: 1px solid var(--a11y-accent); border-radius: var(--a11y-radius); box-shadow: var(--a11y-shadow);
}
.a11y-reading { outline: 2px solid var(--a11y-mark) !important; outline-offset: 4px !important; }

/* ---------- page effects (never the panel) ---------- */
/* typeface */
html[data-a11y-font="readable"] body :not(.a11y, .a11y *, svg, svg *, code, pre, kbd, samp, [aria-hidden="true"], [aria-hidden="true"] *, [class*="icon"], [class*="icon"] *, .fa, .fas, .far, .fab, .fa-solid, .fa-regular, .fa-brands, [class*="material-symbols"], [class*="material-icons"], i:empty) {
  font-family: "A11y Legible", Verdana, Tahoma, sans-serif !important;
}
html[data-a11y-font="dyslexic"] body :not(.a11y, .a11y *, svg, svg *, code, pre, kbd, samp, [aria-hidden="true"], [aria-hidden="true"] *, [class*="icon"], [class*="icon"] *, .fa, .fas, .far, .fab, .fa-solid, .fa-regular, .fa-brands, [class*="material-symbols"], [class*="material-icons"], i:empty) {
  font-family: "A11y Dyslexic", "A11y Legible", Verdana, sans-serif !important;
}
/* line height and spacing (the WCAG 1.4.12 text-spacing values sit at step 2) */
html[data-a11y-line] body :is(p, li, dd, dt, td, th, blockquote, figcaption, label, legend, summary, address):not(.a11y *) { line-height: var(--a11y-lh) !important; }
html[data-a11y-line="1"] { --a11y-lh: 1.6; }
html[data-a11y-line="2"] { --a11y-lh: 1.9; }
html[data-a11y-line="3"] { --a11y-lh: 2.2; }
html[data-a11y-spacing] body :not(.a11y, .a11y *, svg, svg *) { letter-spacing: var(--a11y-ls) !important; word-spacing: var(--a11y-ws) !important; }
html[data-a11y-spacing="1"] { --a11y-ls: .04em; --a11y-ws: .1em; }
html[data-a11y-spacing="2"] { --a11y-ls: .12em; --a11y-ws: .16em; }
html[data-a11y-spacing="3"] { --a11y-ls: .18em; --a11y-ws: .26em; }
/* larger, wider type must wrap rather than push the page sideways */
html:is([data-a11y-text], [data-a11y-spacing], [data-a11y-font]) body :is(h1, h2, h3, h4, h5, h6, p, li, dd, dt, td, th, a, blockquote, figcaption, label, button):not(.a11y *) {
  overflow-wrap: break-word !important; hyphens: auto;
}
html[data-a11y-align="on"] body :is(p, li, dd, dt, td, th, blockquote, figcaption, h1, h2, h3, h4, h5, h6):not(.a11y *) { text-align: left !important; }

/* colour: filters sit on <html>, which keeps fixed and sticky headers working */
html[data-a11y-saturation="low"] { filter: saturate(.45); }
html[data-a11y-saturation="mono"] { filter: grayscale(1); }
html[data-a11y-saturation="high"] { filter: saturate(1.6); }
/* "Higher contrast": the adapter raises the site's own tokens; these generic rules only remove soft effects */
html[data-a11y-contrast] body :not(.a11y, .a11y *) { text-shadow: none !important; }
html[data-a11y-contrast] body ::placeholder { opacity: 1 !important; }

/* reading aids */
html[data-a11y-links] body a[href]:not(.a11y *) {
  text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px !important;
  outline: 1px solid var(--a11y-mark) !important; outline-offset: 2px !important;
}
html[data-a11y-headings] body :is(h1, h2, h3, h4, h5, h6, [role="heading"]):not(.a11y *) {
  outline: 2px solid var(--a11y-mark) !important; outline-offset: 6px !important;
}
html[data-a11y-focus] body :focus-visible:not(.a11y *) {
  outline: 3px solid var(--a11y-focus) !important; outline-offset: 3px !important;
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--a11y-focus) 28%, transparent) !important;
}
html[data-a11y-cursor="dark"], html[data-a11y-cursor="dark"] body * { cursor: url(cursors/arrow-dark.svg) 6 3, auto !important; }
html[data-a11y-cursor="dark"] body :is(a[href], button, [role="button"], label, summary, select, input[type="checkbox"], input[type="radio"]) { cursor: url(cursors/hand-dark.svg) 16 3, pointer !important; }
html[data-a11y-cursor="light"], html[data-a11y-cursor="light"] body * { cursor: url(cursors/arrow-light.svg) 6 3, auto !important; }
html[data-a11y-cursor="light"] body :is(a[href], button, [role="button"], label, summary, select, input[type="checkbox"], input[type="radio"]) { cursor: url(cursors/hand-light.svg) 16 3, pointer !important; }

/* a calmer page */
html[data-a11y-still] { scroll-behavior: auto !important; }
html[data-a11y-still] *:not(.a11y-keep), html[data-a11y-still] *::before, html[data-a11y-still] *::after {
  animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
  transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
}
html[data-a11y-noimages] body :is(img, picture, video, canvas, iframe, svg[role="img"], [role="img"]):not(.a11y *) { visibility: hidden !important; }

/* the visitor's own Windows high-contrast theme always wins */
@media (forced-colors: active) { html { filter: none !important; } }
