/* ===================================================================
   HYDREAULYS — Accessibilité (RGAA / WCAG 2.1 AA)
   Lien d'évitement · focus visible · lecteur d'écran ·
   mouvement réduit · panneau d'options d'affichage
   =================================================================== */

/* ---------- Lien d'évitement (skip link) ---------- */
.skip-link {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translate(-50%, -130%);
  z-index: 100000;
  background: var(--hy-blue, var(--hy-blue));
  color: #fff;
  padding: 14px 26px;
  border-radius: 0 0 14px 14px;
  font: 600 16px/1 var(--font-sans, system-ui);
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(0, 38, 76, .35);
  transition: transform .2s ease;
}
.skip-link:focus {
  transform: translate(-50%, 0);
  outline: 3px solid var(--hy-cyan, var(--hy-cyan));
  outline-offset: 2px;
}

/* ---------- Focus visible cohérent sur tout le site ---------- */
:focus-visible {
  outline: 3px solid var(--hy-blue, var(--hy-blue));
  outline-offset: 2px;
  border-radius: 4px;
}
/* Sur fonds sombres (pied de page, menu déroulant ouvert) */
.footer :focus-visible,
.header--open .mega :focus-visible {
  outline-color: var(--hy-cyan, var(--hy-cyan));
}
/* Cible de défilement : décalage sous l'en-tête fixe */
:target { scroll-margin-top: 110px; }
#main-content:focus { outline: none; }

/* ---------- Réservé au lecteur d'écran ---------- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sr-only-focusable:focus,
.sr-only-focusable:focus-within {
  position: static !important;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ===================================================================
   Préférences utilisateur — appliquées sur <html> par a11y.js
   =================================================================== */

/* ---------- Taille du texte ----------
   Le site dimensionne le texte en px : agrandir font-size sur <html>
   n'a donc aucun effet. On agrandit le contenu (#app) via `zoom`, ce qui
   met à l'échelle le texte ET la mise en page. Le panneau et le bouton
   d'accessibilité sont hors de #app : ils gardent leur taille native. */
html[data-a11y-text="large"]  #app { zoom: 1.12; }
html[data-a11y-text="xlarge"] #app { zoom: 1.25; }
/* Compense la hauteur de l'en-tête fixe (agrandi par le zoom) */
html[data-a11y-text="large"]  body { padding-top: 99px; }
html[data-a11y-text="xlarge"] body { padding-top: 110px; }

/* ---------- Espacement de lecture (critère RGAA 10.12) ---------- */
html[data-a11y-spacing="on"] body {
  line-height: 1.85 !important;
  letter-spacing: .03em;
  word-spacing: .1em;
}
html[data-a11y-spacing="on"] p,
html[data-a11y-spacing="on"] li {
  margin-bottom: .6em;
}

/* ---------- Soulignement des liens dans le contenu ---------- */
html[data-a11y-links="on"] #main-content a:not(.cta):not(.quick):not(.btn):not([class*="card"]):not([class*="tile"]),
html[data-a11y-links="on"] .footer a {
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

/* ---------- Police plus lisible (confort dyslexie) ---------- */
html[data-a11y-font="readable"] {
  --font-sans: 'Atkinson Hyperlegible', Verdana, Tahoma, system-ui, sans-serif !important;
  --font-serif: 'Atkinson Hyperlegible', Verdana, Tahoma, system-ui, sans-serif !important;
}
html[data-a11y-font="readable"] body,
html[data-a11y-font="readable"] .serif {
  font-family: var(--font-sans) !important;
  font-style: normal !important;
}

/* ---------- Contraste renforcé ---------- */
html[data-a11y-contrast="on"],
html[data-a11y-contrast="on"] body {
  --hy-blue: #003a70;
  --hy-blue-deep: #001f3d;
  --hy-blue-ink: #001f3d;
  --hy-muted: #2c3a4d;
  --hy-ink: #0d1726;
  --hy-line: #9fb3c6;
}
html[data-a11y-contrast="on"] body { color: var(--hy-ink); }
html[data-a11y-contrast="on"] .eyebrow,
html[data-a11y-contrast="on"] a { color: var(--hy-blue); }
html[data-a11y-contrast="on"] #main-content a:not(.cta):not(.quick):not(.btn) {
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* Bordures plus marquées pour distinguer les blocs */
html[data-a11y-contrast="on"] [class*="card"],
html[data-a11y-contrast="on"] [class*="tile"],
html[data-a11y-contrast="on"] [class*="qcard"] {
  border: 1px solid var(--hy-line) !important;
}

/* ===================================================================
   Mouvement réduit — respecte le réglage système ET le panneau
   =================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
html[data-a11y-motion="reduce"] *,
html[data-a11y-motion="reduce"] *::before,
html[data-a11y-motion="reduce"] *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}

/* ===================================================================
   Panneau d'accessibilité flottant (construit par a11y.js)
   =================================================================== */
.a11y-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99990;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--hy-blue, var(--hy-blue));
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 28px rgba(0, 38, 76, .38);
  transition: transform .18s ease, background .18s ease;
}
.a11y-fab:hover { transform: scale(1.06); background: var(--hy-blue-deep, var(--hy-blue-deep)); }
.a11y-fab svg { width: 28px; height: 28px; }

