/* =========================================================================
   3D PARALLAX UNFURLING GALLERY — Himsahya Holidays
   Scroll-driven 3D perspective grid with cinematic banner expansion
   ========================================================================= */

/* ── SCROLL CONTAINER ───────────────────────────────────────────────────── */
.parallax-gallery-page {
  overflow-x: hidden;
}

.parallax-gallery-scroll-container {
  position: relative;
  height: 350vh; /* drives the scroll-based animation */
}

.parallax-gallery-sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ── EXPANDING BANNER FRAME ─────────────────────────────────────────────── */
.parallax-gallery-banner {
  position: relative;
  width: 90vw;
  height: 80vh;
  border-radius: 24px;
  overflow: hidden;
  background: var(--charcoal, #111111);
  transition: none; /* JS drives the interpolation */
  will-change: width, height, border-radius;
}

/* ── AMBIENT VIGNETTE MASKS ─────────────────────────────────────────────── */
.parallax-gallery-vignette-v,
.parallax-gallery-vignette-h {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}
.parallax-gallery-vignette-v {
  box-shadow:
    inset 0 120px 100px -40px rgba(17, 17, 17, 0.95),
    inset 0 -120px 100px -40px rgba(17, 17, 17, 0.95);
}
.parallax-gallery-vignette-h {
  box-shadow:
    inset 120px 0 100px -40px rgba(17, 17, 17, 0.8),
    inset -120px 0 100px -40px rgba(17, 17, 17, 0.8);
}

/* ── 3D PERSPECTIVE WRAPPER ─────────────────────────────────────────────── */
.parallax-gallery-perspective {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
  perspective-origin: 50% 50%;
  overflow: hidden;
}

/* ── 3D ROTATING GRID ───────────────────────────────────────────────────── */
.parallax-gallery-matrix {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 120%;
  height: 160%;
  padding: 16px;
  transform-style: preserve-3d;
  will-change: transform;
  /* Initial 3D rotation — JS will interpolate this to flat */
  transform: rotateX(20deg) rotateY(-12deg) rotateZ(5deg) translateZ(-80px);
}

/* ── PARALLAX COLUMNS ───────────────────────────────────────────────────── */
.parallax-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  will-change: transform;
  transform-style: preserve-3d;
}
/* Each column scrolls at a different speed — JS drives translateY */

/* ── IMAGE CARDS ────────────────────────────────────────────────────────── */
.parallax-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  height: 320px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s;
  transform-style: preserve-3d;
}
.parallax-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  backface-visibility: hidden;
}
.parallax-card:hover {
  transform: translateZ(30px) scale(1.03);
  box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.5);
  z-index: 5;
}
.parallax-card:hover img {
  transform: scale(1.08);
}

/* Card overlay */
.parallax-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.85) 100%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.parallax-card:hover .parallax-card-overlay {
  opacity: 1;
  transform: translateY(0);
}
.parallax-card-title {
  font-family: var(--font-sans, 'Urbanist', sans-serif);
  font-size: 0.9375rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}
.parallax-card-region {
  font-family: var(--font-sans, 'Urbanist', sans-serif);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

/* ── FLOATING TITLE BADGE ───────────────────────────────────────────────── */
.parallax-gallery-title-float {
  position: absolute;
  z-index: 20;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 90%;
  max-width: 680px;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

/* ── LIGHTBOX ENHANCEMENTS ──────────────────────────────────────────────── */
.lightbox-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 80vw;
  max-height: 85vh;
}
.lightbox-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.6);
  transition: opacity 0.3s ease;
}
.lightbox-meta {
  text-align: center;
  margin-top: 24px;
  color: #ffffff;
}
.lightbox-title {
  font-family: var(--font-sans, 'Urbanist', sans-serif);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.lightbox-desc {
  font-family: var(--font-sans, 'Urbanist', sans-serif);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
  max-width: 500px;
  line-height: 1.6;
}

/* ── MOBILE ADJUSTMENTS ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .parallax-gallery-scroll-container {
    height: 280vh;
  }
  .parallax-gallery-banner {
    width: 95vw;
    height: 75vh;
    border-radius: 16px;
  }
  .parallax-gallery-matrix {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 160%;
    height: 200%;
  }
  .parallax-col[data-col="2"],
  .parallax-col[data-col="3"] {
    display: none;
  }
  .parallax-card {
    height: 240px;
    border-radius: 8px;
  }
  .parallax-gallery-vignette-v {
    box-shadow:
      inset 0 80px 60px -30px rgba(17, 17, 17, 0.95),
      inset 0 -80px 60px -30px rgba(17, 17, 17, 0.95);
  }
  .parallax-gallery-vignette-h {
    box-shadow:
      inset 60px 0 50px -20px rgba(17, 17, 17, 0.8),
      inset -60px 0 50px -20px rgba(17, 17, 17, 0.8);
  }
  .lightbox-container {
    max-width: 95vw;
  }
}

@media (max-width: 480px) {
  .parallax-gallery-title-float h1 {
    font-size: 1.75rem !important;
  }
  .parallax-gallery-title-float p {
    font-size: 0.8125rem !important;
  }
}
