/* Persistent accessibility widget styles (D4).
   Driven by data-* attributes stamped on <html> by a11y.js and persisted to localStorage.
   Bulma 1.x reads data-theme itself for dark/light; the rest we implement here. */

/* Text size: scale the root font so Bulma's rem-based sizing follows.
   The default is an accessible, low-vision-friendly 18px minimum (not the browser's 16px);
   the widget options step up from there. Percentages resolve against the browser default. */
:root { font-size: 112.5%; } /* 18px */
:root[data-text-size="large"] { font-size: 125%; } /* 20px */
:root[data-text-size="larger"] { font-size: 140%; } /* 22.4px */

/* High contrast: strengthen text/border contrast on both themes. */
:root[data-contrast="high"] {
  --bulma-text: #000;
  --bulma-text-strong: #000;
  --bulma-border: #000;
  --bulma-link-text: #00379a;
}
:root[data-theme="dark"][data-contrast="high"] {
  --bulma-text: #fff;
  --bulma-text-strong: #fff;
  --bulma-border: #fff;
  --bulma-link-text: #9ecbff;
}
:root[data-contrast="high"] a { text-decoration: underline; }

/* Reduced motion: honour the user's explicit choice as well as the OS setting. */
:root[data-motion="reduced"] *,
:root[data-motion="reduced"] *::before,
:root[data-motion="reduced"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

/* Accessibility settings groups (inside the modal opened from the navbar / footer). */
.a11y-widget__group { margin-bottom: 0.75rem; }
.a11y-widget__group:last-child { margin-bottom: 0; }
.a11y-widget__legend { font-weight: 600; font-size: 1rem; margin-bottom: 0.25rem; }
