/* ==========================================================================
   Senolo — feuille de style des documents légaux
   Territoire Web de la charte graphique v2.0.
   Aucun appel réseau externe : polices auto-hébergées, icônes SVG en ligne.
   Plancher de lecture 18 px, contraste AA vérifié.
   ========================================================================== */

/* ----- Polices auto-hébergées ------------------------------------------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Pacifico';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/pacifico-regular.woff2') format('woff2');
}

/* ----- Jetons de la charte ---------------------------------------------- */
:root {
  /* Couleurs de marque */
  --bleu: #002FA7;
  --bleu-encre: #0E58A4;      /* symbole uniquement, jamais l'interface */
  --vert-surface: #28A745;    /* aplat sans texte */
  --vert-texte: #1A6D2D;      /* texte et icônes */
  --vert-degrade: #1E8A3A;
  --menthe: #92DDC0;
  --or: #E8A923;
  --rouge: #D41C1C;

  /* Territoire Web */
  --fond: #F7FAFC;
  --surface: #FFFFFF;
  --texte: #1A202C;
  --texte-doux: #45505F;      /* 7,4:1 sur blanc */
  --bordure: #DCE3EB;           /* filet décoratif */
  --bordure-forte: #828C9B;     /* contour de composant : 3,40:1 sur blanc */
  --texte-tenu: #6B7482;        /* texte secondaire : 4,72:1 sur blanc */

  /* Ombres douces, 3 niveaux */
  --ombre-1: 0 1px 2px rgba(16, 30, 54, .06), 0 1px 3px rgba(16, 30, 54, .05);
  --ombre-2: 0 4px 6px rgba(16, 30, 54, .05), 0 10px 20px rgba(16, 30, 54, .06);
  --ombre-3: 0 12px 24px rgba(16, 30, 54, .08), 0 24px 48px rgba(16, 30, 54, .07);

  /* Échelle de texte de la charte */
  --t13: .8125rem; --t15: .9375rem; --t18: 1.125rem; --t20: 1.25rem;
  --t22: 1.375rem; --t26: 1.625rem; --t34: 2.125rem; --t44: 2.75rem;

  /* Espacements et rayons */
  --e4: 4px; --e8: 8px; --e12: 12px; --e16: 16px; --e20: 20px;
  --e24: 24px; --e32: 32px; --e48: 48px; --e64: 64px;
  --r8: 8px; --r12: 12px; --r16: 16px; --r20: 20px; --r24: 24px; --rond: 999px;

  --degrade-bandeau: linear-gradient(90deg, #002FA7 55%, #1E8A3A);
  --largeur-lecture: 74ch;
}

/* Réglage de la taille du texte par le lecteur */
html[data-taille="grand"]      { font-size: 112.5%; }
html[data-taille="tres-grand"] { font-size: 125%; }

/* ----- Base -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

/* Le decalage d'ancrage doit depasser la hauteur de l'en-tete collant, sinon un
   lien du sommaire amene le titre visé sous la barre. Sur ecran etroit, l'en-tete
   passe sur deux lignes : il faut donc plus de marge. */
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
@media (max-width: 780px) { html { scroll-padding-top: 140px; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--t18);          /* plancher de lecture */
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.senolo { font-family: 'Pacifico', cursive; font-weight: 400; }

/* Accès clavier : anneau or, visible partout */
:focus-visible {
  outline: 3px solid #FFD700;
  outline-offset: 2px;
  border-radius: var(--r8);
}

a { color: var(--bleu); text-underline-offset: .2em; text-decoration-thickness: .08em; }
a:hover { color: #00227A; }

img, svg { max-width: 100%; }

/* ----- Lien d'évitement -------------------------------------------------- */
.evitement {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--bleu); color: #fff; padding: var(--e12) var(--e20);
  border-radius: 0 0 var(--r12) 0; font-weight: 600; text-decoration: none;
}
.evitement:focus { left: 0; color: #fff; }

/* ----- En-tête ----------------------------------------------------------- */
.entete {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--bordure);
}
.entete__barre {
  height: 4px; background: var(--degrade-bandeau);
}
.entete__contenu {
  max-width: 1180px; margin: 0 auto; padding: var(--e12) var(--e20);
  display: flex; align-items: center; justify-content: space-between; gap: var(--e16);
}
.marque { display: inline-flex; align-items: center; gap: var(--e12); text-decoration: none; }
.marque__logo { width: 44px; height: 44px; flex: none; }
.marque__nom { font-family: 'Pacifico', cursive; font-size: var(--t26); color: var(--bleu); line-height: 1; }

.entete__outils { display: flex; align-items: center; gap: var(--e8); flex-wrap: wrap; justify-content: flex-end; }

/* Sur écran étroit, les outils se réduisent à leurs icônes plutôt que de déborder */
@media (max-width: 780px) {
  .entete__contenu { flex-wrap: wrap; row-gap: var(--e8); }
  .outil-libelle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .bouton-outil { padding: var(--e8) var(--e12); }
}
@media (max-width: 420px) {
  .marque__nom { font-size: var(--t22); }
  .marque__logo { width: 38px; height: 38px; }
}

.bouton-outil {
  display: inline-flex; align-items: center; gap: var(--e8);
  min-height: 44px; padding: var(--e8) var(--e16);
  font: inherit; font-size: var(--t15); font-weight: 600;
  color: var(--texte-doux); background: var(--surface);
  border: 1px solid var(--bordure-forte); border-radius: var(--rond);
  cursor: pointer; text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.bouton-outil:hover { background: #EEF3FA; color: var(--bleu); border-color: var(--bleu); }
.bouton-outil[aria-pressed="true"] { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.bouton-outil svg { width: 20px; height: 20px; flex: none; }

/* Progression de lecture */
.progression {
  position: fixed; top: 0; left: 0; height: 4px; width: 0;
  background: var(--degrade-bandeau); z-index: 60; transition: width .1s linear;
}

/* ----- Bandeau de titre -------------------------------------------------- */
.bandeau {
  background: linear-gradient(150deg, #F0F5FF 0%, #FFFFFF 46%, #EEFAF2 100%);
  border-bottom: 1px solid var(--bordure);
  padding: var(--e48) var(--e20) var(--e32);
}
.bandeau__contenu { max-width: 1180px; margin: 0 auto; }
.fil { font-size: var(--t15); color: var(--texte-doux); margin: 0 0 var(--e16); }
/* Cibles d'au moins 24 px de haut, critère 2.5.8 de WCAG 2.2 */
.fil a {
  color: var(--texte-doux); display: inline-block;
  padding: 3px 2px; min-height: 24px;
}
.fil span[aria-current] { color: var(--texte); font-weight: 600; }

.bandeau h1 {
  font-size: var(--t44); line-height: 1.15; font-weight: 700;
  margin: 0 0 var(--e12); letter-spacing: -.02em; color: var(--texte);
  max-width: 22ch;
}
.bandeau__accroche {
  font-size: var(--t22); color: var(--texte-doux); margin: 0; max-width: 60ch;
}
.etiquettes { display: flex; flex-wrap: wrap; gap: var(--e8); margin-top: var(--e24); }
.etiquette {
  display: inline-flex; align-items: center; gap: var(--e8);
  padding: var(--e8) var(--e16); border-radius: var(--rond);
  font-size: var(--t15); font-weight: 600;
  background: var(--surface); border: 1px solid var(--bordure);
  color: var(--texte-doux);
}
.etiquette svg { width: 18px; height: 18px; flex: none; color: var(--vert-texte); }
.etiquette--maj { background: #EAF6EE; border-color: #BFE3CC; color: var(--vert-texte); }

/* ----- Mise en page à deux colonnes -------------------------------------- */
.page {
  max-width: 1180px; margin: 0 auto; padding: var(--e32) var(--e20) var(--e64);
  display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: var(--e48);
  align-items: start;
}
@media (max-width: 900px) {
  .page { grid-template-columns: 1fr; gap: var(--e24); padding-top: var(--e24); }
}

/* Page d'orientation : pas de sommaire, les cartes prennent toute la largeur.
   C'est ce qui permet trois colonnes au lieu de deux. */
.page--large { grid-template-columns: 1fr; }
.page--large .document { max-width: none; }

/* ----- Sommaire ---------------------------------------------------------- */
.sommaire {
  position: sticky; top: 92px;
  background: var(--surface); border: 1px solid var(--bordure);
  border-radius: var(--r20); padding: var(--e20); box-shadow: var(--ombre-1);
  max-height: calc(100vh - 120px); overflow-y: auto;
}
@media (max-width: 900px) { .sommaire { position: static; max-height: none; } }

.sommaire__titre {
  font-size: var(--t15); font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--texte-doux); margin: 0 0 var(--e16);
}
.sommaire ol { list-style: none; margin: 0; padding: 0; counter-reset: som; }
.sommaire li { counter-increment: som; }
.sommaire a {
  display: flex; gap: var(--e12); align-items: baseline;
  padding: var(--e8) var(--e12); border-radius: var(--r8);
  font-size: var(--t15); line-height: 1.45; color: var(--texte-doux);
  text-decoration: none; border-left: 3px solid transparent;
}
.sommaire a::before {
  content: counter(som); font-variant-numeric: tabular-nums;
  font-weight: 700; color: var(--texte-tenu); flex: none; min-width: 1.6em;
}
.sommaire a:hover { background: #F2F6FC; color: var(--bleu); }
.sommaire a[aria-current="true"] {
  background: #EEF3FF; color: var(--bleu); font-weight: 600;
  border-left-color: var(--bleu);
}
.sommaire a[aria-current="true"]::before { color: var(--bleu); }

/* ----- Corps du document ------------------------------------------------- */
.document { max-width: var(--largeur-lecture); }
.document > * + * { margin-top: var(--e20); }

.document h2 {
  font-size: var(--t34); line-height: 1.25; font-weight: 700;
  letter-spacing: -.015em; margin: var(--e48) 0 var(--e16);
  padding-top: var(--e24); border-top: 1px solid var(--bordure);
}
.document > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.document h3 {
  font-size: var(--t22); font-weight: 700; line-height: 1.35;
  margin: var(--e32) 0 var(--e12);
}
.document h4 {
  font-size: var(--t20); font-weight: 600; margin: var(--e24) 0 var(--e8);
  color: var(--texte-doux);
}
.document p { margin: 0 0 var(--e16); }
.document ul, .document ol { margin: 0 0 var(--e16); padding-left: var(--e24); }
.document li { margin-bottom: var(--e8); }
.document li::marker { color: var(--bleu); font-weight: 600; }

.document strong { font-weight: 600; }
.document abbr { text-decoration: none; border-bottom: 1px dotted var(--bordure-forte); cursor: help; }

/* Ancre discrète au survol des titres */
.ancre {
  margin-left: var(--e4); font-size: .6em; color: var(--texte-tenu);
  text-decoration: none; opacity: 0; transition: opacity .15s ease;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; min-height: 24px;   /* cible atteignable, WCAG 2.5.8 */
  vertical-align: middle;
}
h2:hover .ancre, h3:hover .ancre, .ancre:focus-visible { opacity: 1; }

/* ----- L'essentiel en clair ---------------------------------------------- */
.essentiel {
  background: var(--surface);
  border: 2px solid var(--menthe);
  border-radius: var(--r20);
  padding: var(--e24);
  box-shadow: var(--ombre-1);
}
.essentiel__titre {
  display: flex; align-items: center; gap: var(--e12);
  font-size: var(--t22); font-weight: 700; margin: 0 0 var(--e16);
  color: var(--vert-texte);
}
.essentiel__titre svg { width: 26px; height: 26px; flex: none; }
.essentiel ul { list-style: none; margin: 0; padding: 0; }
.essentiel li {
  position: relative; padding-left: var(--e32); margin-bottom: var(--e12);
  font-size: var(--t20); line-height: 1.6;
}
.essentiel li::before {
  content: ''; position: absolute; left: 0; top: .55em;
  width: 12px; height: 12px; border-radius: var(--rond);
  background: var(--vert-surface);
}
.essentiel li:last-child { margin-bottom: 0; }

/* ----- Encadrés ---------------------------------------------------------- */
.encadre {
  border-radius: var(--r16); padding: var(--e20) var(--e24);
  border: 1px solid var(--bordure); background: var(--surface);
  box-shadow: var(--ombre-1);
}
.encadre__titre {
  display: flex; align-items: center; gap: var(--e12);
  font-size: var(--t20); font-weight: 700; margin: 0 0 var(--e8);
}
.encadre__titre svg { width: 22px; height: 22px; flex: none; }
.encadre p:last-child, .encadre ul:last-child { margin-bottom: 0; }

.encadre--info    { border-left: 5px solid var(--bleu);        background: #F5F8FF; }
.encadre--info    .encadre__titre { color: var(--bleu); }
.encadre--cle     { border-left: 5px solid var(--vert-surface); background: #F1FAF4; }
.encadre--cle     .encadre__titre { color: var(--vert-texte); }
.encadre--vigilance { border-left: 5px solid var(--or);        background: #FFF9EC; }
.encadre--vigilance .encadre__titre { color: #8A6100; }
.encadre--alerte  { border-left: 5px solid var(--rouge);       background: #FEF2F2; }
.encadre--alerte  .encadre__titre { color: var(--rouge); }

/* ----- Tableaux ---------------------------------------------------------- */
.tableau-enveloppe {
  overflow-x: auto; border: 1px solid var(--bordure);
  border-radius: var(--r16); background: var(--surface);
  box-shadow: var(--ombre-1);
}
.tableau-enveloppe:focus-visible { outline: 3px solid #FFD700; }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: var(--t15); }
caption {
  text-align: left; padding: var(--e16) var(--e20) var(--e8);
  font-size: var(--t15); font-weight: 700; color: var(--texte-doux);
}
th, td { padding: var(--e12) var(--e16); text-align: left; vertical-align: top; }
thead th {
  background: #EEF3FA; color: var(--texte); font-weight: 700;
  font-size: var(--t13); text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 2px solid var(--bordure-forte); position: sticky; top: 0;
}
tbody tr + tr td { border-top: 1px solid var(--bordure); }
tbody tr:hover td { background: #F8FAFD; }
td code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: .92em; background: #EEF3FA; padding: 2px 6px; border-radius: var(--r8);
}

/* Sur très petit écran, le tableau se lit en fiches */
@media (max-width: 640px) {
  table.fiches, table.fiches thead, table.fiches tbody,
  table.fiches tr, table.fiches th, table.fiches td { display: block; width: 100%; }
  table.fiches { min-width: 0; }
  table.fiches thead { position: absolute; left: -9999px; }
  table.fiches tr { border-bottom: 1px solid var(--bordure); padding: var(--e8) 0; }
  table.fiches td { border: 0; padding: var(--e8) var(--e16); }
  table.fiches td::before {
    content: attr(data-libelle); display: block;
    font-size: var(--t13); font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: var(--texte-doux); margin-bottom: 2px;
  }
}

/* ----- Fiche d'identité (mentions légales) ------------------------------- */
.fiche {
  display: grid; grid-template-columns: minmax(140px, 34%) 1fr;
  border: 1px solid var(--bordure); border-radius: var(--r16);
  overflow: hidden; background: var(--surface); box-shadow: var(--ombre-1);
}
.fiche dt {
  padding: var(--e12) var(--e20); font-weight: 600; color: var(--texte-doux);
  background: #F8FAFD; border-bottom: 1px solid var(--bordure);
  font-size: var(--t15);
}
.fiche dd {
  margin: 0; padding: var(--e12) var(--e20);
  border-bottom: 1px solid var(--bordure); border-left: 1px solid var(--bordure);
}
.fiche dt:last-of-type, .fiche dd:last-of-type { border-bottom: 0; }
@media (max-width: 640px) {
  .fiche { grid-template-columns: 1fr; }
  .fiche dd { border-left: 0; }
}

/* ----- Cartes de navigation (sommaire du pôle légal) --------------------- */
.cartes {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--e20); list-style: none; margin: 0; padding: 0;
}
.carte {
  display: flex; flex-direction: column; gap: var(--e12);
  background: var(--surface); border: 1px solid var(--bordure);
  border-radius: var(--r20); padding: var(--e24);
  text-decoration: none; color: inherit; box-shadow: var(--ombre-1);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.carte:hover {
  transform: translateY(-3px); box-shadow: var(--ombre-2);
  border-color: var(--bleu); color: inherit;
}
.carte__icone {
  width: 52px; height: 52px; border-radius: var(--r16);
  display: flex; align-items: center; justify-content: center;
  background: #EEF3FF; color: var(--bleu); flex: none;
}
.carte__icone svg { width: 26px; height: 26px; }
.carte__icone--vert { background: #EAF6EE; color: var(--vert-texte); }
.carte__icone--or   { background: #FFF6E3; color: #8A6100; }
.carte h3 { font-size: var(--t22); font-weight: 700; margin: 0; line-height: 1.3; }
.carte p { font-size: var(--t15); color: var(--texte-doux); margin: 0; flex: 1; }
.carte__lien {
  display: inline-flex; align-items: center; gap: var(--e8);
  font-weight: 600; color: var(--bleu); font-size: var(--t15);
}
.carte__lien svg { width: 18px; height: 18px; transition: transform .18s ease; }
.carte:hover .carte__lien svg { transform: translateX(3px); }

/* ----- Pied de page ------------------------------------------------------ */
.pied {
  background: var(--surface); border-top: 1px solid var(--bordure);
  padding: var(--e48) var(--e20);
}
.pied__contenu {
  max-width: 1180px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: var(--e32); justify-content: space-between;
}
.pied__bloc { min-width: 220px; }
.pied h2 {
  font-size: var(--t15); font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--texte-doux); margin: 0 0 var(--e12);
}
.pied ul { list-style: none; margin: 0; padding: 0; }
.pied li { margin-bottom: var(--e8); }
.pied a { font-size: var(--t15); }
.pied__mention {
  max-width: 1180px; margin: var(--e32) auto 0; padding-top: var(--e20);
  border-top: 1px solid var(--bordure);
  font-size: var(--t15); color: var(--texte-doux);
}

/* ----- Impression -------------------------------------------------------- */
@media print {
  .entete, .sommaire, .progression, .sans-impression, .pied__bloc { display: none !important; }
  body { background: #fff; font-size: 11pt; line-height: 1.45; }
  .page { display: block; max-width: none; padding: 0; }
  .document { max-width: none; }
  .bandeau { padding: 0 0 12pt; background: none; border-bottom: 2px solid #000; }
  .bandeau h1 { font-size: 22pt; }
  .document h2 { font-size: 14pt; page-break-after: avoid; break-after: avoid; }
  .document h3 { font-size: 12pt; page-break-after: avoid; break-after: avoid; }
  .encadre, .essentiel, .tableau-enveloppe, .fiche { break-inside: avoid; box-shadow: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #444; }
  thead { display: table-header-group; }
}

/* ----- Contraste renforcé ------------------------------------------------ */
@media (prefers-contrast: more) {
  :root { --texte-doux: #2A3340; --bordure: #9AA7B6; --bordure-forte: #6B7B8C; }
}
