/* ═══════════════════════════════════════════════════════════════
   Instagram-style gallery — carousel + lightbox
   Scoped under .ig-gallery and .ig-lightbox so it doesn't leak.
═══════════════════════════════════════════════════════════════════ */

/* ── IG eyebrow link variant ──────────────────────────────── */
.section-label--ig {
  text-transform: none;
  letter-spacing: 0.02em;
  text-decoration: none;
  gap: 8px;
  transition: color 0.2s ease;
  cursor: pointer;
}
.section-label--ig::before { display: none; }
.section-label--ig:hover { color: var(--accent-hot); }
.section-label-ig-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── Touch defaults — let vertical scroll pass through ────── */
.ig-card-media,
.ig-lightbox-media video {
  touch-action: pan-y;
}

/* ── Carousel ─────────────────────────────────────────────── */
.ig-gallery {
  position: relative;
  max-width: 1100px;
  margin: 40px auto 0;
}

.ig-track {
  position: relative;
  height: 520px;
  margin: 0 auto;
  overflow: visible;
  perspective: 1200px;
}

.ig-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 280px;
  height: 373px;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transform: translate(-50%, -50%) scale(0.4);
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  transition:
    transform 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s ease;
}

.ig-card.is-active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
  z-index: 5;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
}

.ig-card.is-near-left {
  transform: translate(calc(-50% - 280px), -50%) scale(0.82);
  opacity: 1;
  pointer-events: auto;
  z-index: 4;
}

.ig-card.is-near-right {
  transform: translate(calc(-50% + 280px), -50%) scale(0.82);
  opacity: 1;
  pointer-events: auto;
  z-index: 4;
}

.ig-card.is-far-left {
  transform: translate(calc(-50% - 470px), -50%) scale(0.62);
  opacity: 0.45;
  pointer-events: auto;
  z-index: 3;
}

.ig-card.is-far-right {
  transform: translate(calc(-50% + 470px), -50%) scale(0.62);
  opacity: 0.45;
  pointer-events: auto;
  z-index: 3;
}

.ig-card-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ig-card-glyph {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  z-index: 2;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.ig-card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}
.ig-card-play svg {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.6));
  opacity: 0.92;
}

/* ── Nav arrows ───────────────────────────────────────────── */
.ig-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(12, 19, 24, 0.65);
  backdrop-filter: blur(8px);
  color: var(--white);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.ig-nav:hover {
  border-color: var(--accent-hot);
  color: var(--accent-hot);
}
.ig-nav--prev { left: 16px; }
.ig-nav--next { right: 16px; }

/* ── Dots ─────────────────────────────────────────────────── */
.ig-dots {
  display: flex;
  gap: 2px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}
/* Button is a 24x24 hit target (WCAG 2.5.8); the visible dot is the ::before. */
.ig-dot {
  width: 24px;
  height: 24px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ig-dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: background 0.2s ease, width 0.2s ease;
}
.ig-dot.is-active::before {
  background: var(--accent-hot);
  width: 22px;
  border-radius: 4px;
}

/* ── Lightbox ─────────────────────────────────────────────── */
.ig-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.ig-lightbox.is-open { display: flex; }

.ig-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(6px);
}

.ig-lightbox-content {
  position: relative;
  z-index: 2;
  width: min(92vw, 560px);
  max-height: 90vh;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.ig-lightbox-media {
  position: relative;
  width: 100%;
  background: #000;
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ig-lightbox-media img,
.ig-lightbox-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ig-lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(12, 19, 24, 0.75);
  color: var(--white);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.ig-lightbox-close:hover {
  background: var(--accent-hot);
  color: var(--bg);
}

.ig-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(12, 19, 24, 0.7);
  backdrop-filter: blur(8px);
  color: var(--white);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.ig-lightbox-nav:hover {
  border-color: var(--accent-hot);
  color: var(--accent-hot);
}
.ig-lightbox-nav--prev { left: max(16px, calc(50% - min(46vw, 280px) - 64px)); }
.ig-lightbox-nav--next { right: max(16px, calc(50% - min(46vw, 280px) - 64px)); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .ig-track { height: 480px; }
  .ig-card { width: 240px; height: 320px; }
  .ig-card.is-near-left { transform: translate(calc(-50% - 230px), -50%) scale(0.78); }
  .ig-card.is-near-right { transform: translate(calc(-50% + 230px), -50%) scale(0.78); }
  .ig-card.is-far-left,
  .ig-card.is-far-right {
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 600px) {
  .ig-gallery { margin-top: 28px; }
  .ig-track { height: 460px; }
  .ig-card { width: 80vw; max-width: 320px; height: calc(80vw * 1.33); max-height: 420px; }
  .ig-card.is-near-left,
  .ig-card.is-near-right,
  .ig-card.is-far-left,
  .ig-card.is-far-right {
    opacity: 0;
    pointer-events: none;
  }
  .ig-card-play svg { width: 48px; height: 48px; }
  .ig-nav { width: 38px; height: 38px; }
  .ig-nav--prev { left: 8px; }
  .ig-nav--next { right: 8px; }
  .ig-lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  .ig-lightbox-nav--prev { left: 8px; }
  .ig-lightbox-nav--next { right: 8px; }
}
