/* =========================================================
   Retras — styles personnalisés
   Tailwind gère le reste via CDN + config inline dans index.html
   ========================================================= */

html {
  scroll-behavior: smooth;
}

/* Respect de la préférence "réduire le mouvement" */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: 'DM Sans', sans-serif;
  color: #29235C;
}

/* Header fixed : fond transparent par défaut, blanc quand scrollé > 50px
   (le JS ajoute la classe .is-scrolled) */
#site-header.is-scrolled {
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Menu mobile ouvert */
#mobile-menu.is-open {
  display: flex;
}

/* Lien de nav actif (section visible en cours de scroll) */
.nav-link.is-active,
.mobile-nav-link.is-active {
  color: #29235C;
  font-weight: 500;
}

/* ---------------------------------------------------------
   Animations au scroll : fade-in + remontée subtile
   ⚠️ Défensif : par défaut, les sections SONT visibles. Ce n'est
   que lorsque html.js-enabled est présent (ajouté par le JS au
   chargement) qu'on les cache initialement. Si le JS échoue, tout
   reste visible — jamais de page blanche.
   --------------------------------------------------------- */
.reveal-on-scroll {
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
html.js-enabled .reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
}
html.js-enabled .reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Respect de prefers-reduced-motion : pas d'animation d'entrée */
@media (prefers-reduced-motion: reduce) {
  html.js-enabled .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------------------------------------------------------
   Carousel partenaires : transition fade lors de la rotation
   --------------------------------------------------------- */
#partners-track {
  transition: opacity 0.25s ease-in-out;
}
#partners-track.is-transitioning {
  opacity: 0;
}

/* Limite à 3 cartes visibles : les items 4+ sont cachés, accessibles
   via les flèches/swipe qui réordonnent le DOM. */
#partners-track > article:nth-child(n+4) {
  display: none;
}

/* Bullets indicateurs de position */
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: rgba(41, 35, 92, 0.2);
  transition: background 0.2s, width 0.2s;
  border: none;
  cursor: pointer;
  padding: 0;
}
.carousel-dot:hover {
  background: rgba(41, 35, 92, 0.45);
}
.carousel-dot.is-active {
  background: #29235C;
  width: 24px;
}
.carousel-dot:focus-visible {
  outline: 2px solid #29235C;
  outline-offset: 3px;
}

/* ---------------------------------------------------------
   Logos partenaires (footer) : désaturés par défaut,
   retrouvent leur couleur au hover / focus
   --------------------------------------------------------- */
.partner-logo {
  filter: grayscale(1);
  opacity: 0.7;
  transition: filter 0.25s ease, opacity 0.25s ease;
}
.partner-logo:hover,
.partner-logo:focus {
  filter: grayscale(0);
  opacity: 1;
}

/* ---------------------------------------------------------
   Carousel horizontal des témoignages sur mobile uniquement
   Au-delà de 640px (sm), la grid Tailwind reprend
   --------------------------------------------------------- */
@media (max-width: 639px) {
  .testimonials-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding-bottom: 12px;
    scroll-padding-left: 24px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .testimonials-grid::-webkit-scrollbar {
    display: none;
  }
  .testimonials-grid > * {
    flex: 0 0 85%;
    scroll-snap-align: center;
  }
}

/* Étoiles (section témoignages) */
.stars {
  display: flex;
  gap: 4px;
}
.stars img {
  width: 14px;
  height: 14px;
}

/* Dégradé des chiffres statistiques (42% / +300)
   Clip en texte avec fallback couleur rouge sur les navigateurs non-supportés */
.stat-gradient {
  background: linear-gradient(to top, #29235C 0%, #E63946 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* État actif du bouton "back to top" — le JS ajoute la classe .is-visible */
#back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Toast newsletter — idem */
#newsletter-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Scrollbar discrète, aux couleurs de la marque */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: #29235C;
  border-radius: 4px;
}
