/* =====================================================================
   SECTION #nouveautes (« QUOI DE NEUF SUR MRV PROD ») — propriétaire : fan.js
   Fond sombre (traits de fond visibles) ; éventail statique de 7 photos verticales à grands arrondis : la carte du centre est droite et
   au premier plan, les autres s'inclinent vers l'extérieur et passent derrière. Ouverture unique à l'arrivée.
   ===================================================================== */
.fansec { padding: clamp(30px, 4vh, 58px) 0 clamp(120px, 18vh, 240px); overflow: hidden; text-align: center; }

/* ---- en-tête */
.fn-head { display: grid; justify-items: center; gap: clamp(8px, 1.4vh, 16px); padding: 0 var(--g); }
.fn-h { display: grid; justify-items: center; font-size: clamp(2.6rem, 5.3vw, 6.4rem); color: var(--fg); }
.fn-h .t-grotesk { display: block; }
.fn-h .t-serif { display: block; color: var(--mrv-pink); margin-top: .02em; }

/* ---- éventail */
.fan { --cw: clamp(150px, 20.5vw, 400px); --ch: calc(var(--cw) * 1.75); --step: calc(var(--cw) * .56); position: relative; height: calc(var(--ch) * 1.2); max-width: 1920px; margin: clamp(36px, 5.6vh, 70px) auto 0; }
.fc { position: absolute; left: 50%; top: calc(var(--ch) * .02); width: var(--cw); height: var(--ch); margin-left: calc(var(--cw) / -2); border-radius: clamp(22px, 2.6vw, 52px); overflow: hidden; background: transparent; z-index: calc(10 - var(--a));
  --rise: 0px;
  transform-origin: 50% 50%;
  transform: translateX(calc(var(--k) * var(--step))) translateY(calc(var(--a) * var(--a) * var(--ch) * .022 + var(--a) * var(--ch) * .03 + var(--rise))) rotate(calc(var(--k) * 6.5deg)) scale(calc(1 - var(--a) * .055));
  box-shadow: none; transition: transform 1.2s var(--ease), opacity .8s var(--ease), box-shadow .5s var(--ease); -webkit-tap-highlight-color: transparent; }
.fc img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; transition: transform 1.05s var(--ease); }
.fc:focus-visible { outline: 3px solid var(--mrv-pink); outline-offset: 4px; }

/* au survol : la photo s'avance, se redresse et se dote d'un halo rose (aucun contour noir) */
.fc:hover, .fc:focus-visible { z-index: 30; box-shadow: 0 26px 60px -26px var(--pink-glow);
  transform: translateX(calc(var(--k) * var(--step))) translateY(calc(var(--a) * var(--ch) * .03 - var(--ch) * .055 + var(--rise))) rotate(calc(var(--k) * 2deg)) scale(1.05); }

/* ---- ouverture unique (JS) : « distribution de cartes »
   Les 7 photos sont d'abord empilées en paquet, serrées au centre et légèrement de travers ;
   à l'arrivée dans la section, elles sont distribuées une à une de la gauche vers la droite :
   chaque carte pivote, s'échappe du paquet et va se loger dans sa place d'éventail avec un léger rebond,
   pendant que sa photo recule doucement (zoom arrière). Le survol reprend la main une fois fini. */
.fansec.js-on:not(.is-in) .fc {
  opacity: 0;
  transform: translateX(calc(var(--k) * var(--step) * .06)) translateY(calc(var(--ch) * .2)) rotate(-11deg) scale(.66);
}
.fansec.js-on:not(.is-in) .fc img { transform: scale(1.3); }

/* la distribution : délai en cascade (gauche → droite), ressort sur la trajectoire */
.fansec.js-on.is-in .fc {
  transition-property: transform, opacity, box-shadow;
  transition-duration: 1.15s, .5s, .5s;
  transition-timing-function: var(--ease-back), ease-out, var(--ease);
  transition-delay: calc((var(--k) + 3) * 90ms), calc((var(--k) + 3) * 90ms), 0s;
}
.fansec.js-on.is-in .fc img {
  transition-property: transform;
  transition-duration: 1.5s;
  transition-timing-function: var(--ease);
  transition-delay: calc((var(--k) + 3) * 90ms + 150ms);
}

/* distribution terminée : on restaure les transitions de survol habituelles, sans délai */
.fansec.js-on.is-in.done .fc { transition: transform 1.2s var(--ease), opacity .8s var(--ease), box-shadow .5s var(--ease); }
.fansec.js-on.is-in.done .fc img { transition: transform 1.05s var(--ease); }

@media (max-width: 860px) {
  .fan { --cw: 40vw; --step: calc(var(--cw) * .42); height: calc(var(--ch) * 1.08); }
  .fc { border-radius: 20px; }
  /* tablette et mobile : 5 photos (2-3-4-5-6), recentrées en éventail symétrique */
  .fc:nth-child(1), .fc:nth-child(7) { display: none; }
  .fc:nth-child(2) { --k: -2; --a: 2; }
  .fc:nth-child(3) { --k: -1; --a: 1; }
  .fc:nth-child(4) { --k: 0; --a: 0; }
  .fc:nth-child(5) { --k: 1; --a: 1; }
  .fc:nth-child(6) { --k: 2; --a: 2; }
}
@media (prefers-reduced-motion: reduce) { .fc { transition: none; } }
