/* ============================================================
   SHOWCASE GALLERY — large main image + arrow nav + thumbnail strip
   ============================================================ */

.showcase-gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  user-select: none;
}

/* ── Main stage ── */
.showcase-gallery__main {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.showcase-gallery__stage {
  flex: 1;
  min-width: 0;
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--color-primary-dark);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.showcase-gallery__stage-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--space-3);
  /* crossfade */
  opacity: 1;
  transition: opacity 0.3s ease;
}

.showcase-gallery__stage-img.gl-fade {
  opacity: 0;
}

.showcase-gallery__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-3) var(--space-5);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: rgba(255, 255, 255, 0.92);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ── Arrows ── */
.showcase-gallery__arrow {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  font-size: var(--text-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
  z-index: 1;
}

.showcase-gallery__arrow:hover {
  background: var(--color-secondary);
  color: var(--color-white);
  border-color: var(--color-secondary);
  transform: scale(1.08);
}

.showcase-gallery__arrow:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

/* ── Thumbnail strip ── */
.showcase-gallery__thumbs {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-block: var(--space-1);
  /* offset left/right to visually align with the stage, not the arrows
     arrow width (48px) + gap (--space-3 = 0.75rem ≈ 12px) = 60px */
  padding-inline: calc(48px + var(--space-3));
  justify-content: center;
  /* hide scrollbar — visual only, accessible via keyboard */
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.showcase-gallery__thumbs::-webkit-scrollbar {
  height: 4px;
}

.showcase-gallery__thumbs::-webkit-scrollbar-track {
  background: transparent;
}

.showcase-gallery__thumbs::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

.showcase-gallery__thumb {
  flex: 0 0 auto;
  width: 96px;
  height: 64px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--color-primary-dark);
  transition: border-color var(--transition-fast), opacity var(--transition-fast), transform var(--transition-fast);
  padding: 0;
  opacity: 0.55;
}

.showcase-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.showcase-gallery__thumb:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

.showcase-gallery__thumb.active {
  border-color: var(--color-secondary);
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46,155,95,0.30);
}

.showcase-gallery__thumb:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

/* ── Stage cursor: hint that it's clickable ── */
.showcase-gallery__stage {
  cursor: zoom-in;
}

/* ── Lightbox overlay ── */
.gl-lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0, 0, 0, 0.93);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.gl-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.gl-lightbox__img {
  max-width: min(92vw, 1400px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  display: block;
  /* crossfade on nav */
  opacity: 1;
  transition: opacity 0.18s ease;
}

.gl-lightbox__img.gl-fade {
  opacity: 0;
}

.gl-lightbox__caption {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80vw;
  color: rgba(255, 255, 255, 0.75);
  font-size: var(--text-sm);
  text-align: center;
}

.gl-lightbox__close {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--color-white);
  font-size: var(--text-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.gl-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: scale(1.1);
}

.gl-lightbox__close:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

.gl-lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--color-white);
  font-size: var(--text-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.gl-lightbox__arrow--prev { left:  var(--space-5); }
.gl-lightbox__arrow--next { right: var(--space-5); }

.gl-lightbox__arrow:hover {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  transform: translateY(-50%) scale(1.08);
}

.gl-lightbox__arrow:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

/* ── Responsive: smaller arrows on mobile ── */
@media (max-width: 480px) {
  .showcase-gallery__arrow {
    width: 36px;
    height: 36px;
    font-size: var(--text-base);
  }

  .showcase-gallery__thumb {
    width: 72px;
    height: 48px;
  }

  .gl-lightbox__arrow {
    width: 38px;
    height: 38px;
    font-size: var(--text-base);
  }

  .gl-lightbox__arrow--prev { left:  var(--space-3); }
  .gl-lightbox__arrow--next { right: var(--space-3); }
}
