/* Animaciones de scroll añadidas para la reconstrucción del sitio */

/* Sin JS (o si algo falla), todo se muestra normal: estos selectores solo
   aplican una vez <html> recibe la clase "js" desde el script del <head>. */
@media (prefers-reduced-motion: no-preference) {
  html.js [data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.22,.9,.3,1);
    will-change: opacity, transform;
  }

  html.js [data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  /* El hero se muestra ya animado al cargar, sin esperar scroll */
  html.js section:first-of-type[data-reveal] {
    transition-delay: .05s;
  }

  html.js [data-reveal-child] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.22,.9,.3,1);
  }

  html.js [data-reveal].is-visible [data-reveal-child] {
    opacity: 1;
    transform: translateY(0);
  }

  html.js [data-reveal].is-visible [data-reveal-child]:nth-child(1) { transition-delay: .05s; }
  html.js [data-reveal].is-visible [data-reveal-child]:nth-child(2) { transition-delay: .12s; }
  html.js [data-reveal].is-visible [data-reveal-child]:nth-child(3) { transition-delay: .19s; }
  html.js [data-reveal].is-visible [data-reveal-child]:nth-child(4) { transition-delay: .26s; }
  html.js [data-reveal].is-visible [data-reveal-child]:nth-child(5) { transition-delay: .33s; }
  html.js [data-reveal].is-visible [data-reveal-child]:nth-child(6) { transition-delay: .4s; }
}

/* Sutil animación flotante para el mockup de WhatsApp del hero */
@media (prefers-reduced-motion: no-preference) {
  .hero-phone-float {
    animation: hero-float 6s ease-in-out infinite;
  }
  @keyframes hero-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
  }
}

/* Barra de progreso de scroll */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: #6d28d9;
  background: oklch(51.7% .242 284);
  z-index: 60;
  transition: width 0.1s linear;
}

/* ===================== Efectos hover ===================== */

/* Tarjetas dentro de cuadrículas (problema, servicios, ausencias, proceso):
   se elevan ligeramente y ganan sombra al pasar el ratón. No afecta a las
   burbujas de chat del mockup porque esas no son hijas directas de .grid. */
main .grid > div[class*="rounded-2xl"],
main .grid > div[class*="rounded-3xl"],
main .faq-item {
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
main .grid > div[class*="rounded-2xl"]:hover,
main .grid > div[class*="rounded-3xl"]:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 32px -14px rgba(32, 20, 64, 0.22);
}

/* Tarjetas de "ausencias", que no traían ningún hover propio */
.hover-card { transition: transform .3s ease, box-shadow .3s ease; }
.hover-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 32px -14px rgba(32, 20, 64, 0.18);
  border-color: color-mix(in oklch, oklch(51.7% .242 284) 35%, transparent);
}

/* Enlaces de navegación: pequeño levantamiento + subrayado al pasar el ratón */
nav a {
  transition: transform .2s ease, color .2s ease;
}
nav a:hover {
  transform: translateY(-1px);
}
nav a[href^="#"]:not(.bg-clinia):hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Mockup del chat de WhatsApp: ligera inclinación al pasar el ratón */
.hero-phone-float {
  transition: transform .4s ease;
}
.hero-phone-float:hover {
  transform: rotate(-1deg) scale(1.015);
}

/* Icono de Instagram: pequeño salto al pasar el ratón */
a[aria-label*="Instagram"] svg,
a[href*="instagram.com"] svg {
  transition: transform .25s ease;
}
a[aria-label*="Instagram"]:hover svg,
a[href*="instagram.com"]:hover svg {
  transform: scale(1.15) rotate(-6deg);
}

/* Botones de texto "Ver cómo funciona" / flechas: la flecha se desplaza al hover */
main a svg.lucide-arrow-right {
  transition: transform .25s ease;
}
main a:hover svg.lucide-arrow-right {
  transform: translateX(4px);
}

/* FAQ: acordeón con flecha que gira y resalta el borde cuando está abierto.
   El padding se fija aquí en CSS normal porque p-5/pb-5/sm:p-6 no forman
   parte del CSS de Tailwind ya compilado (solo incluye las clases que se
   usaban en el diseño original). */
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item { overflow: hidden; }
.faq-item summary { padding: 1.1rem 1.25rem; }
.faq-item p { padding: 0 1.25rem 1.1rem; margin-top: -0.25rem; }
@media (min-width: 640px) {
  .faq-item summary { padding: 1.4rem 1.6rem; }
  .faq-item p { padding: 0 1.6rem 1.4rem; }
}
.faq-item:hover {
  border-color: color-mix(in oklch, oklch(51.7% .242 284) 40%, transparent);
}
.faq-chevron {
  transition: transform .3s ease;
}
.faq-item[open] {
  box-shadow: 0 20px 32px -14px rgba(32, 20, 64, 0.16);
}
.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
}

/* Footer: más ancho que el resto del contenido (max-w-6xl no existe para él)
   y más aire entre bloques, sobre todo en móvil donde el logo y el texto
   quedaban muy pegados. */
.site-footer-inner {
  max-width: 90rem; /* 1440px, más ancho que el max-w-6xl (1152px) del resto */
  row-gap: 1.75rem;
}
.site-footer { padding-top: 3rem; padding-bottom: 3rem; }
@media (max-width: 639px) {
  .site-footer-inner > div:first-child {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
  .site-footer-inner .flex-wrap {
    justify-content: center;
    row-gap: 0.75rem;
  }
}

/* Botón principal pulsante y sutil para invitar al clic (hero + CTA final) */
@media (prefers-reduced-motion: no-preference) {
  main section:first-of-type a.bg-clinia {
    animation: cta-pulse 3.2s ease-in-out infinite;
  }
  @keyframes cta-pulse {
    0%, 100% { box-shadow: 0 0 0 0 oklch(51.7% .242 284 / 0.35); }
    50% { box-shadow: 0 0 0 10px oklch(51.7% .242 284 / 0); }
  }
}