.a11y-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 99991;
  width: 340px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: #fff;
  color: var(--hy-ink, var(--hy-ink));
  border-radius: 20px;
  border: 1px solid var(--hy-line, var(--hy-line));
  box-shadow: 0 24px 64px rgba(0, 38, 76, .28);
  padding: 22px;
  font-family: var(--font-sans, system-ui);
  transform-origin: bottom right;
  transition: opacity .18s ease, transform .18s ease;
}
.a11y-panel[hidden] { display: none; }
.a11y-panel.is-closing { opacity: 0; transform: scale(.96); }

.a11y-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.a11y-panel__title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.01em;
  margin: 0;
}
.a11y-panel__close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--hy-line, var(--hy-line));
  background: #fff;
  color: var(--hy-muted, var(--hy-muted));
  display: grid;
  place-items: center;
  flex: none;
}
.a11y-panel__close:hover { background: var(--hy-paper, var(--hy-paper)); color: var(--hy-ink); }
.a11y-panel__sub {
  font-size: 12.5px;
  color: var(--hy-muted, var(--hy-muted));
  margin: 0 0 16px;
  line-height: 1.5;
}

.a11y-group { margin-bottom: 18px; }
.a11y-group__label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--hy-muted, var(--hy-muted));
  margin-bottom: 9px;
}

/* Segmented control */
.a11y-seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  background: var(--hy-paper, var(--hy-paper));
  border: 1px solid var(--hy-line, var(--hy-line));
  border-radius: 12px;
  padding: 4px;
}
.a11y-seg button {
  border: none;
  background: transparent;
  border-radius: 9px;
  padding: 9px 6px;
  font: 600 13px/1.1 var(--font-sans, system-ui);
  color: var(--hy-ink, var(--hy-ink));
  transition: background .14s ease, color .14s ease;
}
.a11y-seg button[aria-pressed="true"] {
  background: var(--hy-blue, var(--hy-blue));
  color: #fff;
}

/* Toggle row */
.a11y-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--hy-line, var(--hy-line));
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  margin-bottom: 8px;
}
.a11y-toggle:hover { border-color: var(--hy-blue, var(--hy-blue)); }
.a11y-toggle__text { display: flex; flex-direction: column; gap: 2px; }
.a11y-toggle__name { font-size: 14px; font-weight: 700; color: var(--hy-ink); }
.a11y-toggle__desc { font-size: 12px; color: var(--hy-muted, var(--hy-muted)); }
.a11y-switch {
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--hy-line, var(--hy-line));
  position: relative;
  transition: background .16s ease;
}
.a11y-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .16s ease;
}
.a11y-toggle[aria-pressed="true"] .a11y-switch { background: var(--hy-blue, var(--hy-blue)); }
.a11y-toggle[aria-pressed="true"] .a11y-switch::after { transform: translateX(18px); }

.a11y-reset {
  width: 100%;
  border: 1px solid var(--hy-line, var(--hy-line));
  background: var(--hy-paper, var(--hy-paper));
  color: var(--hy-ink);
  border-radius: 12px;
  padding: 11px;
  font: 700 13px/1 var(--font-sans, system-ui);
  margin-top: 4px;
}
.a11y-reset:hover { background: var(--hy-blue-tint, var(--hy-blue-tint)); }

@media (max-width: 600px) {
  .a11y-panel { right: 10px; bottom: 80px; }
  .a11y-fab { right: 14px; bottom: 14px; }
}

/* ===================================================================
   Page « Déclaration d'accessibilité »
   =================================================================== */
