/* =========================================
   Gallery Page — gallery.css
   Editorial scatter layout
   ========================================= */

/* Page base */
.gallery-body {
  background-color: var(--clr-subtle-beige);
  overflow-x: hidden;
}

/* Gallery page header / H1 */
.gallery-page__header {
  padding: var(--space-xl) var(--space-md) var(--space-lg);
  text-align: center;
}

.gallery-page__title {
  font-size: clamp(2rem, 5vw, 4rem);
  color: var(--clr-dark-olive);
  line-height: var(--lh-display);
}

.gallery-page__title em {
  font-style: italic;
  color: var(--clr-dark-olive);
}



/* =========================================
   Gallery — Editorial Scatter Layout
   ========================================= */

.gallery-page {
  padding-top: 90px;   /* clear fixed header */
  padding-bottom: 20vh;
  overflow-x: hidden;
}

/* Each "section" is either a solo or pair group */
.gallery-section {
  display: block;
}

/* Pair: two images side-by-side with flex */
.gallery-section--pair {
  display: flex;
  align-items: flex-start;
}

/* Individual image wrapper (sets width + vertical offset) */
.gallery-img-wrap {
  flex-shrink: 0;
  will-change: transform;
  overflow: hidden;
}

/* The image itself */
.gallery-img {
  display: block;
  width: 100%;
  height: auto;         /* preserve natural aspect ratio */
  cursor: pointer;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

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

/* Sentinel (infinite scroll trigger) */
.gallery-sentinel {
  height: 1px;
}

/* =========================================
   Lightbox
   ========================================= */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255, 243, 225, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}

.lightbox__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: calc(100vw - 160px);
  max-height: 88vh;
}

.lightbox__img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  display: block;
  transition: opacity 0.2s ease;
}

.lightbox__img.is-loading {
  opacity: 0;
}

.lightbox__close {
  position: fixed;
  top: 24px;
  right: 28px;
  background: none;
  border: none;
  color: var(--clr-dark-olive);
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 10;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition-fast);
  opacity: 0.6;
}

.lightbox__close:hover {
  background: rgba(34, 38, 14, 0.08);
  opacity: 1;
}

.lightbox__arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 1px solid rgba(34, 38, 14, 0.2);
  color: var(--clr-dark-olive);
  cursor: pointer;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform 0.2s ease;
  opacity: 0.6;
  z-index: 10;
}

.lightbox__arrow:hover {
  border-color: var(--clr-dark-olive);
  background: rgba(34, 38, 14, 0.06);
  opacity: 1;
  transform: translateY(-50%) scale(1.06);
}

.lightbox__prev { left: 24px; }
.lightbox__next { right: 24px; }

/* =========================================
   Mobile Responsive
   ========================================= */


@media (max-width: 767px) {
  .gallery-page {
    padding-top: 70px;
    padding-bottom: 12vh;
  }

  .gallery-section {
    margin-left: 0 !important;
    margin-bottom: 16px !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .gallery-img-wrap {
    width: 90vw !important;
    margin-top: 0 !important;
    transform: none !important;
  }

  .lightbox__stage {
    max-width: 100vw;
    padding: 0 8px;
  }

  .lightbox__prev { left: 8px; }
  .lightbox__next { right: 8px; }

  .lightbox__arrow {
    width: 40px;
    height: 40px;
  }
}
