/* Custom overrides & utilities for Rumah Sunat Solo */

/* Smooth scrolling (respect reduced motion) */
html {
  scroll-behavior: smooth;
}

@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;
  }
}

/* Focus visible ring */
:focus-visible {
  outline: 3px solid #1E3D6E;
  outline-offset: 2px;
}

/* Scroll-triggered fade-in base */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

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

/* Stagger delays for orchestrated reveals */
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.92);
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  transform: scale(0.96);
  transition: transform 0.25s ease;
}

.lightbox.is-open img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  padding: 0.5rem;
  transition: background 0.2s ease;
}

.lightbox-close:hover,
.lightbox-close:focus {
  background: rgba(255, 255, 255, 0.25);
}

/* Testimoni carousel */
.testimoni-track {
  display: flex;
  gap: 1rem;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  .testimoni-track {
    transition: none;
  }
}

/* Tab transitions */
.tab-panel {
  display: none;
  animation: fadePanel 0.3s ease-out;
}

.tab-panel.is-active {
  display: block;
}

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

/* Card hover lift */
.hover-lift {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Mobile nav drawer */
.mobile-nav {
  transform: translateX(100%);
  transition: transform 0.25s ease-in-out;
}

.mobile-nav.is-open {
  transform: translateX(0);
}

/* FAQ accordion */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
  opacity: 0;
}

.faq-item.is-open .faq-answer {
  opacity: 1;
}

.faq-icon {
  transition: transform 0.25s ease;
}

.faq-item.is-open .faq-icon {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .faq-answer {
    transition: none;
  }
  .faq-icon {
    transition: none;
  }
}

/* Decorative soft blobs */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

/* Gradient mesh background */
.gradient-mesh {
  background:
    radial-gradient(circle at 15% 25%, rgba(30, 61, 110, 0.10) 0%, transparent 35%),
    radial-gradient(circle at 85% 15%, rgba(248, 200, 8, 0.14) 0%, transparent 30%),
    radial-gradient(circle at 50% 90%, rgba(90, 127, 184, 0.10) 0%, transparent 35%);
}

/* Noise texture overlay */
.noise-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 1;
}

/* Ensure content sits above decorative layers */
.relative-z {
  position: relative;
  z-index: 2;
}
