/* ============================================================
   MON PERSONNEL PARFAIT — 02. BASE
   Reset moderne, typographie, éléments natifs, accessibilité.
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  /* Empêche le tiroir mobile (hors écran) de créer un défilement latéral.
     `clip` est préféré à `hidden` : il n'interrompt pas position:sticky. */
  overflow-x: hidden;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--texte);
  font-family: var(--font-texte);
  font-size: var(--t-base);
  line-height: var(--lh-texte);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

@supports (overflow: clip) { html { overflow-x: clip; } }

body.est-verrouille { overflow: hidden; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--e-4);
  font-family: var(--font-titre);
  font-weight: 500;
  line-height: var(--lh-titre);
  letter-spacing: -0.015em;
  color: inherit;
  text-wrap: balance;
}

h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }
h4 { font-size: var(--t-h4); font-family: var(--font-texte); font-weight: 600; letter-spacing: -0.005em; line-height: 1.35; }
h5, h6 { font-family: var(--font-texte); font-weight: 600; font-size: var(--t-base); line-height: 1.4; }

p { margin: 0 0 var(--e-4); }
p:last-child { margin-bottom: 0; }

a {
  color: inherit;
  text-decoration-color: rgba(168, 135, 63, 0.5);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  transition: color var(--d-rapide) var(--easing);
}
a:hover { color: var(--accent-lisible); }

img, video, svg { max-width: 100%; height: auto; display: block; }

/* <picture> ne sert qu'à porter les variantes WebP : il doit rester
   transparent pour la mise en page (flex, grid, aspect-ratio). */
picture { display: contents; }

ul, ol { margin: 0 0 var(--e-4); padding-left: 1.25rem; }
li { margin-bottom: var(--e-2); }
li:last-child { margin-bottom: 0; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

table { border-collapse: collapse; width: 100%; }

blockquote, figure { margin: 0; }

hr { border: 0; border-top: 1px solid var(--filet); margin: var(--e-8) 0; }

strong, b { font-weight: 600; }

::selection { background: var(--c-champagne); color: var(--c-expresso); }

/* --- Focus visible : toujours identifiable ------------------ */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent-lisible);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}
.sur-sombre :focus-visible,
.mpp-footer :focus-visible { outline-color: var(--c-champagne); }

/* --- Lien d'évitement --------------------------------------- */
.lien-evitement {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -120%);
  z-index: calc(var(--z-header) + 10);
  background: var(--c-expresso);
  color: var(--texte-clair);
  padding: var(--e-3) var(--e-5);
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  font-size: var(--t-sm);
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--d-base) var(--easing);
}
.lien-evitement:focus-visible { transform: translate(-50%, 0); color: var(--texte-clair); }

/* --- Utilitaires d'accessibilité ---------------------------- */
.visuellement-cache {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   STRUCTURE
   ============================================================ */

.conteneur {
  width: 100%;
  max-width: var(--largeur-max);
  margin-inline: auto;
  padding-inline: var(--gouttiere);
}
.conteneur--etroit { max-width: 880px; }
.conteneur--large  { max-width: 1440px; }

.section { padding-block: var(--section-y); }
.section--compacte { padding-block: var(--section-y-sm); }
.section--haut-serre { padding-top: 0; }
.section--bas-serre { padding-bottom: 0; }

.section--doux   { background: var(--bg-doux); }
.section--sombre { background: var(--bg-sombre); color: var(--texte-clair); }
.section--nuit   { background: var(--bg-nuit); color: var(--texte-clair); }

/* Sur fond sombre, les titres reprennent leur pleine intensité même
   lorsque le conteneur applique une couleur de texte adoucie. */
.sur-sombre :is(h1, h2, h3, h4, h5, h6),
.heros :is(h1, h2, h3, h4, h5, h6),
.entete-page :is(h1, h2, h3, h4, h5, h6),
.bandeau-cta :is(h1, h2, h3, h4, h5, h6),
.section--sombre :is(h1, h2, h3, h4, h5, h6),
.section--nuit :is(h1, h2, h3, h4, h5, h6),
.foyer :is(h1, h2, h3, h4, h5, h6),
.formule--phare :is(h1, h2, h3, h4, h5, h6),
.carte--sombre :is(h1, h2, h3, h4, h5, h6),
.mpp-tiroir :is(h1, h2, h3, h4, h5, h6) { color: var(--texte-clair); }

/* ============================================================
   TYPOGRAPHIE ÉDITORIALE
   ============================================================ */

/* Eyebrow : reprend le filet du logo « — L'EXCELLENCE … — » */
.surtitre {
  display: inline-flex;
  align-items: center;
  gap: var(--e-3);
  margin: 0 0 var(--e-4);
  font-family: var(--font-texte);
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-lisible);
}
.surtitre::before {
  content: "";
  width: 34px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
  flex: none;
}
.surtitre--centre::after {
  content: "";
  width: 34px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
  flex: none;
}
.section--sombre .surtitre,
.section--nuit .surtitre,
.sur-sombre .surtitre { color: var(--c-champagne); }

