/* ══════════════════════════════════
   GALLERY PAGE STYLES
══════════════════════════════════ */

/* ── Hero tweak for Gallery ── */
.gallery-hero { }
.gallery-hero .hero-content h1 { font-size: 72px; }

/* ── Gallery section ── */
.gallery-section {
  max-width: 1480px;
  margin: 80px auto;
  padding: 0 20px;
}

/* ── Filter tabs ── */
/* Hidden for now (not removed) — gallery.js still builds the pills into the
   DOM as normal, this just keeps them off-screen. Delete this rule to bring
   them back. */
.gallery-filters {
  display: none;
  justify-content: center;
  gap: 10px;
  padding: 56px 0 48px;
  flex-wrap: wrap;
}
.gallery-filter-btn {
  font-family: 'Poppins', sans-serif;
  font-weight: 600; font-size: 13px;
  color: #777; background: #EFEFED;
  border: none; border-radius: 60px;
  padding: 10px 24px; cursor: pointer;
  transition: background .2s, color .2s;
}
.gallery-filter-btn.active,
.gallery-filter-btn:hover { background: var(--brand); color: #fff; }

/* ── Grid — one uniform tile per gallery, strict 3 columns on desktop ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: 1fr; }
}
.gallery-item {
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: #e8e7e5;
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .4s ease;
}
.gallery-item:hover img { transform: scale(1.04); }

.gallery-item-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0);
  display: flex; align-items: flex-end;
  padding: 20px;
  transition: background .3s;
}
.gallery-item:hover .gallery-item-overlay { background: rgba(0,0,0,0.35); }

.gallery-item-count {
  position: absolute; top: 12px; right: 12px;
  background: rgba(0,0,0,.55); color: #fff;
  font-family: 'Poppins', sans-serif; font-size: 11px; font-weight: 600;
  padding: 5px 10px; border-radius: 20px;
  backdrop-filter: blur(4px);
}

.gallery-item-label {
  font-family: 'Mona Sans Wide', sans-serif;
  font-weight: 900; font-size: 14px; color: #fff;
  opacity: 0; transform: translateY(8px);
  transition: opacity .3s, transform .3s;
}
.gallery-item:hover .gallery-item-label { opacity: 1; transform: translateY(0); }

/* ── Empty state (no galleries curated yet) ── */
.gallery-empty {
  text-align: center;
  padding: 60px 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: #999;
}

/* ── Lightbox ── */
.gallery-lightbox {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  transition: background .4s;
}
.gallery-lightbox.open {
  background: rgba(0,0,0,0.92);
  pointer-events: auto;
}
.gallery-lightbox-imgwrap {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.gallery-lightbox img {
  max-width: 90vw; max-height: 82vh;
  border-radius: 12px; object-fit: contain;
  opacity: 0; transform: scale(0.95);
  transition: opacity .35s, transform .35s;
}
.gallery-lightbox.open img { opacity: 1; transform: scale(1); }
.gallery-lightbox-counter {
  font-family: 'Poppins', sans-serif; font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,.6); letter-spacing: .04em;
}

/* BUG FIX: the close/nav buttons had no visibility gating at all, so they
   rendered at full opacity all the time — the lightbox container itself
   stays display:flex permanently (only its background/pointer-events were
   gated by .open), and only the <img> above had its own opacity transition.
   These now fade in/out in sync with the lightbox itself. */
.gallery-lightbox-close,
.gallery-lightbox-nav {
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, background .2s;
}
.gallery-lightbox.open .gallery-lightbox-close,
.gallery-lightbox.open .gallery-lightbox-nav {
  opacity: 1;
  pointer-events: auto;
}

.gallery-lightbox-close {
  position: absolute; top: 28px; right: 36px;
  background: rgba(255,255,255,.12); border: none;
  color: #fff; font-size: 32px; line-height: 1;
  width: 48px; height: 48px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center;
}
.gallery-lightbox-close:hover { background: var(--brand); }

.gallery-lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.1); border: none;
  color: #fff; width: 52px; height: 52px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center;
}
.gallery-lightbox-nav:hover { background: rgba(255,255,255,.22); }
.gallery-lb-prev { left: 28px; }
.gallery-lb-next { right: 28px; }

/* ── Dark mode ── */
[data-theme="dark"] .gallery-filter-btn       { background: #1a1a1a; color: #666; }
[data-theme="dark"] .gallery-filter-btn.active,
[data-theme="dark"] .gallery-filter-btn:hover { background: var(--brand); color: #fff; }
[data-theme="dark"] .gallery-item             { background: #1a1a1a; }
[data-theme="dark"] .gallery-empty            { color: #666; }
