/* ============================================
   BESPOKE SPIRE — Gallery Page Styles
   ============================================ */

/* ── Page Hero (shared) ─────────────────────── */
.page-hero {
  position: relative;
  height: 70vh;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  padding-bottom: 80px;
  overflow: hidden;
}
.page-hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
}
.page-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,8,5,0.75) 0%, rgba(10,8,5,0.3) 55%, rgba(10,8,5,0.15) 100%);
}
.page-hero-content { position: relative; z-index: 2; padding: 0 6%; }
.page-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 300; color: var(--white);
  line-height: 1.1; margin: 14px 0 10px;
}
.page-hero-title em { font-style: italic; color: var(--gold-light); }
.page-hero-sub {
  font-size: 0.72rem; font-weight: 400;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}
.page-hero-scroll { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 2; }
.page-hero-scroll .scroll-line {
  width: 1px; height: 60px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent);
}

/* ── Gallery Section ────────────────────────── */
.gallery-section { padding: 80px 0 100px; }

.gallery-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 60px;
  flex-wrap: wrap;
}

.gallery-intro { max-width: 480px; }
.gallery-intro .body-text { max-width: 100%; }

/* ── Filters ────────────────────────────────── */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.gfilter {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-light);
  background: transparent;
  border: 1px solid var(--cream-deep);
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.28s ease;
}

.gfilter:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.gfilter.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--white);
}

/* ── Gallery Grid ───────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 320px;
  gap: 4px;
}

.g-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--cream-deep);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.g-item.g-wide  { grid-column: span 2; }
.g-item.g-tall  { grid-row: span 2; }

.g-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

.g-item:hover img { transform: scale(1.06); }

/* overlay */
.g-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,8,5,0.75) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.35s ease;
  display: flex;
  align-items: flex-end;
}

.g-item:hover .g-overlay { opacity: 1; }

.g-overlay-inner {
  padding: 24px 28px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.g-cat {
  display: block;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 5px;
}

.g-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--white);
  line-height: 1.2;
}

.g-view-btn {
  width: 40px; height: 40px;
  border: 1px solid rgba(255,255,255,0.5);
  background: transparent;
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.g-view-btn svg { width: 16px; height: 16px; }

.g-view-btn:hover {
  background: var(--gold);
  border-color: var(--gold);
}

/* hidden items (filtered out) */
.g-item.hidden {
  display: none;
}

/* when filtering by category, use uniform grid (no spanning) */
.gallery-grid.is-filtered .g-item {
  grid-column: span 1 !important;
  grid-row: span 1 !important;
}

/* ── Gallery Empty ──────────────────────────── */
.gallery-empty {
  display: none;
  text-align: center;
  padding: 80px 20px;
}

.gallery-empty.visible { display: block; }

.gallery-empty p {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--ink-light);
}

/* ── Gallery CTA ────────────────────────────── */
.gallery-cta {
  text-align: center;
  margin-top: 72px;
  padding-top: 72px;
  border-top: 1px solid var(--cream-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.gallery-cta p {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--ink-light);
}

/* ── Lightbox ───────────────────────────────── */
.lightbox-overlay {
  position: fixed; inset: 0;
  background: rgba(5,4,3,0.92);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

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

.lightbox {
  position: fixed; inset: 0;
  z-index: 2001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.lightbox[hidden] { display: none; }

.lb-content {
  display: flex;
  flex-direction: column;
  max-width: 1100px;
  width: 100%;
  max-height: 90vh;
}

.lb-img-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lb-img-wrap img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  display: block;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lb-img-wrap img.loaded { opacity: 1; }

.lb-caption {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0 0;
  flex-wrap: wrap;
}

.lb-cat {
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.lb-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--white);
  font-weight: 400;
}

.lb-loc {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.1em;
}

.lb-counter {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.1em;
  margin-left: auto;
}

/* nav buttons */
.lb-close, .lb-prev, .lb-next {
  position: fixed;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--white);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s ease;
}

.lb-close {
  top: 28px; right: 28px;
  width: 48px; height: 48px;
  z-index: 2002;
}

.lb-prev {
  left: 20px; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px;
}

.lb-next {
  right: 20px; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px;
}

.lb-close svg, .lb-prev svg, .lb-next svg { width: 20px; height: 20px; }

.lb-close:hover, .lb-prev:hover, .lb-next:hover {
  background: var(--gold);
  border-color: var(--gold);
}

/* ── Intro band override for gallery ───────── */
.intro-band .intro-band-inner {
  justify-content: space-between;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 900px) {
  .gallery-top { flex-direction: column; align-items: flex-start; }
  .gallery-filters { justify-content: flex-start; }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 260px;
  }

  .g-item.g-wide { grid-column: span 2; }
  .g-item.g-tall { grid-row: span 1; }

  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 280px;
  }

  .g-item.g-wide { grid-column: span 1; }

  .gallery-section { padding: 56px 0 72px; }

  .lb-content { padding: 0 8px; }
  .lb-close { top: 16px; right: 16px; }
}
