/* MENTIONS LÉGALES — mise en page dédiée, sans impact sur les autres pages.
   Maquette : typographie IBM Plex Mono, colonne gauche de repères + texte 2/3.
   Transitions : pilotées par functions.php, pas d'animation locale ici. */

.legal-page {
  --legal-margin: 25px;
  --legal-gap: 10px;
  --legal-font: 20px;
  min-height: 100svh;
  background: #fff;
  color: #111;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 400;
  display: flex;
  flex-direction: column;
}
.legal-page, .legal-page * { box-sizing: border-box; }
.legal-page a { color: inherit; text-decoration: none; }
.legal-page h1, .legal-page h2, .legal-page h3, .legal-page p { margin: 0; font-weight: 400; }

/* Même header 3 colonnes que sur Infos / Projets. */
.legal-page .legal-header {
  position: fixed;
  top: 0; right: 0; bottom: auto; left: 0;
  width: 100%;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--legal-gap);
  align-items: center;
  padding: 12px var(--legal-margin);
  background: #fff;
  font-size: 20px;
  line-height: 1.2;
}
.legal-page .legal-header > a { width: fit-content; justify-self: start; }
.legal-page .legal-header > a:nth-child(3) { justify-self: end; }

.legal-main { flex: 1 0 auto; padding: 0 var(--legal-margin); min-width: 0; }
.legal-main h1 {
  margin-top: 250px;
  margin-bottom: 65px;
  font-size: 35px;
  line-height: 1.18;
  letter-spacing: -.02em;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.legal-sections { display: flex; flex-direction: column; gap: 110px; }
.legal-section {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--legal-gap);
  align-items: start;
  font-size: var(--legal-font);
  line-height: 1.22;
}
.legal-section > h2 {
  grid-column: 1;
  font-size: inherit;
  line-height: inherit;
  text-decoration: underline;
  text-decoration-thickness: auto;
text-underline-offset: 2px;
}
.legal-text { grid-column: 2 / -1; min-width: 0; overflow-wrap: break-word; }
.legal-text p { margin-bottom: 27px; }
.legal-text p:last-child { margin-bottom: 0; }
.legal-text h3 {
  font-size: inherit;
  line-height: inherit;
  text-transform: uppercase;
  margin-top: 39px;
  margin-bottom: 26px;
}
.legal-text h3:first-child { margin-top: 0; }
.legal-text a { overflow-wrap: anywhere; }
.legal-to-complete { color: #555; }

.legal-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 130px;
  padding: 0 var(--legal-margin) 25px;
  font-size: 12px;
  font-weight: 300;
  line-height: 1.2;
}
.legal-footer a { text-decoration: underline; text-underline-offset: 2px; }

/* Tablette : conserver les 1/3—2/3, réduire seulement les corps. */
@media (min-width: 701px) and (max-width: 1100px) {
  .legal-page { --legal-font: clamp(14px, 1.45vw, 18px); }
  .legal-main h1 { font-size: clamp(27px, 3.2vw, 35px); }
  .legal-sections { gap: 85px; }
}

/* Mobile : les rubriques passent au-dessus de leur contenu. */
@media (max-width: 900px) {
  .legal-page { --legal-margin: 20px; --legal-font: 16px; }
  .legal-page .legal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 20px;
    padding: 12px 20px;
  }
  .legal-page .legal-header > a:nth-child(2) { display: none; }
  .legal-page .legal-header > a:nth-child(3) { margin-left: auto; }
  .legal-main h1 {
    margin-top: 148px;
    margin-bottom: 100px;
    font-size: clamp(25px, 6vw, 33px);
  }
  .legal-sections { gap: 75px; }
  .legal-section { display: block; font-size: var(--legal-font); line-height: 1.35; }
  .legal-section > h2 { margin-bottom: 28px; }
  .legal-text h3 { margin-top: 35px; margin-bottom: 19px; }
  .legal-text p { margin-bottom: 21px; }
  .legal-footer { margin-top: 95px; padding-bottom: 20px; font-size: 12px; }
}
@media (max-width: 700px) {
  .legal-page .legal-header {
    font-size: clamp(22px, 6.9vw, 28px);
    line-height: 1.15;
    letter-spacing: -0.065em;
  }
}
@media (max-width: 380px) {
  .legal-page { --legal-font: 14px; }
  .legal-section > h2 { margin-bottom: 23px; }
}


/* Les blocs Gutenberg gardent la même grille de mise en page. */
.legal-section.wp-block-group,
.legal-text.wp-block-group { margin-block: 0; }
.legal-text .wp-block-heading { font-weight: 400; }


/* GRAND ÉCRAN — cohérence de taille avec les autres pages.
   La largeur des colonnes et les règles mobiles restent inchangées. */
@media (min-width: 1441px) {
  /* Même gouttière fluide que les autres grilles à neuf colonnes. */
  .legal-page {
    --legal-gap: clamp(10px, calc(0.7143vw - 0.286px), 18px);
  }

  .legal-page {
    --legal-font: clamp(20px, calc(0.5357vw + 12.286px), 26px);
  }

  .legal-page .legal-header {
    font-size: clamp(20px, calc(0.7143vw + 9.714px), 28px);
  }

  .legal-main h1 {
    font-size: clamp(35px, calc(1.16vw + 18.3px), 48px);
  }

  .legal-footer {
    font-size: clamp(12px, calc(0.2679vw + 8.143px), 15px);
  }
}
