/* Reading aid (Lesehilfe) bottom left and the modes it switches on <html>
   (static/js/a11y.js). Looks as in the October 2026 mockup. */

/* Keyboard focus never ends up under the round button. */
html { scroll-padding-bottom: 96px; }
/* On narrow screens the last footer row and the end of the open phone menu sit at the
   left edge: room below them, so they can be scrolled out from under the button. */
@container frame (max-width: 887.98px) {
  .site-footer { padding-bottom: 96px; }
  .mobile-menu { padding-bottom: 96px; }
}

.a11y {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 60;
  color: var(--schrift);
  font-family: var(--font-body);
}

.a11y__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 4px solid var(--magenta);
  border-radius: 50%;
  background: var(--pflaume);
  color: var(--weiss);
  cursor: pointer;
  transition: transform .2s;
}
.a11y__toggle:hover { transform: translateY(-3px); }
.a11y__toggle[aria-expanded="true"] { background: var(--magenta); border-color: var(--pflaume); }

.a11y__panel {
  position: absolute;
  left: 0;
  bottom: 68px;
  display: flex;
  flex-direction: column;
  width: min(360px, calc(100vw - 40px));
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 18px 20px;
  border: 4px solid var(--schrift);
  background: var(--weiss);
  box-shadow: 8px 8px 0 var(--magenta);
}
.a11y__panel[hidden] { display: none; }

.a11y__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 4px solid var(--schrift);
}
.a11y__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  text-transform: uppercase;
}

.a11y__close,
.a11y__step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 3px solid var(--schrift);
  background: var(--weiss);
  color: var(--schrift);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
}
.a11y__step--big { font-size: 19px; }
.a11y__step:disabled { border-style: dashed; cursor: not-allowed; }
.a11y__step:not(:disabled):hover,
.a11y__close:hover { background: var(--sand); }

.a11y__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 3px dotted var(--schrift);
}
.a11y__label {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.a11y__size { display: flex; align-items: center; gap: 6px; }
.a11y__value {
  min-width: 52px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 14px;
  text-align: center;
}

/* Switch: knob left and white when off, right on magenta when on */
.a11y__switch {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: flex-start;
  width: 58px;
  height: 32px;
  padding: 0;
  border: 3px solid var(--schrift);
  border-radius: 40px;
  background: var(--weiss);
  cursor: pointer;
}
.a11y__knob {
  width: 20px;
  height: 20px;
  margin: 0 3px;
  border-radius: 50%;
  background: var(--schrift);
}
.a11y__switch[aria-checked="true"] { justify-content: flex-end; background: var(--magenta); }
.a11y__switch[aria-checked="true"] .a11y__knob { background: var(--weiss); }

.a11y__speak {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  margin-top: 14px;
  padding: 10px 18px;
  border: 0;
  border-radius: var(--radius-button);
  background: var(--pflaume);
  color: var(--weiss);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
}
.a11y__speak.is-on { background: var(--magenta); }

.a11y__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
  padding-top: 14px;
}
.a11y__statement {
  color: var(--schrift);
  font-weight: 600;
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.a11y__reset {
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--schrift);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.a11y :focus-visible { outline: 3px solid var(--magenta); outline-offset: 3px; }

/* --- Text size: four steps up to 150 %. The whole frame is zoomed; its breakpoints
   are container queries and its fluid sizes use --vw, so the layout reflows as with
   browser zoom (base.css, tokens.css). --- */
html[data-text-size] { --vw: 1cqw; }
html[data-text-size="115"] .frame { zoom: 1.15; }
html[data-text-size="130"] .frame { zoom: 1.3; }
html[data-text-size="150"] .frame { zoom: 1.5; }
/* The sticky header grows with the zoom: jump targets must not end up under it. */
html[data-text-size="115"] { scroll-padding-top: calc(var(--header-h) * 1.15 + 24px); }
html[data-text-size="130"] { scroll-padding-top: calc(var(--header-h) * 1.3 + 24px); }
html[data-text-size="150"] { scroll-padding-top: calc(var(--header-h) * 1.5 + 24px); }
/* The zoom also scales 100vh: the open phone menu has to end on screen. */
html[data-text-size="115"] .mobile-menu { max-height: calc(100vh / 1.15 - var(--header-h)); }
html[data-text-size="130"] .mobile-menu { max-height: calc(100vh / 1.3 - var(--header-h)); }
html[data-text-size="150"] .mobile-menu { max-height: calc(100vh / 1.5 - var(--header-h)); }

/* --- High contrast: every text and control meets WCAG 2.2 AA (4.5 : 1 for text,
   3 : 1 for large text and controls). Magenta #E6007E reaches only 3.83 : 1 on sand
   and 4.25 : 1 on hellsand (README, Accessibility); the darker #BD0068 reaches
   5.31 / 5.89 / 6.24 : 1 on sand / hellsand / white, and white on it 6.24 : 1.
   Everything that uses the token follows: kickers, accents, buttons, magenta areas,
   the frame. --- */
html[data-contrast="high"] {
  --magenta: #BD0068;
}
/* No dot raster behind text, solid instead of dotted lines, links in running text
   underlined, a stronger focus ring. */
html[data-contrast="high"] .raster { display: none; }
html[data-contrast="high"] .frame * { text-shadow: none !important; }
html[data-contrast="high"] .dotted,
html[data-contrast="high"] .step { border-top-style: solid; }
html[data-contrast="high"] .list-row,
html[data-contrast="high"] .ax-item,
html[data-contrast="high"] .a11y__row { border-bottom-style: solid; }
html[data-contrast="high"] .placeholder { border-style: solid; }
html[data-contrast="high"] p a:not(.btn):not(.textlink) { text-decoration: underline; }
/* Two-colour focus ring (WCAG technique C40): dark – white – dark, 3 px each, so one
   of its colours stands out on every background, also next to the magenta joints. */
html[data-contrast="high"] :focus-visible {
  outline: 3px solid var(--weiss);
  outline-offset: 3px;
  box-shadow: 0 0 0 9px var(--schrift);
}
/* Areas: the ring goes inside (neighbouring areas would cover it outside). */
html[data-contrast="high"] a.tile:focus-visible {
  outline-offset: -6px;
  box-shadow: inset 0 0 0 9px var(--schrift);
}
html[data-contrast="high"] a.tile--magenta:focus-visible {
  box-shadow: inset 0 0 0 9px var(--schrift), 0 0 0 var(--fuge) var(--pflaume);
}

/* --- Motion off: nothing moves, also what motion.js would start. --- */
html[data-motion="off"] *,
html[data-motion="off"] *::before,
html[data-motion="off"] *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* --- Reading mode: decoration off, calmer running text. --- */
html[data-reading="on"] .raster,
html[data-reading="on"] .star,
html[data-reading="on"] .rings,
html[data-reading="on"] .half,
html[data-reading="on"] .frame__main .andy,
html[data-reading="on"] .bubble,
html[data-reading="on"] .progress,
html[data-reading="on"] .sub-hero__art { display: none !important; }
html[data-reading="on"] .row--head { grid-template-columns: minmax(0, 1fr); }
html[data-reading="on"] .band-tag,
html[data-reading="on"] .boom__text,
html[data-reading="on"] .half span { transform: none; }
html[data-reading="on"] .frame__main p:not(.statement):not(.kicker),
html[data-reading="on"] .frame__main li {
  max-width: 70ch;
  line-height: 1.8;
  letter-spacing: .01em;
  text-align: left;
}
