/* ============================================================
   Animations & transitions globales
   Activées par IntersectionObserver dans theme.js
   ============================================================ */

/* ─── Éléments animables ──────────────────────────────────── */

.vc-animate {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity .7s cubic-bezier(.4, 0, .2, 1),
    transform .7s cubic-bezier(.4, 0, .2, 1);
}

.vc-animate.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Délai explicite porté par le template (--card-delay) */
.vc-section-card.vc-animate { transition-delay: var(--card-delay, 0ms); }

/* Délais en cascade pour les autres grilles */
.vc-post-card.vc-animate:nth-child(2) { transition-delay: .1s; }
.vc-post-card.vc-animate:nth-child(3) { transition-delay: .2s; }
.vc-post-card.vc-animate:nth-child(4) { transition-delay: .3s; }
.vc-post-card.vc-animate:nth-child(5) { transition-delay: .4s; }
.vc-post-card.vc-animate:nth-child(6) { transition-delay: .5s; }
.vc-post-card.vc-animate:nth-child(7) { transition-delay: .6s; }

/* ─── Barre de progression lecture ───────────────────────── */

.vc-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  height: 2px;
  width: 0%;
  background: var(--vc-color-accent);
  transition: width .1s linear;
  pointer-events: none;
}

/* ─── Fade up (helper) ────────────────────────────────────── */

@keyframes vc-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes vc-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes vc-scale-in {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* ─── Prefer reduced motion ───────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .vc-animate,
  .vc-animate.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .vc-hero-slide {
    transition: opacity .3s ease !important;
    transform: none !important;
  }

  /* Hero : contenu affiché d'emblée, sans cascade, masques ni parallaxe
     (parallax.js ne démarre pas non plus dans ce mode) */
  .vc-hero-eyebrow,
  .vc-hero-title,
  .vc-hero-title-word > span,
  .vc-hero-divider,
  .vc-hero-actions,
  .vc-hero-slider,
  .vc-hero-video {
    animation: none !important;
    opacity: 1;
    transform: none !important;
  }
}