.decl { padding: 8px 0 120px; }
.decl__layout {
  display: grid;
  grid-template-columns: 264px 1fr;
  gap: 72px;
  align-items: start;
}

/* Sommaire collant */
.decl__toc {
  position: sticky;
  top: 110px;
  border: 1px solid var(--hy-line);
  border-radius: 18px;
  padding: 22px 22px 24px;
  background: var(--hy-paper);
}
.decl__toc-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--hy-muted);
  margin: 0 0 14px;
}
.decl__toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}
.decl__toc li { margin: 0; }
.decl__toc a {
  counter-increment: toc;
  display: flex;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--hy-ink);
  border-bottom: 1px solid transparent;
}
.decl__toc a::before {
  content: counter(toc);
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--hy-blue-tint);
  color: var(--hy-blue);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.decl__toc a:hover { color: var(--hy-blue); }

/* Corps */
.decl__body { max-width: 760px; }
.decl-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--hy-green-tint);
  border: 1px solid var(--hy-green-soft);
  color: var(--hy-blue-ink);
  border-radius: 16px;
  padding: 16px 22px;
  margin-bottom: 8px;
}
.decl-badge__icon {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: var(--hy-cyan);
  color: #fff;
  display: grid;
  place-items: center;
}
.decl-badge__txt { display: flex; flex-direction: column; }
.decl-badge__lvl { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.decl-badge__std { font-size: 13px; color: var(--hy-muted); }

.decl-block { padding-top: 56px; scroll-margin-top: 110px; }
.decl-block__num {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--hy-blue);
}
.decl-block h2 {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 8px 0 20px;
  line-height: 1.15;
}
.decl-block h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 28px 0 10px;
}
.decl-block p {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--hy-ink);
  margin: 0 0 16px;
}
.decl-block a:not(.decl-card) {
  color: var(--hy-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}
.decl-list {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.decl-list li {
  position: relative;
  padding-left: 30px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--hy-ink);
}
.decl-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--hy-cyan);
}
.decl-list--check li::before {
  content: "";
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--hy-green-tint);
  border: 2px solid var(--hy-cyan);
}
.decl-list--check li { padding-left: 32px; }

/* Encadré d'information / placeholder à compléter */
.decl-note {
  border-left: 4px solid var(--hy-cyan);
  background: var(--hy-green-tint);
  border-radius: 0 14px 14px 0;
  padding: 18px 22px;
  margin: 4px 0 16px;
}
.decl-note p { margin: 0; font-size: 15px; color: var(--hy-blue-ink); }
.decl-note strong { font-weight: 700; }

/* Méta (technologies, environnement de test) */
.decl-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--hy-line);
  border: 1px solid var(--hy-line);
  border-radius: 14px;
  overflow: hidden;
  margin: 4px 0 20px;
}
.decl-meta__cell { background: #fff; padding: 16px 18px; }
.decl-meta__k {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--hy-muted);
  margin-bottom: 6px;
}
.decl-meta__v { font-size: 15px; color: var(--hy-ink); line-height: 1.5; }

/* Cartes contact / recours */
.decl-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 6px 0 8px;
}
.decl-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--hy-line);
  border-radius: 16px;
  padding: 22px;
  background: #fff;
}
.decl-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--hy-blue-tint);
  color: var(--hy-blue);
  display: grid;
  place-items: center;
  margin-bottom: 8px;
}
.decl-card__title { font-size: 16px; font-weight: 700; }
.decl-card__txt { font-size: 14.5px; line-height: 1.6; color: var(--hy-muted); }
.decl-card a { color: var(--hy-blue); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* Bloc « aides à la navigation » mis en avant */
.decl-feats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 6px 0 8px;
}
.decl-feat {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid var(--hy-line);
  border-radius: 14px;
  background: var(--hy-paper);
}
.decl-feat__ic {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--hy-cyan);
  color: #fff;
  display: grid;
  place-items: center;
}
.decl-feat__t { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.decl-feat__d { font-size: 13.5px; line-height: 1.5; color: var(--hy-muted); }

@media (max-width: 980px) {
  .decl__layout { grid-template-columns: 1fr; gap: 8px; }
  .decl__toc { position: static; margin-bottom: 8px; }
}
@media (max-width: 640px) {
  .decl-meta, .decl-cards, .decl-feats { grid-template-columns: 1fr; }
}

