/* Animations au scroll et au survol, communes à toutes les pages (pilotées par js/animations.js).
   Pas de Tailwind ici : fichier servi tel quel. */

/* 2. Entrée du hero au chargement : titre depuis la gauche, boutons depuis la droite */
@media (prefers-reduced-motion: no-preference) {
  @keyframes hero-in-left {
    from { opacity: 0; transform: translateX(-60px); }
  }
  @keyframes hero-in-right {
    from { opacity: 0; transform: translateX(60px); }
  }
  [data-hero-in="left"] {
    animation: hero-in-left 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  [data-hero-in="right"] {
    animation: hero-in-right 900ms cubic-bezier(0.16, 1, 0.3, 1) 120ms both;
  }

  /* 3. Apparition des sections (attribut posé par js/animations.js) */
  [data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1), transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  [data-reveal].is-visible {
    opacity: 1;
    transform: none;
  }
}

/* 5. Repères fixes : masqués tant que js/animations.js ne les affiche pas */
[data-fixe] {
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 300ms ease, transform 300ms ease, visibility 0s linear 300ms;
}
[data-fixe].is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}
@media (max-width: 639.98px) {
  /* Sans bouton « Réserver » fixe (pied visible, ou page sans bouton), la pastille descend */
  [data-back-top].is-low { bottom: 1rem; }
}

/* 7. Reduced-motion : pas de transition des repères, pas de scroll animé, pas de flèche qui rebondit */
@media (prefers-reduced-motion: reduce) {
  [data-fixe] { transition: none; transform: none; }
  html.scroll-smooth { scroll-behavior: auto; }
  .animate-bounce { animation: none; }
}

/* 6. Carrousel horizontal aimanté sous 860 px */
@media (max-width: 859.98px) {
  [data-carousel] {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 1rem;
    margin-inline: -1rem;
    padding-inline: 1rem;
    scrollbar-width: none;
  }
  [data-carousel]::-webkit-scrollbar { display: none; }
  [data-carousel] > * {
    flex: 0 0 85%;
    scroll-snap-align: start;
  }
}
@media (min-width: 768px) and (max-width: 859.98px) {
  /* md:px-8 : la marge négative suit le padding de la section */
  [data-carousel] { margin-inline: -2rem; padding-inline: 2rem; scroll-padding-inline: 2rem; }
}

/* 4. Survol des cartes et des tuiles (écrans à souris) */
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  [data-card]:not([data-reveal]) {
    transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  [data-card]:not([data-reveal]):hover {
    transform: translateY(-3px);
  }
  [data-card] img.object-cover {
    transition-duration: 800ms;
    transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  }
  .group[data-card]:hover img.object-cover {
    --tw-scale-x: 1.03;
    --tw-scale-y: 1.03;
  }
  /* Le cadre ne grossit plus : c'est la carte qui se soulève et s'incline */
  .group[data-card]:hover .group-hover\:scale-\[1\.03\] {
    --tw-scale-x: 1;
    --tw-scale-y: 1;
  }
}
