/* ============================================
   GALLERY PAGE — /gallery/
   ============================================ */

main { padding-top: 70px; }

.gallery-page {
  padding: 80px 80px 100px;
  min-height: 100vh;
}

.gallery-page-header {
  text-align: center;
  margin-bottom: 64px;
}

.gallery-page-sub {
  font-size: 14px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 300;
  margin-top: 14px;
}

/* ── Masonry Grid ── */
.gallery-masonry {
  columns: 3;
  column-gap: 12px;
}

.gallery-tile {
  position: relative;
  break-inside: avoid;
  margin-bottom: 12px;
  overflow: hidden;
  cursor: pointer;
  border-radius: 4px;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.gallery-tile.visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-tile img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.45s ease;
}

.gallery-tile:hover img {
  transform: scale(1.04);
}

.gallery-tile-overlay {
  position: absolute;
  inset: 0;
  background: rgba(174, 0, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-tile:hover .gallery-tile-overlay {
  opacity: 1;
}

.gallery-book-cta {
  text-align: center;
  margin-top: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.gallery-book-cta p {
  font-size: 18px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 300;
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 9, 0.94);
  z-index: 0;
}

.lightbox-img-wrap {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img-wrap img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  display: block;
  touch-action: pinch-zoom;
  transition: opacity 0.2s ease;
}

.lightbox-img-wrap img.fading { opacity: 0; }

.lightbox-close {
  position: absolute;
  top: 24px; right: 36px;
  z-index: 2;
  font-size: 44px;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}
.lightbox-close:hover { color: var(--white); }

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  z-index: 2;
  color: var(--white);
  background: rgba(9, 9, 9, 0.75);
  border: 1px solid rgba(245, 243, 238, 0.25);
  width: 64px; height: 64px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  user-select: none;
}
.lightbox-prev { left: 36px; }
.lightbox-next { right: 36px; }
.lightbox-prev:hover,
.lightbox-next:hover {
  border-color: var(--purple);
  background: rgba(174, 0, 255, 0.25);
  box-shadow: 0 0 24px rgba(174, 0, 255, 0.4);
  transform: translateY(-50%) scale(1.08);
}

.lightbox-counter {
  position: absolute;
  bottom: 28px;
  left: 50%; transform: translateX(-50%);
  z-index: 2;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 300;
  white-space: nowrap;
}

/* ============================================
   MOBILE — Gallery Page
   ============================================ */
@media (max-width: 768px) {

  .gallery-page { padding: 60px 16px 80px; }

  .gallery-page-header { margin-bottom: 40px; }

  /* 2 columns on mobile */
  .gallery-masonry {
    columns: 2;
    column-gap: 8px;
  }
  .gallery-tile { margin-bottom: 8px; }

  .gallery-book-cta { margin-top: 48px; }

  /* Lightbox */
  .lightbox-prev { left: 12px; width: 48px; height: 48px; }
  .lightbox-next { right: 12px; width: 48px; height: 48px; }
  .lightbox-counter { font-size: 11px; bottom: 16px; }
}
