/* A11Y_LEGAL_2026_11: accessibility widget for the standalone legal pages.
   These pages do not load css/style.css, so the widget styles (a copy of the block
   in style.css) live here together with the page-specific parts. */

/* text scale chosen in the widget */
html { --a11y-scale: 1; }
body { font-size: calc(16px * var(--a11y-scale)); }
h1 { font-size: calc(clamp(22px, 3.6vw, 34px) * var(--a11y-scale)); }
h2 { font-size: calc(clamp(18px, 2.6vw, 24px) * var(--a11y-scale)); }

/* sitemap: its h2 has no fixed size on the page, keep the browser default */
.a11y-h2-auto h2 { font-size: 1.5em; }

/* Skip-to-main link (visible only on keyboard focus) */
#a11y-skip {
  position: fixed; top: -60px; inset-inline-start: 16px;
  z-index: 100000;
  background: #081a43; color: #fff;
  padding: 10px 16px; border-radius: 0 0 8px 8px;
  font-weight: 700; text-decoration: none;
  transition: top .2s;
}
#a11y-skip:focus { top: 0; outline: 2px solid #43c7f3; }

/* Floating trigger button */
#a11y-trigger {
  position: fixed; bottom: 20px; inset-inline-end: 96px;
  z-index: 9999;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0e4b9b, #1356d9);
  color: #fff; border: 0;
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(19,86,217,.42);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
#a11y-trigger:hover { transform: scale(1.06); box-shadow: 0 12px 32px rgba(19,86,217,.55); }
#a11y-trigger:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* Panel */
#a11y-panel {
  position: fixed; bottom: 86px; inset-inline-end: 96px;
  z-index: 9999;
  width: 320px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  background: #fff; color: #15233d;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(8,26,67,.35);
  font-family: "Heebo", "Inter", system-ui, sans-serif;
  font-size: 14px;
  text-align: start;
}
#a11y-panel[hidden] { display: none; }
.a11y-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid #e3e8f1;
}
#a11y-panel .a11y-header h2 { margin: 0; font-size: 16px; font-weight: 800; font-family: inherit; color: #15233d; }
.a11y-close {
  width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: #f1f5f9; color: #15233d;
  font-size: 22px; cursor: pointer;
}
.a11y-close:hover { background: #e3e8f1; }
.a11y-section {
  padding: 12px 16px;
  border-bottom: 1px solid #e3e8f1;
  display: flex; flex-direction: column; gap: 8px;
}
.a11y-section:last-child { border-bottom: 0; }
.a11y-row {
  display: flex; align-items: center; justify-content: space-between;
}
.a11y-stepper { display: flex; align-items: center; gap: 8px; }
.a11y-stepper button {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid #e3e8f1; background: #f1f5f9;
  font-size: 18px; font-weight: 800; cursor: pointer;
  color: #15233d;
}
.a11y-stepper button:hover { background: #e3e8f1; }
.a11y-scale-out { min-width: 48px; text-align: center; font-weight: 700; }

.a11y-toggle {
  width: 100%; text-align: start;
  padding: 10px 14px; border-radius: 8px;
  border: 1px solid #e3e8f1; background: #fff;
  font: inherit; cursor: pointer; color: #15233d;
  display: flex; align-items: center; gap: 8px;
}
.a11y-toggle::before {
  content: ""; width: 18px; height: 18px;
  border-radius: 4px; border: 2px solid #cbd5e1;
  flex-shrink: 0;
}
.a11y-toggle.on::before {
  background: #0e4b9b; border-color: #0e4b9b;
  box-shadow: inset 0 0 0 3px #fff;
}
.a11y-toggle:hover { background: #f7fafc; }
.a11y-toggle:focus-visible { outline: 2px solid #0e4b9b; outline-offset: 2px; }

.a11y-reset {
  width: 100%; padding: 10px 14px;
  background: #fee; color: #c0241f;
  border: 1px solid #fcd; border-radius: 8px;
  font: inherit; font-weight: 700; cursor: pointer;
}
.a11y-reset:hover { background: #fdd; }
#a11y-panel .a11y-link {
  display: block; text-align: center;
  color: #0e4b9b; font-size: 13px; padding: 8px 0;
  text-decoration: underline;
}

/* ── User preference effects ─────────────────────────────── */
html.a11y-contrast { filter: contrast(1.4); }
html.a11y-grayscale { filter: grayscale(1); }
html.a11y-contrast.a11y-grayscale { filter: contrast(1.4) grayscale(1); }

html.a11y-dark { background: #0a0a14; }
html.a11y-dark body { background: #0a0a14 !important; color: #f1f5f9 !important; }
html.a11y-dark header,
html.a11y-dark footer,
html.a11y-dark .card { background: #14141e !important; border-color: #2a2a3a !important; }
html.a11y-dark main p,
html.a11y-dark main li,
html.a11y-dark footer p { color: #cbd5e1 !important; }
html.a11y-dark .lang-switch__toggle { color: #f1f5f9 !important; background: rgba(255,255,255,.1) !important; }
html.a11y-dark main [style*="background:#fff"] { background: #14141e !important; }
html.a11y-dark .legal-notice, html.a11y-dark .legal-notice * { color: #7a4a00 !important; }
html.a11y-dark main h2[style*="#8a6212"] { color: #f0c869 !important; }
html.a11y-dark main a:not([style*="background"]),
html.a11y-dark footer a { color: #8ec5ff !important; }

html.a11y-links a,
html.a11y-links button:not(.a11y-toggle):not(.a11y-close):not(.a11y-stepper button):not(.a11y-reset):not(#a11y-trigger) {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important;
  outline: 1px dashed currentColor !important;
  outline-offset: 2px !important;
}

html.a11y-no-motion *,
html.a11y-no-motion *::before,
html.a11y-no-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

html.a11y-readable body,
html.a11y-readable * {
  font-family: "Arial", "Heebo", sans-serif !important;
  letter-spacing: 0 !important;
  word-spacing: .15em !important;
  line-height: 1.7 !important;
}

html.a11y-cursor,
html.a11y-cursor * {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'><polygon points='2,2 2,32 12,24 18,36 26,32 18,22 30,22' fill='black' stroke='white' stroke-width='2'/></svg>") 0 0, auto !important;
}

/* focus ring always visible (WCAG 2.4.7) */
*:focus-visible { outline: 2px solid #0e4b9b; outline-offset: 2px; }

/* narrow screens: smaller floating buttons, full-width panel, and room under the
   footer text so the chat bubble and the accessibility button do not cover it */
@media (max-width: 640px) {
  body #alpha-launcher { width: 48px; height: 48px; bottom: 20px; left: 16px; font-size: 1.3rem; }
  body #alpha-window { bottom: 80px; }
  #a11y-trigger { width: 48px; height: 48px; inset-inline-end: 76px; }
  #a11y-panel { left: 16px; right: 16px; width: auto; max-width: none; bottom: 80px; max-height: calc(100vh - 100px); }
  footer { padding-bottom: 76px; }
}
