/* Accessibility panel (every page, EN and NL: identical file). Buttons follow the approved secondary pill:
   white bg, 1px #E4E4E4 border, #111 text, DM Sans 600, radius 999.
   Focus rings: #963723 on light surfaces, #FFD999 (cream) on dark ones. */

:root { --a11y-z: 1; --a11y-cb: 0px; --a11y-cb-mini: 0px; --a11y-pill-w: 180px; }
html:lang(nl) { --a11y-pill-w: 232px; }   /* longer word on the touch pill */
html.read-lg1 { --a11y-z: 1.125; }
html.read-lg2 { --a11y-z: 1.25; }

/* ── Preferences applied to the page ── */
/* Text size scales the whole page (nav, footer and panel included); a px-based site ignores html font-size. */
html.read-lg1 body { zoom: 1.125; }
html.read-lg2 body { zoom: 1.25; }
/* zoom multiplies vw lengths too; the footer sizes itself from 100vw (--fu), so divide the zoom out again */
html:is(.read-lg1, .read-lg2) .footer { --fu: min(1px, calc(100vw / 1728 / var(--a11y-z))); }

/* Left-aligned: text, headings and short notes. Buttons, badges, pills and icons keep their own layout. */
html.read-left main *:not(.btn, [class*="btn"], [class*="badge"], [class*="pill"], [class*="chip"], button, svg, img) {
  text-align: left !important; hyphens: manual !important; -webkit-hyphens: manual !important;
}
html.read-left main :is(h1, h2, h3, h4, h5, h6, p, li, dd, dt, blockquote, figcaption, summary) {
  justify-self: start !important; margin-left: 0 !important; margin-right: 0 !important;
}
html.read-left main :is(h1, h2, h3, h4, h5, h6, p, blockquote, figcaption) { align-self: flex-start !important; }

/* Stop animations: everything jumps to its end state and shows */
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
  transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
}
html.reduce-motion [data-reveal], html.reduce-motion .split-word, html.reduce-motion .fill-word {
  opacity: 1 !important; transform: none !important; filter: none !important;
}
html.underline-links :is(main, footer) a {
  text-decoration: underline !important; text-underline-offset: 0.2em; text-decoration-thickness: 0.09em;
}

