/*
 * Animaciones de entrada al hacer scroll — Telecom Cordillera.
 *
 * Contexto importante: el sitio es una SPA ya compilada (no hay .tsx fuente
 * en este repo) y CASI TODAS las secciones ya traen su propia animacion de
 * entrada hecha con GSAP + ScrollTrigger dentro del bundle
 * (index-CISZSGUd.js): fade + leve desplazamiento, "once: true" (no se
 * repite al subir/bajar), con retrasos escalonados titulo -> texto -> CTA /
 * tarjetas. Esas NO se tocan aca para no duplicar ni generar conflictos.
 *
 * Lo que faltaba:
 *   1) La seccion de stats (grid de 4 numeros, "2000+ / 65 km / 32 estados
 *      / ...") es la unica seccion de la pagina sin ninguna animacion de
 *      entrada. La utilidad .tc-reveal de aqui abajo (activada por
 *      scroll-reveal.js con IntersectionObserver, sin GSAP) es solo para
 *      esa seccion.
 *   2) Ninguna de las animaciones GSAP existentes respeta
 *      prefers-reduced-motion. El bloque final de este archivo corrige eso
 *      sitewide con reglas !important: no se puede editar la logica interna
 *      del bundle compilado, pero un !important en el CSS si gana sobre el
 *      estilo inline que GSAP anima cuadro a cuadro.
 */

/* --- Utilidad .tc-reveal (usada solo por scroll-reveal.js) --- */

.tc-reveal > * {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.tc-reveal.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Retraso escalonado para hasta 6 hijos directos (aca se usan 4). */
.tc-reveal > *:nth-child(1) { transition-delay: 0ms; }
.tc-reveal > *:nth-child(2) { transition-delay: 80ms; }
.tc-reveal > *:nth-child(3) { transition-delay: 160ms; }
.tc-reveal > *:nth-child(4) { transition-delay: 240ms; }
.tc-reveal > *:nth-child(5) { transition-delay: 320ms; }
.tc-reveal > *:nth-child(6) { transition-delay: 400ms; }

/* --- prefers-reduced-motion: sitewide, incluye lo animado por GSAP --- */

@media (prefers-reduced-motion: reduce) {
  .tc-reveal > * {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .service-card,
  .connecting-headline,
  .connecting-body,
  .connecting-cta,
  .rep-map,
  .rep-card-item,
  .to-card,
  .to-left,
  .to-right,
  .cf-image-wrap,
  .cf-text,
  .gl-image-wrap,
  .gl-text,
  .wc-item,
  .wc-image,
  .leadership-content,
  .footer-cta-card,
  .mapa-title,
  .tcm-map,
  .tcm-panel,
  .torre-pin,
  .mapa-stats-bar > * {
    opacity: 1 !important;
    transform: none !important;
  }
}
