/* ── Gallery Lightbox — full-screen with zoom/pan ─────────── */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(2, 1, 0, 0.97);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  overscroll-behavior: contain;
}

.lightbox-overlay--visible {
  opacity: 1;
  visibility: visible;
}

/* ── Stage: full-viewport, clips zoom overflow ─────────── */

.lightbox-overlay__stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ── Image ─────────────────────────────────────────────── */

.lightbox-overlay__img {
  max-width: 93vw;
  max-height: 93vh;
  object-fit: contain;
  display: block;
  border-radius: 6px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.85);
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  cursor: zoom-in;
  touch-action: none;
}

/* ── Controls bar (sibling of stage, overlaid) ─────────── */

.lightbox-overlay__controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
}

.lightbox-overlay__btn {
  pointer-events: auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 8, 6, 0.82);
  color: #fff3df;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-overlay__btn:hover {
  background: rgba(246, 90, 23, 0.28);
  border-color: rgba(246, 90, 23, 0.55);
  transform: scale(1.08);
}

.lightbox-overlay__btn:focus-visible {
  outline: 2px solid #f65a17;
  outline-offset: 3px;
}

.lightbox-overlay__btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

/* Close — top-right corner (absolute inside controls) */

.lightbox-overlay__btn--close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(246, 90, 23, 0.12);
  border-color: rgba(246, 90, 23, 0.35);
}

.lightbox-overlay__btn--close:hover {
  background: rgba(246, 90, 23, 0.4);
  border-color: rgba(246, 90, 23, 0.7);
  transform: scale(1.08);
}

.lightbox-overlay__btn--hidden {
  visibility: hidden;
  pointer-events: none;
}

/* ── Counter — top center ──────────────────────────────── */

.lightbox-overlay__counter {
  position: absolute;
  top: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  white-space: nowrap;
  z-index: 11;
  pointer-events: none;
  font-family: var(--font-primary, sans-serif);
}

/* ── Caption — bottom center ───────────────────────────── */

.lightbox-overlay__caption {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.32);
  font-size: 0.78rem;
  font-family: var(--font-primary, sans-serif);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70vw;
  z-index: 11;
  pointer-events: none;
}

/* ── Zoom hint — bottom, below caption ────────────────── */

.lightbox-zoom-hint {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.7rem;
  font-family: var(--font-primary, sans-serif);
  letter-spacing: 0.06em;
  white-space: nowrap;
  z-index: 11;
  pointer-events: none;
}

/* ── Trigger items (on-page thumbnails) ─────────────────── */

.lightbox-trigger {
  display: block;
  cursor: zoom-in;
  border: none;
  background: none;
  padding: 0;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.lightbox-trigger img {
  transition: transform 0.4s ease;
  width: 100%;
  display: block;
}

.lightbox-trigger:hover img {
  transform: scale(1.04);
}

.lightbox-trigger__hint {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.72);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.78rem;
  font-family: var(--font-primary, sans-serif);
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.22s ease;
}

.lightbox-trigger:hover .lightbox-trigger__hint {
  transform: translateY(0);
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 640px) {
  .lightbox-overlay__img {
    max-width: 98vw;
    max-height: 88vh;
    border-radius: 4px;
  }

  .lightbox-overlay__btn {
    width: 44px;
    height: 44px;
  }

  .lightbox-overlay__btn svg {
    width: 17px;
    height: 17px;
  }

  .lightbox-overlay__btn--close {
    top: 0.85rem;
    right: 0.85rem;
  }

  .lightbox-overlay__controls {
    padding: 0 0.6rem;
  }

  .lightbox-zoom-hint {
    display: none;
  }
}
