/* ===========================================================================
   PAGES DOCUMENTAIRES — mentions légales, conditions, données, cookies
   ---------------------------------------------------------------------------
   Direction : un dossier technique, pas un livre. Chaque rubrique est une
   fiche numérotée que l’on déplie ; un filet bleu-vert court le long de la
   fiche ouverte comme une conduite, et le numéro est composé en chasse fixe,
   comme sur un rapport d’intervention. Pleine largeur, lecture par morceaux.
   =========================================================================== */

.m-doc-section-page { padding-top: 40px; }

/* ------------------------------------------------------------------ sommaire */
.m-doc-sommaire {
  display: grid;
  gap: 12px;
  padding: 20px 22px;
  margin-bottom: 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, #fbfdfe, var(--white));
}
.m-doc-sommaire__titre {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.66rem;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
}
.m-doc-sommaire > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.m-doc-sommaire a {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 0.83rem;
  color: var(--ink);
  transition: border-color 180ms, background 180ms, color 180ms;
}
.m-doc-sommaire a:hover {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

/* ------------------------------------------------------------------ fiches */
.m-doc { display: grid; gap: 10px; }

.m-doc-section {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  overflow: hidden;
  transition: border-color 220ms, box-shadow 240ms;
  scroll-margin-top: 110px;
}
/* la conduite : un filet qui se remplit quand la fiche s’ouvre */
.m-doc-section::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--navy), var(--green));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 320ms cubic-bezier(0.22, 0.8, 0.28, 1);
}
.m-doc-section[open] { border-color: #cfdeeb; box-shadow: 0 10px 26px rgba(16, 43, 67, 0.06); }
.m-doc-section[open]::before { transform: scaleY(1); }
.m-doc-section:hover { border-color: #cfdeeb; }

.m-doc-section > summary {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 17px 20px 17px 22px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.m-doc-section > summary::-webkit-details-marker { display: none; }
.m-doc-section > summary:focus-visible { outline: 3px solid #458db4; outline-offset: -3px; }

.m-doc-numero {
  flex: 0 0 auto;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--navy);
  opacity: 0.55;
  transition: opacity 200ms;
}
.m-doc-section[open] .m-doc-numero { opacity: 1; }

.m-doc-titre {
  flex: 1 1 auto;
  min-width: 0;
  font-family: Manrope, Arial, sans-serif;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.3;
  color: var(--ink);
}

/* chevron dessiné en CSS : deux traits, pas d’image à charger */
.m-doc-chevron {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  rotate: 45deg;
  translate: 0 -2px;
  transition: rotate 260ms cubic-bezier(0.22, 0.8, 0.28, 1), translate 260ms, border-color 200ms;
}
.m-doc-section[open] .m-doc-chevron {
  rotate: -135deg;
  translate: 0 2px;
  border-color: var(--navy);
}

/* ------------------------------------------------------------------ corps */
.m-doc-corps {
  padding: 2px 24px 22px 22px;
  /* deux colonnes de lecture sur grand écran : on divise la hauteur par deux
     sans jamais dépasser la largeur de lecture confortable */
  columns: 2;
  column-gap: 42px;
  font-size: 0.94rem;
  line-height: 1.8;
  color: #3f4d5a;
}
.m-doc-corps > * { break-inside: avoid; }
.m-doc-corps p { margin: 0 0 14px; }
.m-doc-corps p:last-child { margin-bottom: 0; }
.m-doc-corps strong { color: var(--ink); font-weight: 700; }
.m-doc-corps a { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }

.m-doc-corps h3 {
  margin: 4px 0 8px;
  font-family: Manrope, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--ink);
}
.m-doc-corps ul,
.m-doc-corps ol { margin: 0 0 14px; padding-left: 20px; }
.m-doc-corps li { margin-bottom: 6px; }
.m-doc-corps li::marker { color: var(--green); }

/* tableaux (cookies, durées de conservation) */
.m-doc-corps table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0 16px;
  font-size: 0.86rem;
  break-inside: avoid;
}
.m-doc-corps th,
.m-doc-corps td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.m-doc-corps thead th {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--pale);
}

/* mention d’information à compléter, héritée des gabarits légaux */
.m-doc-corps code,
.m-doc-corps .a-completer {
  padding: 2px 7px;
  border-radius: 6px;
  background: #fdf3e0;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.76rem;
  color: #8a6420;
}

.m-doc-corps--seul { columns: 1; max-width: 70ch; padding: 0; }

/* ------------------------------------------------------------------ mode nuit */
:root[data-theme='nuit'] .m-doc-sommaire {
  background: var(--white);
  border-color: var(--line);
}
:root[data-theme='nuit'] .m-doc-sommaire a {
  background: #0b1f33;
  border-color: var(--line);
  color: var(--ink);
}
:root[data-theme='nuit'] .m-doc-section { background: var(--white); border-color: var(--line); }
:root[data-theme='nuit'] .m-doc-section[open] { border-color: #26456220; }
:root[data-theme='nuit'] .m-doc-titre { color: var(--ink); }
:root[data-theme='nuit'] .m-doc-corps { color: #b7c9d8; }
:root[data-theme='nuit'] .m-doc-corps h3,
:root[data-theme='nuit'] .m-doc-corps strong { color: var(--ink); }
:root[data-theme='nuit'] .m-doc-corps thead th { background: #0b1f33; }
:root[data-theme='nuit'] .m-doc-corps th,
:root[data-theme='nuit'] .m-doc-corps td { border-bottom-color: var(--line); }
:root[data-theme='nuit'] .m-doc-corps code { background: #2a2113; color: #e0c98f; }

/* ------------------------------------------------------------------ téléphone */
@media (max-width: 62rem) {
  /* une seule colonne : deux colonnes sur un écran étroit rendent la lecture
     impossible, le regard doit remonter tout le temps */
  .m-doc-corps { columns: 1; }
}

@media (max-width: 700px) {
  .m-doc-section-page { padding-top: 26px; }
  .m-doc-sommaire {
    padding: 15px 16px;
    margin-bottom: 18px;
    border-radius: 14px;
  }
  .m-doc-sommaire > div {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .m-doc-sommaire > div::-webkit-scrollbar { display: none; }
  .m-doc-sommaire a { flex: 0 0 auto; padding: 6px 12px; font-size: 0.79rem; }

  .m-doc-section > summary { gap: 11px; padding: 15px 16px 15px 18px; }
  .m-doc-titre { font-size: 0.94rem; }
  .m-doc-corps { padding: 0 18px 18px; font-size: 0.9rem; line-height: 1.75; }
  .m-doc-corps table { font-size: 0.8rem; }
  .m-doc-corps th, .m-doc-corps td { padding: 8px 9px; }
}
