/* Shoot photo wall lightbox: full-screen popup for the 5x3 grid on shoot
   pages. The clicked tile "grows out of the grid": a ghost copy of the
   thumbnail flies from the tile to center (and back on close). Arrows,
   counter, caption. Without JS the grid links open the full image. */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 6, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 0.32s ease;
}
.lightbox.is-open { opacity: 1; }
/* While the ghost flies home: backdrop fades out with the blur dropped
   (animating a full-viewport backdrop-filter competes with the flight). */
.lightbox.is-closing {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgba(5, 5, 6, 0);
  transition: opacity 0.3s ease;
}
.lightbox[hidden] { display: none; }

.lightbox figure {
  position: relative; /* above the ambient backdrop */
  z-index: 1;
  margin: 0;
  max-width: min(1200px, calc(100vw - 7rem));
  max-height: calc(100vh - 8rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 11rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.65);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.lightbox img.is-loaded { opacity: 1; }

/* Caption + controls settle in AFTER the photo lands (bidocean-style beat:
   the object arrives first, then its content settles into place). */
.lightbox figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  color: var(--wp--preset--color--muted, #A1A1A6);
  font-size: var(--wp--preset--font-size--sm, 0.9375rem);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}
.lightbox.is-settled figcaption {
  opacity: 1;
  transform: translateY(0);
}

/* The flying copy of the thumbnail: starts exactly on the grid tile,
   animates to the final center rect (and vice versa on close). */
/* Open flight: power3-out (0.48s). Return flight overrides to the snappier
   power3-in-out (0.34s), matching bidocean's open/close split. */
.lightbox-ghost {
  position: fixed;
  z-index: 10000;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  will-change: transform, opacity;
  transition: transform 0.48s cubic-bezier(0.215, 0.61, 0.355, 1), opacity 0.48s ease;
}
.lightbox-ghost.is-returning {
  transition-duration: 0.34s;
  transition-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
}

.lightbox-btn {
  position: fixed;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--wp--preset--color--line, #262628);
  border-radius: 999px;
  background: rgba(22, 22, 23, 0.72);
  color: var(--wp--preset--color--ink, #F5F5F7);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s ease 0.18s, background 0.2s ease, transform 0.2s ease;
}
.lightbox.is-settled .lightbox-btn { opacity: 1; }
.lightbox-btn:hover { background: rgba(40, 40, 42, 0.9); transform: scale(1.06); }
.lightbox-btn:focus-visible { outline: 2px solid var(--wp--preset--color--accent, #D8C39A); outline-offset: 2px; }

.lightbox-close { top: 1.25rem; right: 1.25rem; font-size: 1.5rem; }
.lightbox-prev { left: 1.25rem; top: 50%; translate: 0 -50%; }
.lightbox-next { right: 1.25rem; top: 50%; translate: 0 -50%; }

@media (max-width: 700px) {
  .lightbox figure { max-width: calc(100vw - 5.5rem); }
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightbox img, .lightbox-ghost, .lightbox figcaption, .lightbox-btn { transition: none; }
}
