/* ---------- Typographies ---------- */
@font-face {
  font-family: "Maison 123";
  src: url("Maison123-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- Réglages ---------- */
:root {
  --xm-bg: #ffffff;
  --xm-paper: #fbf8f2;
  --xm-ink: #121212;
  --xm-ph: #d7d4cf;
  --xm-sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --xm-serif: "Maison 123", Georgia, serif;
  /* hauteur disponible : sur le site, remplacer par calc(100dvh - hauteur du header) */
  --xm-h: 100vh;
  /* hauteur du titre « magazine / L'édition de Noël » au-dessus du livre */
  --xm-title-h: 92px;
  /* largeur du livre ouvert : il tient entièrement dans l'écran (sous le titre).
     Définie ici pour que le titre puisse s'y caler aussi. */
  --xm-w: min(
    100vw - 2 * clamp(80px, 11vw, 200px),
    (var(--xm-h) - var(--xm-title-h) - 140px) * 1.4131,
    1280px
  );
}
@supports (height: 100dvh) {
  :root {
    --xm-h: 100dvh;
  }
}

body {
  margin: 0;
  background: var(--xm-bg);
  overflow-x: hidden;
}

/* ---------- Fil d'Ariane masqué sur cette page ---------- */
body:has(.xm-wrap) .breadcrumb,
body:has(.xm-wrap) .breadcrumbs,
body:has(.xm-wrap) .product-breadcrumb,
body:has(.xm-wrap) .breadcrumb-wrapper,
body:has(.xm-wrap) nav[aria-label="breadcrumb" i],
body:has(.xm-wrap) nav[aria-label="Fil d'Ariane" i] {
  display: none !important;
}

/* ---------- Titre au-dessus du livre ---------- */
.xm-title {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: var(--xm-title-h);
  margin: 0;
  padding: 0 16px 4px;
  background: var(--xm-bg);
  color: var(--xm-ink);
  text-align: center;
}
.xm-title-kicker {
  margin: 0 0 4px;
  font: italic 400 14px/1.2 var(--xm-sans);
  letter-spacing: 0.02em;
}
.xm-title-main {
  /* jamais sur deux lignes, quelle que soit la langue :
     le titre ne dépasse pas la largeur du livre, et s'il est trop long
     le script réduit sa taille pour qu'il tienne exactement */
  max-width: var(--xm-w);
  margin: 0;
  font: 400 clamp(28px, 3vw, 40px)/1.1 var(--xm-serif);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow-wrap: normal;
  hyphens: none;
}

/* ---------- Cadre et scène ---------- */
.xm-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  /* hauteur calée sur le livre : il se pose juste sous le titre */
  height: auto;
  min-height: 0;
  padding: 18px 0 16px;
  box-sizing: border-box;
  overflow: hidden;
  background: var(--xm-bg);
  font-family: var(--xm-sans);
}

/* la scène glisse pour centrer la couverture quand le livre est fermé */
.xm-stage {
  position: relative;
  width: var(--xm-w);
  transition: transform 1s cubic-bezier(0.45, 0, 0.25, 1);
}
.xm-flipbook {
  position: relative;
  z-index: 1;
}

/* ---------- Volume du livre : ombre portée + tranche des pages sur les côtés ----------
   Placés derrière les pages par le script (fonction edges). La tranche gauche grossit
   et la droite diminue à mesure qu'on avance dans le livre. */
.xm-book-shadow,
.xm-edge {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  transition:
    left 0.6s cubic-bezier(0.5, 0.05, 0.2, 1),
    width 0.6s cubic-bezier(0.5, 0.05, 0.2, 1);
}
/* mobile : à gauche, seulement le pli de la reliure (la page d'avant qui plonge dans le creux) */
.xm-edge.--left.--fold {
  background-image:
    linear-gradient(90deg, rgba(60, 42, 25, 0.04) 0, rgba(60, 42, 25, 0.1) 55%, rgba(60, 42, 25, 0.26) 100%),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.6),
      rgba(255, 255, 255, 0) 6%,
      rgba(255, 255, 255, 0) 94%,
      rgba(60, 42, 25, 0.08)
    );
}
/* retour sur la couverture : le dos de la couverture s'efface pendant qu'il se soulève */
.xm-page.is-leaving {
  opacity: 0 !important;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.6, 1) 0.05s;
}
/* pendant l'ouverture / la fermeture de la couverture : même durée que le tour de page */
.xm-stage.is-opening .xm-book-shadow,
.xm-stage.is-opening .xm-edge {
  transition-duration: 1s;
  transition-timing-function: cubic-bezier(0.45, 0, 0.25, 1);
}
.xm-book-shadow {
  /* pas d'ombre portée sous le livre, juste un léger contour */
  box-shadow: 0 1px 2px rgba(50, 35, 20, 0.08);
}
/* tranche : papier ivoire, feuilles très fines, ombré vers l'extérieur (effet bloc de pages épais) */
.xm-edge {
  background-color: #fbf9f4;
}
.xm-edge.--left {
  background-image:
    linear-gradient(
      90deg,
      rgba(60, 42, 25, 0.16) 0,
      rgba(60, 42, 25, 0.05) 35%,
      rgba(255, 255, 255, 0) 70%,
      rgba(60, 42, 25, 0.1) 100%
    ),
    repeating-linear-gradient(90deg, rgba(150, 128, 105, 0.28) 0 0.6px, rgba(255, 255, 255, 0) 0.6px 2.4px),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.7),
      rgba(255, 255, 255, 0) 6%,
      rgba(255, 255, 255, 0) 94%,
      rgba(60, 42, 25, 0.1)
    );
}
.xm-edge.--right {
  background-image:
    linear-gradient(
      270deg,
      rgba(60, 42, 25, 0.16) 0,
      rgba(60, 42, 25, 0.05) 35%,
      rgba(255, 255, 255, 0) 70%,
      rgba(60, 42, 25, 0.1) 100%
    ),
    repeating-linear-gradient(270deg, rgba(150, 128, 105, 0.28) 0 0.6px, rgba(255, 255, 255, 0) 0.6px 2.4px),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.7),
      rgba(255, 255, 255, 0) 6%,
      rgba(255, 255, 255, 0) 94%,
      rgba(60, 42, 25, 0.1)
    );
}
.xm-stage.is-cover {
  transform: translateX(-25%);
}