.chapo {
  font-size: var(--t-lead);
  line-height: 1.7;
  color: var(--texte-doux);
  max-width: var(--largeur-texte);
}
.section--sombre .chapo,
.section--nuit .chapo,
.sur-sombre .chapo { color: var(--texte-clair-doux); }

/* Mot mis en valeur dans un titre : italique + or (repris de la marque) */
.accentue {
  font-style: italic;
  color: var(--accent-lisible);
}
.section--sombre .accentue,
.section--nuit .accentue,
.sur-sombre .accentue { color: var(--c-champagne); }

.entete-section { margin-bottom: var(--e-8); max-width: 760px; }
.entete-section--centre { margin-inline: auto; text-align: center; }
.entete-section--centre .chapo { margin-inline: auto; }
.entete-section > *:last-child { margin-bottom: 0; }

.texte-centre { text-align: center; }
.mesure { max-width: var(--largeur-texte); }

/* ============================================================
   GRILLES GÉNÉRIQUES
   ============================================================ */
.grille { display: grid; gap: var(--e-5); }
.grille--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grille--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grille--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grille--auto { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.grille--large { gap: var(--e-6); }

@media (max-width: 980px) {
  .grille--3, .grille--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grille--2, .grille--3, .grille--4 { grid-template-columns: 1fr; }
}

/* Duo média + texte */
.duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 1rem + 4vw, 5rem);
  align-items: center;
}
.duo--media-droite > .duo__media { order: 2; }
@media (max-width: 900px) {
  .duo { grid-template-columns: 1fr; }
  .duo--media-droite > .duo__media { order: 0; }
}

/* ============================================================
   SIGNATURE : L'ARCHE
   Le monogramme MPP dessine une porte. Les médias clés du site
   reprennent cette arche — la porte de la maison.
   ============================================================ */
.arche {
  position: relative;
  border-radius: var(--r-arche);
  overflow: hidden;
  background: var(--c-taupe);
}
.arche img { width: 100%; height: 100%; object-fit: cover; }
.arche--filet::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(247, 244, 239, 0.35);
  border-radius: var(--r-arche);
  pointer-events: none;
}

/* ============================================================
   MOUVEMENT — révélations au défilement
   ============================================================ */
.revele {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--d-lent) var(--easing),
              transform var(--d-lent) var(--easing);
  transition-delay: var(--delai, 0ms);
  will-change: opacity, transform;
}
.revele.est-visible { opacity: 1; transform: none; }
.js-off .revele { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .revele { opacity: 1 !important; transform: none !important; }
}

/* Impression */
@media print {
  .mpp-header, .mpp-footer, .barre-action, .retour-haut { display: none !important; }
  body { color: #000; background: #fff; }
  .section { padding-block: 1.5rem; }
}
