/* ==========================================================================
   VITALIA NUTRICIÓN CLÍNICA — Animations & Reveal (css/animations.css)
   Transiciones suaves nórdicas con visibilidad garantizada sin JS
   y respeto estricto a prefers-reduced-motion.
   ========================================================================== */

@keyframes fadeUpIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panelFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Visibilidad garantizada por defecto si JS no ha corrido o está desactivado */
.reveal-item {
  opacity: 1;
  transform: none;
  transition:
    opacity 550ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 550ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Solo ocultamos inicialmente los elementos no revelados cuando JS confirma soporte */
html.reveal-ready .reveal-item:not(.is-revealed) {
  opacity: 0;
  transform: translateY(18px);
}

html.reveal-ready .reveal-item.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Animación suave al cambiar de panel en Tabs Segmentadas */
.segmented-tab-panel.is-active:not([hidden]) {
  animation: panelFadeIn 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Entrada sutil del hero */
.hero-cinema-card {
  animation: fadeUpIn 650ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-cinema-badge {
  animation: fadeUpIn 780ms cubic-bezier(0.22, 1, 0.36, 1) 100ms both;
}

/* Respeto estricto a preferencia de movimiento reducido */
@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;
    scroll-behavior: auto !important;
  }

  .reveal-item,
  html.reveal-ready .reveal-item:not(.is-revealed),
  html.reveal-ready .reveal-item.is-revealed {
    opacity: 1 !important;
    transform: none !important;
  }
}