/* ---------- Pages ---------- */
.xm-page {
  background: var(--xm-paper);
  color: var(--xm-ink);
  overflow: hidden;
  container-type: inline-size;
  user-select: none;
}
.xm-page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* pli de reliure : page de gauche → ombre à droite, page de droite → ombre à gauche */
.xm-page.--left::after {
  background: linear-gradient(
    270deg,
    rgba(40, 25, 15, 0.12) 0,
    rgba(40, 25, 15, 0.03) 2.5%,
    rgba(255, 255, 255, 0.08) 5%,
    transparent 12%
  );
}
.xm-page.--right::after {
  background: linear-gradient(
    90deg,
    rgba(40, 25, 15, 0.14) 0,
    rgba(40, 25, 15, 0.04) 2.5%,
    rgba(255, 255, 255, 0.08) 5%,
    transparent 12%
  );
}

/* mobile : dos de la feuille qui tourne = contenu flouté et pâli (vu par transparence) */
.xm-page.is-back > * {
  filter: blur(3px);
  opacity: 0.45;
}

/* ---------- Placement ----------
   Coordonnées en px de la maquette (page de 720 x 1019) : style="--x; --y; --w; --h"
   Converties en cqw, donc tout suit la taille du livre.
   Mobile (textes à 10px) : --mx / --mw / --my remplacent x / w / y, --b cale une légende par le bas.
   Marges : 12 sur les bords extérieurs (haut, bas, côté), 0 côté reliure.
   Photo pleine page à gauche = --x:0; --y:0; --w:720; --h:1019 · à droite = --x:0; --y:0; --w:720; --h:1019
   20 entre le bord d'une photo et une légende posée dessus. */
