/* Instagram 3D Parallax Unfurling Gallery — Laura Matta */

.ig-parallax {
  position: relative;
  background: #0f1c18;
  color: #fff;
  /* não usar overflow aqui — quebra position:sticky do track */
  padding: 0;
}

.ig-parallax__intro {
  position: relative;
  z-index: 2;
  padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem;
  text-align: center;
}

.ig-parallax__intro .section__label {
  color: color-mix(in srgb, var(--color-primary) 85%, white);
}

.ig-parallax__intro h2 {
  color: #fff;
  margin: 0.35rem 0 0.75rem;
}

.ig-parallax__intro p {
  color: rgba(255, 255, 255, 0.72);
  max-width: 36rem;
  margin-inline: auto;
  line-height: var(--line-height-body, 1.5);
}

.ig-parallax__track {
  position: relative;
  height: 380vh;
  background: #0f1c18;
}

.ig-parallax__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ig-parallax__banner {
  position: relative;
  width: 90vw;
  height: 80vh;
  max-width: 1920px;
  margin-inline: auto;
  background: #0a1411;
  border: 4px solid color-mix(in srgb, var(--color-primary) 55%, #2c2738);
  border-radius: 48px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: width, height, border-radius;
  transform: translateZ(0);
}

.ig-parallax__perspective {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
  pointer-events: none;
}

.ig-parallax__vignette {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  box-shadow:
    inset 0 100px 150px -50px rgba(0, 0, 0, 0.95),
    inset 0 -100px 150px -50px rgba(0, 0, 0, 0.95),
    inset 150px 0 150px -50px rgba(0, 0, 0, 0.9),
    inset -150px 0 150px -50px rgba(0, 0, 0, 0.9);
}

.ig-parallax__matrix {
  display: flex;
  gap: clamp(0.75rem, 1.5vw, 1.5rem);
  justify-content: center;
  align-items: center;
  width: 120vw;
  height: 150vh;
  transform-origin: center center;
  transform-style: preserve-3d;
  will-change: transform;
  backface-visibility: hidden;
}

.ig-parallax__col {
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 1.5vw, 1.5rem);
  width: 22vw;
  min-width: 160px;
  max-width: 280px;
  pointer-events: auto;
  will-change: transform;
}

.ig-parallax__card {
  display: block;
  width: 100%;
  height: clamp(180px, 28vh, 400px);
  flex-shrink: 0;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  will-change: transform;
  transition: transform 0.3s ease, opacity 0.3s ease;
  text-decoration: none;
}

.ig-parallax__card:hover {
  transform: scale(1.02);
}

.ig-parallax__card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
  transition: opacity 0.3s ease;
  display: block;
}

.ig-parallax__card:hover img {
  opacity: 1;
}

.ig-parallax__cta {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem 3rem;
}

.ig-parallax__cta .btn {
  min-width: min(100%, 16rem);
}

.ig-parallax--static .ig-parallax__track {
  height: auto;
  padding: 0 1rem 1rem;
}

.ig-parallax--static .ig-parallax__sticky {
  position: relative;
  height: auto;
  padding: 0;
}

.ig-parallax--static .ig-parallax__banner {
  width: 100% !important;
  height: auto !important;
  max-width: 72rem;
  border-radius: 24px !important;
  border-width: 2px !important;
  margin-inline: auto;
}

.ig-parallax--static .ig-parallax__perspective {
  position: relative;
  perspective: none;
  pointer-events: auto;
}

.ig-parallax--static .ig-parallax__matrix {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100% !important;
  height: auto !important;
  padding: 1rem;
  transform: none !important;
}

.ig-parallax--static .ig-parallax__col {
  display: contents;
  transform: none !important;
}

.ig-parallax--static .ig-parallax__card {
  height: clamp(160px, 22vw, 280px);
}

.ig-parallax--static .ig-parallax__card[aria-hidden="true"] {
  display: none;
}

.ig-parallax--static .ig-parallax__vignette {
  display: none;
}

@media (max-width: 768px) {
  .ig-parallax--static .ig-parallax__matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .ig-parallax__track {
    height: 280vh;
  }

  .ig-parallax__col {
    min-width: 120px;
    width: 28vw;
  }

  .ig-parallax__card {
    height: clamp(140px, 22vh, 240px);
    border-radius: 10px;
  }

  .ig-parallax__vignette {
    box-shadow:
      inset 0 60px 80px -30px rgba(0, 0, 0, 0.95),
      inset 0 -60px 80px -30px rgba(0, 0, 0, 0.95),
      inset 40px 0 60px -20px rgba(0, 0, 0, 0.85),
      inset -40px 0 60px -20px rgba(0, 0, 0, 0.85);
  }

  .ig-parallax__matrix {
    gap: 0.6rem;
    width: 140vw;
  }
}

/* Reduced motion: JS adiciona .ig-parallax--static (não sobrescrever sticky aqui) */