/* block being read aloud: tint and bar via shadow (no layout shift); outline survives forced colors */
main .reading-now {
  background: rgba(150,55,35,.20); box-shadow: -3px 0 0 #963723; border-radius: 2px;
  outline: 2px solid transparent;
}
main .reading-now.reading-now--dark { background: rgba(255,217,153,.22); box-shadow: -3px 0 0 #FFD999; }
main tr.reading-now { box-shadow: none; }

/* ── Triggers ── */
.a11y, .a11y *, .a11y *::before, .a11y *::after,
.a11y-mini, .a11y-mini *, .a11y-fab, .a11y-fab * { box-sizing: border-box; }
.a11y, .a11y-mini { font-family: 'DM Sans', sans-serif; color: #111; }
.a11y__pill, .a11y__close, .a11y__seg button, .a11y__reset {
  font: 600 14px/1 'DM Sans', sans-serif; color: #111; background: #fff; border: 1px solid #E4E4E4;
  border-radius: 999px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.a11y__pill:hover, .a11y__close:hover, .a11y__seg button:hover { background: #F6F6F6; }

/* Floating bubble: same family and size as the WhatsApp bubble (#waFab, 56px, 52px on phones), stacked directly above it.
   Cream fill + dark 2px edge: the fill separates it from dark sections, the edge from light ones (both >= 3:1). */
.a11y-fab {
  position: fixed; right: 24px; bottom: calc(90px + var(--cb-h, 0px)); z-index: 5000;
  display: grid; place-items: center; width: 56px; height: 56px; padding: 0; cursor: pointer;
  background: #fdf5ee; color: #3b1208; border: 2px solid #3b1208; border-radius: 999px;
  box-shadow: 0 6px 24px rgba(59,18,8,.3); -webkit-tap-highlight-color: transparent;
  transition: bottom .3s cubic-bezier(.22,1,.36,1), background-color .2s, box-shadow .25s ease, transform .3s cubic-bezier(.22,1,.36,1), opacity .3s ease, visibility .3s linear;
}
.a11y-fab--low, .a11y-fab--solo { bottom: calc(24px + var(--cb-h, 0px)); }
.a11y-fab svg { width: 28px; height: 28px; display: block; }
.a11y-fab:hover { background: #fff; box-shadow: 0 12px 36px rgba(59,18,8,.38); transform: translateY(-3px); }
.a11y-fab[aria-expanded="true"] { background: #3b1208; color: #fdf5ee; border-color: #fdf5ee; box-shadow: 0 0 0 2px #3b1208, 0 6px 24px rgba(59,18,8,.3); }
/* hover/focus label, pure CSS, on the left of the bubble (desktop pointers only) */
.a11y-fab__tip {
  position: absolute; right: calc(100% + 12px); top: 50%; transform: translate(6px, -50%); white-space: nowrap;
  padding: 10px 16px; border-radius: 999px; background: #3b1208; color: #fdf5ee;
  font: 700 15px/1 'Gabarito', 'DM Sans', sans-serif; box-shadow: 0 6px 24px rgba(59,18,8,.3);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .25s ease;
}
.a11y-fab:hover .a11y-fab__tip, .a11y-fab:focus-visible .a11y-fab__tip { opacity: 1; transform: translate(0, -50%); }
/* no label behind the open panel (not on the touch pill, where the text is the button's own label) */
@media (hover: hover), (max-width: 860px) { .a11y-fab[aria-expanded="true"] .a11y-fab__tip { opacity: 0; } }
@media (hover: none) { .a11y-fab:hover .a11y-fab__tip { opacity: 0; } .a11y-fab:hover { transform: none; } }
/* Touch devices above the burger breakpoint (iPad, touch laptops): no hover, so the label is always visible.
   Pill, same 56px height, colours and edge; the panel moves left of the pill's fixed width. */
@media (hover: none) and (min-width: 861px) {
  .a11y-fab { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: var(--a11y-pill-w); padding: 0 20px 0 16px; }
  .a11y-fab .a11y-fab__tip, .a11y-fab:hover .a11y-fab__tip {
    position: static; transform: none; opacity: 1; padding: 0; background: none; color: inherit; box-shadow: none;
    font: 700 16px/1 'Gabarito', 'DM Sans', sans-serif; pointer-events: none;
  }
}
/* back-to-top moves up one slot so the order is: back to top, accessibility, WhatsApp */
html.has-a11y-fab .to-top { bottom: calc(156px + var(--cb-h, 0px)); }
/* BREAKPOINT: 860px = burger menu. Keep in sync with BURGER in a11y-panel.js and nav.php.
   the burger menu (<=860px) has its own Accessibility item: no third floating button there */
@media (max-width: 860px) {
  .a11y-fab { display: none; } html.has-a11y-fab .to-top { bottom: calc(94px + var(--cb-h, 0px)); }
}
@media (max-width: 640px) { html.has-a11y-fab .to-top { bottom: calc(80px + var(--cb-h, 0px)); } }
/* the floating buttons step aside together (same rules as footer.php) */
/* visibility:hidden also takes the hidden bubble out of the tab order (the .3s visibility transition lets the fade play first) */
@media (max-width: 640px) { body.fab-hide .a11y-fab { opacity: 0; visibility: hidden; pointer-events: none; } }
body.fab-hide-all .a11y-fab { opacity: 0; visibility: hidden; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .a11y-fab, .a11y-fab__tip { transition: opacity .2s ease, visibility .2s linear; } .a11y-fab:hover { transform: none; } }

/* Footer legal row: "Accessibility" is a <button> styled as its sibling links; size/colour come from the .footer__legal rules in footer.php, this only resets the button */
.footer__legal .a11y-link { padding: 0; border: 0; background: none; cursor: pointer; font-family: inherit; line-height: inherit; }

/* Hidden-until-focus link right after the skip link (same look and place as .nav-skip) */
.a11y-skip {
  position: fixed; top: 10px; left: 10px; z-index: 100001; padding: 12px 22px; border-radius: 999px;
  background: #2B1004; color: #FFE8C0; font: 700 14px/1.2 'DM Sans', 'Gabarito', sans-serif; text-decoration: none;
  transform: translateY(-250%);
}
.a11y-skip:focus, .a11y-skip:focus-visible { transform: none; outline: 3px solid #FFD999; outline-offset: 3px; }

/* ── Focus rings ── */
.a11y :is(button):focus-visible, .a11y__title:focus-visible, .a11y-mini button:focus-visible { outline: 3px solid #963723; outline-offset: 2px; }
.a11y__title:focus-visible { border-radius: 4px; }
/* bubble sits on dark or light sections: #963723 ring, cream halo in the offset gap works on both */
.a11y-fab:focus-visible { outline: 3px solid #963723; outline-offset: 3px; box-shadow: 0 0 0 3px #FFE8C0, 0 6px 24px rgba(59,18,8,.3); }
.a11y__seg button[aria-pressed="true"]:focus-visible { outline: 3px solid #FFD999; outline-offset: -4px; }
.a11y-mini button:focus-visible { outline-color: #FFD999; }

/* ── Panel ── */
/* desktop: pops out to the left of the bubble column, bottom aligned with WhatsApp, above the cookie banner */
.a11y__panel {
  position: fixed; bottom: calc(24px + var(--a11y-cb, 0px)); right: 96px; z-index: 5001;
  width: min(360px, calc(100vw / var(--a11y-z) - 120px));
  /* leaves room for the sticky nav (68px) at the top */
  max-height: calc(100vh / var(--a11y-z) - 100px - var(--a11y-cb, 0px));
  max-height: calc(100dvh / var(--a11y-z) - 100px - var(--a11y-cb, 0px));
  overflow-y: auto; overscroll-behavior: contain;
  background: #fff; color: #111; border: 1px solid #E4E4E4; border-radius: 20px; padding: 18px 20px 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.a11y__panel[hidden] { display: none; visibility: hidden; }   /* closed sheet: nothing paints, not even a lifted sliver above the cookie banner */
@media (hover: none) and (min-width: 861px) { .a11y__panel { right: calc(24px + var(--a11y-pill-w) + 12px); } }   /* left of the touch pill */
@media (max-width: 860px) {
  /* bottom sheet; --a11y-cb lifts it above the cookie banner while that is showing. z-index above the nav (1000) and its menu */
  .a11y__panel {
    top: auto; left: 0; right: 0; bottom: var(--a11y-cb, 0px); width: auto; z-index: 5001;
    max-height: min(calc(70vh / var(--a11y-z)), calc(100vh / var(--a11y-z) - var(--a11y-cb, 0px) - 140px));
    max-height: min(calc(70dvh / var(--a11y-z)), calc(100dvh / var(--a11y-z) - var(--a11y-cb, 0px) - 140px));
    border-radius: 20px 20px 0 0; border-bottom: 0; padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}
.a11y__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.a11y__title { margin: 0; font: 600 20px/1.2 'Alexandria', 'DM Sans', sans-serif; color: #111; letter-spacing: -0.02em; text-align: left; }
.a11y__intro { margin: 0 0 8px; font-size: 13px; line-height: 1.4; color: #595959; text-align: left; }
.a11y__close { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; flex: none; }
.a11y__close svg { width: 18px; height: 18px; }

.a11y__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 52px; padding: 4px 0; }
.a11y__row:not([hidden]) ~ .a11y__row { border-top: 1px solid #EEE; }
.a11y__row[hidden] { display: none; }
.a11y__label { font: 500 15px/1.3 'DM Sans', sans-serif; color: #111; }
.a11y__listenbtns { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.a11y__pill { min-height: 44px; padding: 0 16px; }
.a11y__hint { flex-basis: 100%; margin: 0 0 4px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; line-height: 1.4; color: #595959; }
.a11y__hint[hidden] { display: none; }
.a11y__status { margin: 0; font-size: 14px; font-weight: 600; color: #963723; }
.a11y__status:empty { display: none; }

.a11y__switch {
  position: relative; flex: none; width: 52px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 999px;
}
.a11y__switch::before { content: ""; position: absolute; left: 0; top: 10px; width: 52px; height: 24px; border-radius: 999px; background: #767676; transition: background .2s; }
.a11y__switch::after { content: ""; position: absolute; left: 3px; top: 13px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.a11y__switch[aria-checked="true"]::before { background: #963723; }
.a11y__switch[aria-checked="true"]::after { transform: translateX(28px); }
@media (forced-colors: active) {
  .a11y__switch::before { background: ButtonText; }
  .a11y__switch[aria-checked="true"]::before { background: Highlight; }
  .a11y__switch::after { background: ButtonFace; border: 1px solid ButtonText; }
  .a11y__seg button[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  main .reading-now { outline-color: Highlight; }
}

.a11y__seg { display: inline-flex; border: 1px solid #E4E4E4; border-radius: 999px; overflow: hidden; }
.a11y__seg button { min-height: 42px; min-width: 44px; padding: 0 12px; border: 0; border-radius: 0; font-size: 14px; }
.a11y__seg button + button { border-left: 1px solid #E4E4E4; }
.a11y__seg button[aria-pressed="true"] { background: #111; color: #fff; }
.a11y__seg button:focus-visible { outline-offset: -3px; }

.a11y__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding-top: 10px; border-top: 1px solid #EEE; }
.a11y__reset { min-height: 44px; padding: 0 14px; background: none; border-color: transparent; text-decoration: underline; text-underline-offset: 0.2em; border-radius: 8px; }
.a11y__note { margin: 0; font-size: 13px; color: #595959; text-align: left; }
.a11y__status { margin-top: 6px; }

html.a11y-over .a11y__panel { z-index: 100000; }
html.a11y-over-mini .a11y-mini { z-index: 100000; }

/* ── Mini player: visible while reading, outside the panel ── */
.a11y-mini {
  position: fixed; left: 16px; bottom: calc(16px + var(--a11y-cb-mini, 0px)); z-index: 902;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; max-width: calc(100vw / var(--a11y-z) - 32px);
  padding: 8px 8px 8px 18px; background: #2b1206; color: #FFD999; border: 1px solid rgba(255,217,153,.35);
  border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.a11y-mini[hidden], .a11y-mini__btns[hidden] { display: none; }
.a11y-mini__label { font: 600 14px/1.3 'DM Sans', sans-serif; color: #FFD999; text-align: left; }
.a11y-mini__btns { display: inline-flex; gap: 8px; }
.a11y-mini .a11y__pill { min-width: 44px; }
.a11y-live { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 640px) {
  html.has-a11y-fab .to-top { bottom: calc(80px + var(--cb-h, 0px)); }
  /* bottom bar above the cookie banner; right side stays free for the WhatsApp and back-to-top buttons (#quickContact) */
  .a11y-mini { left: 12px; right: 84px; max-width: none; border-radius: 28px; padding-left: 14px; }
  .a11y-mini__label { flex: 1 1 100%; }
}
