/* Amor no Papel — custom styles and animations */

/* Soft scroll-triggered fade-in */
.animate-in {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

.animation-delay-200 { transition-delay: 0.2s; }
.animation-delay-400 { transition-delay: 0.4s; }

/* Section scroll-in (for sections that use .scroll-anchor) */
.scroll-anchor .section-title {
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.scroll-anchor.is-visible .section-title {
  opacity: 1;
  transform: translateY(0);
}

.scroll-anchor .service-card {
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.scroll-anchor.is-visible .service-card {
  opacity: 1;
  transform: translateY(0);
}

.scroll-anchor .service-card:nth-child(1) { transition-delay: 0.05s; }
.scroll-anchor .service-card:nth-child(2) { transition-delay: 0.1s; }
.scroll-anchor .service-card:nth-child(3) { transition-delay: 0.15s; }
.scroll-anchor .service-card:nth-child(4) { transition-delay: 0.2s; }

/* Gallery grid items stagger (optional) */
.gallery-grid .gallery-item {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.35s ease, transform 0.35s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.gallery-grid.is-visible .gallery-item {
  opacity: 1;
  transform: scale(1);
}

/* Lightbox overlay transition */
.lightbox {
  transition: opacity 0.35s ease;
}

.lightbox.is-open {
  display: flex !important;
  opacity: 0;
  animation: lightboxFadeIn 0.35s ease forwards;
}

.lightbox.is-closing {
  animation: lightboxFadeOut 0.25s ease forwards;
}

@keyframes lightboxFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes lightboxFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

#lightbox-img {
  animation: lightboxImageIn 0.35s ease 0.1s both;
}

@keyframes lightboxImageIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Focus styles for accessibility (reinforce Tailwind) */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #b26978;
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .animate-in,
  .scroll-anchor .section-title,
  .scroll-anchor .service-card,
  .gallery-grid .gallery-item,
  .lightbox,
  #lightbox-img {
    transition: none;
    animation: none;
  }

  .animate-in,
  .scroll-anchor .section-title,
  .scroll-anchor .service-card,
  .gallery-grid .gallery-item {
    opacity: 1;
    transform: none;
  }

  .gallery-grid.is-visible .gallery-item {
    transform: none;
  }
}