.xm-box,
.xm-t {
  position: absolute;
  left: calc(var(--x, 0) * 1cqw / 7.2);
  top: calc(var(--y, 0) * 1cqw / 7.2);
  width: calc(var(--w, 720) * 1cqw / 7.2);
  margin: 0;
  box-sizing: border-box;
}
.xm-box {
  height: calc(var(--h, 1019) * 1cqw / 7.2);
  overflow: hidden;
}
.xm-box.--frame {
  box-shadow: 0 1cqw 2.4cqw rgba(60, 40, 25, 0.22);
}
.xm-box > .xm-link,
.xm-link > picture {
  display: block;
  width: 100%;
  height: 100%;
}
/* une seule image étalée sur la double page : moitié gauche / moitié droite */
.xm-img.--spread-l {
  width: 200%;
  max-width: none;
}
.xm-img.--spread-r {
  width: 200%;
  max-width: none;
  margin-left: -100%;
}
.xm-cap a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}
.xm-cap a:hover {
  opacity: 0.6;
}
.xm-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
}
.xm-grid > * {
  min-width: 0;
  min-height: 0;
}
/* nom produit : <a href="$url('Product-Show','pid','XXX')$" class="quickshop fetch-disable">Nom</a> */
/* mosaïques : chaque vignette est un lien .xm-link qui remplit sa case (l'image ne reçoit pas le clic) */
.xm-grid > .xm-link {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.xm-grid > .xm-link .xm-img {
  transition: opacity 0.2s;
}
.xm-grid > .xm-link:hover .xm-img {
  opacity: 0.85;
}
.xm-grid > .xm-link:focus-visible {
  outline: 1px solid var(--xm-ink);
  outline-offset: -2px;
}

/* ---------- Images ----------
   Photo produit   : <a href="$url('Product-Show','pid','XXX')$" class="xm-link quickshop fetch-disable"><img class="xm-img" src="animation/lookbook/lookbook-xmas-h26/nom.jpg?$staticlink$" alt="…" decoding="async" draggable="false"></a>
   Photo manquante : <div class="xm-ph" data-label="…"></div> (carré gris) */
.xm-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  pointer-events: none;
}
.xm-ph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: var(--xm-ph);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.07);
}
.xm-ph::before {
  content: attr(data-label);
  font: 500 max(6px, 1.1cqw)/1 var(--xm-sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #9b958e;
}

/* ---------- Textes ---------- */
.xm-head {
  font: 400 max(7px, 2.36cqw)/1.2 var(--xm-serif);
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: uppercase;
}
.xm-edito {
  font: 400 28.9cqw/1 var(--xm-serif);
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.xm-h {
  font: 400 max(7px, 2.6cqw)/1.2 var(--xm-serif);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.xm-sub {
  font: italic 400 max(6px, 1.95cqw)/1.22 var(--xm-sans);
  color: #1e1c1a;
}
.xm-body p {
  margin: 0 0 1.26em;
  font: 400 max(6px, 1.88cqw)/1.26 var(--xm-sans);
  letter-spacing: 0.01em;
  text-align: justify;
  color: #1e1c1a;
}
.xm-body p:last-child {
  margin-bottom: 0;
}
.xm-cap {
  font: italic 300 max(6px, 1.95cqw)/1.43 var(--xm-sans);
  letter-spacing: 0.01em;
  color: #2a2826;
}
/* légendes calées par le bas (--b = distance au bas de la page) : elles ne débordent jamais */
[style*="--b:"] {
  top: auto;
  bottom: calc(var(--b) * 1cqw / 7.2);
}
.xm-c {
  text-align: center;
}
.xm-r {
  text-align: right;
}
.xm-white {
  color: #fff;
  font-weight: 400;
}

/* ---------- Sans script : on montre au moins la couverture ---------- */
.xm-flipbook:not(.stf__parent) {
  position: relative;
  width: 50%;
  margin-left: 50%;
  aspect-ratio: 720 / 1019;
}
.xm-flipbook:not(.stf__parent) .xm-page {
  position: absolute;
  inset: 0;
}
.xm-flipbook:not(.stf__parent) .xm-page:not(:first-child) {
  display: none;
}

/* ---------- Flèches ---------- */
.xm-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--xm-ink);
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    transform 0.35s cubic-bezier(0.5, 0.05, 0.2, 1),
    opacity 0.3s;
}
.xm-arrow[hidden] {
  display: grid !important;
  opacity: 0;
  pointer-events: none;
}
.xm-arrow svg {
  width: 30px;
  height: 30px;
}
.xm-prev {
  left: calc(50% - var(--xm-w) / 2 - clamp(52px, 5vw, 80px));
}
.xm-next {
  right: calc(50% - var(--xm-w) / 2 - clamp(52px, 5vw, 80px));
}
.xm-prev:hover {
  transform: translate(-4px, -50%);
}
.xm-next:hover {
  transform: translate(4px, -50%);
}
.xm-arrow:focus-visible {
  outline: 1px solid var(--xm-ink);
  outline-offset: 2px;
}
/* couverture fermée : la flèche suivante se colle à la couverture */
.xm-wrap.is-cover .xm-next {
  right: calc(50% - var(--xm-w) / 4 - clamp(52px, 5vw, 80px));
}

/* ---------- Mobile : une page à la fois ---------- */
@media (max-width: 700px) {
  /* titre plus compact */
  :root {
    --xm-title-h: 56px;
    /* une page sur toute la largeur de l'écran */
    --xm-w: min(100vw - 31px, (var(--xm-h) - var(--xm-title-h) - 90px) * 0.7066);
  }
  .xm-title-kicker {
    margin-bottom: 2px;
    font-size: 12px;
  }
  .xm-title-main {
    font-size: 24px;
  }

  /* une page sur toute la largeur de l'écran : pli (7px) collé à gauche, tranche (24px max) jusqu'au bord droit */
  /* hauteur ajustée au livre : 16px au-dessus, la ligne des flèches en dessous */
  .xm-wrap {
    height: auto;
    min-height: 0;
    padding: 10px 0 56px;
    box-sizing: border-box;
  }
  .xm-stage,
  .xm-stage.is-cover {
    transform: translateX(calc(7px - (100vw - var(--xm-w)) / 2));
  }
  /* couverture : pas de pli, la page part du bord gauche */
  .xm-wrap.is-first .xm-stage {
    transform: translateX(calc(0px - (100vw - var(--xm-w)) / 2));
  }
  /* flèches juste sous le livre, aux deux bords de l'écran */
  .xm-arrow {
    top: auto;
    bottom: 4px;
    transform: none;
  }
  .xm-prev {
    left: 0;
  }
  .xm-next,
  .xm-wrap.is-cover .xm-next {
    right: 0;
  }
  .xm-prev:hover,
  .xm-next:hover {
    transform: none;
  }

  /* double page 4 : chaque page a son propre visuel mobile (plus d'image étalée) */
  .xm-img.--spread-l,
  .xm-img.--spread-r {
    width: 100%;
    margin-left: 0;
  }
  /* noms produits non cliquables sur mobile (les photos restent cliquables) */
  .xm-cap a {
    pointer-events: none;
    cursor: default;
  }
  /* éléments masqués sur mobile */
  .xm-desktop-only {
    display: none;
  }
  /* pas de cadre de focus après un tap sur les flèches */
  .xm-arrow:focus:not(:focus-visible),
  .xm-arrow:focus {
    outline: none;
  }

  /* textes : 10px (9px pour « Winter collection ») */
  .xm-head {
    font-size: 9px;
    letter-spacing: 0.04em;
  }
  .xm-h {
    font-size: 10px;
    letter-spacing: 0.03em;
  }
  .xm-sub,
  .xm-cap {
    font-size: 10px;
  }
  .xm-body p {
    font-size: 10px;
  }
  .xm-sub br {
    display: none;
  }
  /* lecture mobile : texte justifié comme la maquette, sous-titres équilibrés */
  .xm-body p {
    text-align: justify;
    hyphens: manual;
    -webkit-hyphens: manual;
    line-height: 1.35;
    margin-bottom: 1.3em;
  }
  .xm-sub {
    line-height: 1.4;
    text-wrap: balance;
  }
  .xm-sub.xm-c {
    left: 8cqw;
    width: 84cqw;
  }
  .xm-cap {
    line-height: 1.5;
  }
  .xm-h + .xm-sub {
    margin-top: 1.6cqw;
  }
  /* blocs élargis / déplacés pour garder des lignes lisibles */
  [style*="--mx"] {
    left: calc(var(--mx) * 1cqw / 7.2);
  }
  [style*="--mw"] {
    width: calc(var(--mw) * 1cqw / 7.2);
  }
  [style*="--my"] {
    top: calc(var(--my) * 1cqw / 7.2);
  }

  /* en mode une page, toutes les pages ont la reliure à gauche */
  .stf__wrapper.--portrait .xm-page::after {
    background: linear-gradient(
      90deg,
      rgba(40, 25, 15, 0.12) 0,
      rgba(40, 25, 15, 0.03) 2.5%,
      transparent 10%
    );
  }
}