/* ==========================================================================
   VITRINE — MOUVEMENTS
   --------------------------------------------------------------------------
   Des mouvements courts, qui accompagnent la lecture au lieu de la retarder :
   la photo d'accueil qui respire lentement, les titres qui se posent, les
   plats qui apparaissent quand on les atteint, la photo qui s'approche au
   survol, le bouton qui répond au doigt.

   Deux garde-fous :
   - rien n'est masqué sans JavaScript : l'état « avant apparition » n'existe
     que sous html.js, posé par la page elle-même ;
   - qui a demandé moins de mouvement à son système n'en a aucun.
   ========================================================================== */

/* ------------------------------------------------- photos et leur mention */

.plat-media { overflow: hidden; }
.plat-media img { transition: transform .9s cubic-bezier(.2, .8, .2, 1), filter .6s ease; }
.plat-carte:hover .plat-media img,
.plat-carte:focus-within .plat-media img { transform: scale(1.07); filter: saturate(1.08); }

.mention-illustration,
.credit-photo {
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  padding: 3px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 600; letter-spacing: .01em;
  background: rgba(15, 18, 32, .62); color: #fff;
  backdrop-filter: blur(4px);
}
.credit-photo { right: 10px; left: 10px; bottom: 10px; border-radius: 10px; font-weight: 500; line-height: 1.4; }
.credit-photo a { color: #fff; text-decoration: underline; }
.fiche-media { position: relative; overflow: hidden; }

.liste-credits { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; color: var(--encre-3); }
.liste-credits a { color: inherit; text-decoration: underline; }

/* ---------------------------------------------------------------- l'accueil */

/* La photo d'accueil avance très lentement : elle vit sans distraire. */
.heros-carrousel .carousel-item img,
.heros-image img { animation: respiration 16s ease-in-out infinite alternate; transform-origin: 60% 50%; }

@keyframes respiration {
  from { transform: scale(1); }
  to { transform: scale(1.12) translate(-1.5%, -1%); }
}

/* Le texte se pose, ligne après ligne. */
.heros-contenu > * { animation: poser .9s cubic-bezier(.2, .8, .2, 1) both; }
.heros-contenu > :nth-child(1) { animation-delay: .1s; }
.heros-contenu > :nth-child(2) { animation-delay: .22s; }
.heros-contenu > :nth-child(3) { animation-delay: .36s; }
.heros-contenu > :nth-child(4) { animation-delay: .5s; }

@keyframes poser {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

/* La légende du carrousel glisse avec la diapositive. */
.heros-carrousel .carousel-item.active .heros-legende { animation: poser .8s .3s cubic-bezier(.2, .8, .2, 1) both; }

/* ------------------------------------------------- apparition au défilement */

html.js .apparait { opacity: 0; transform: translateY(26px); }
html.js .apparait.visible {
  opacity: 1; transform: none;
  transition: opacity .7s ease, transform .8s cubic-bezier(.2, .8, .2, 1);
  transition-delay: calc(var(--rang, 0) * 70ms);
}

/* Le filet doré sous les titres se trace quand le titre arrive. */
html.js [data-theme="cote"] .section-tete h2::after { width: 0; transition: width .9s .25s cubic-bezier(.2, .8, .2, 1); }
html.js [data-theme="cote"] .section-tete.visible h2::after,
html:not(.js) [data-theme="cote"] .section-tete h2::after { width: 56px; }

/* ------------------------------------------------------------ les gestes */

.btn { transition: transform .15s ease, box-shadow .2s ease, background .2s ease, filter .2s ease; }
.btn:active { transform: scale(.97); }

/* Le bouton « Ajouter » confirme avant même que la page ne se recharge. */
.btn.ajout-en-cours { pointer-events: none; filter: brightness(1.1); }
.btn.ajout-en-cours::after {
  content: ""; width: 14px; height: 14px; margin-left: 8px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  display: inline-block; vertical-align: -2px; animation: tourner .7s linear infinite;
}
@keyframes tourner { to { transform: rotate(360deg); } }

/* Le panier flottant arrive par le bas, et salue quand il change. */
.panier-flottant { animation: arriver .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes arriver { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

.coeur { transition: transform .2s ease, color .2s ease; }
.coeur:hover { transform: scale(1.12); }
.coeur.aime { animation: battre .5s ease; }
@keyframes battre { 30% { transform: scale(1.3); } 60% { transform: scale(.92); } }

/* Les onglets de catégorie glissent, l'actif se distingue en douceur. */
.onglets a { transition: background .25s ease, color .25s ease, box-shadow .25s ease; }

/* ------------------------------------------------------------- sobriété */

@media (prefers-reduced-motion: reduce) {
  .heros-carrousel .carousel-item img, .heros-image img,
  .heros-contenu > *, .panier-flottant, .coeur.aime,
  .heros-carrousel .carousel-item.active .heros-legende { animation: none !important; }
  html.js .apparait { opacity: 1; transform: none; }
  .plat-media img, .btn { transition: none !important; }
  .plat-carte:hover .plat-media img { transform: none; }
}

/* Un prix ne se coupe pas en deux : « 12 » d'un côté, « 000 » de l'autre. */
.plat-prix, .plat-prix * { white-space: nowrap; }
