/* ============================================================
   VĚČNÉ MOMENTY — Gallery Page
   ============================================================ */

/* ── Page header ──────────────────────────────────────────── */

.gallery-page-hero {
  padding: calc(var(--nav-h) + 4rem) 1.5rem 4rem;
  background: var(--dark);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.gallery-page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../images/background3.jpg');
  background-size: cover;
  background-position: center 30%;
  opacity: 0.18;
}

.gallery-page-hero .section-label,
.gallery-page-hero .section-title {
  position: relative;
  z-index: 1;
}

.gallery-page-hero .section-label { color: var(--gold-lt); }

.gallery-page-hero .section-title {
  color: #f4ece0;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  margin-bottom: 0;
}

/* ── Filter tabs ──────────────────────────────────────────── */

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  padding: 3rem 1.5rem 2rem;
  background: var(--bg);
  position: sticky;
  top: var(--nav-h);
  z-index: 100;
  border-bottom: 1px solid rgba(155,122,74,0.15);
}

.filter-btn {
  padding: 0.5em 1.4em;
  border: 1px solid rgba(155,122,74,0.3);
  border-radius: 100px;
  background: transparent;
  color: var(--muted);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s;
}

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

.filter-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

/* ── Masonry grid ─────────────────────────────────────────── */

.gallery-grid-section {
  background: var(--bg);
  padding: 2.5rem 1.5rem 5rem;
}

.masonry-grid {
  columns: 3;
  column-gap: 12px;
  max-width: 1400px;
  margin: 0 auto;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border-radius: 3px;
  /* hide filtered items */
}

.masonry-item.hidden {
  display: none;
}

.masonry-item img {
  width: 100%;
  display: block;
  transition: transform 0.5s ease;
  border-radius: 3px;
}

.masonry-overlay {
  position: absolute;
  inset: 0;
  background: rgba(44, 30, 18, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.35s ease;
  border-radius: 3px;
}

.masonry-overlay i {
  color: #f4ece0;
  font-size: 1.5rem;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.3s, transform 0.3s;
}

.masonry-item:hover img { transform: scale(1.04); }
.masonry-item:hover .masonry-overlay { background: rgba(44, 30, 18, 0.45); }
.masonry-item:hover .masonry-overlay i { opacity: 1; transform: scale(1); }

/* Empty state */
.gallery-empty {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  display: none;
}

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

/* ── Lightbox ─────────────────────────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(20, 12, 6, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: background 0.35s;
}

.lightbox.open {
  background: rgba(20, 12, 6, 0.95);
  pointer-events: auto;
}

.lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.35s, transform 0.35s;
}

.lightbox.open .lightbox-inner {
  opacity: 1;
  transform: scale(1);
}

.lightbox-img {
  display: block;
  max-width: 88vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}

.lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px; height: 44px;
  border: 1.5px solid rgba(244,236,224,0.3);
  border-radius: 50%;
  background: transparent;
  color: rgba(244,236,224,0.7);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s, opacity 0.35s;
  z-index: 9001;
  opacity: 0;
  pointer-events: none;
}

.lightbox.open .lightbox-close { opacity: 1; pointer-events: auto; }
.lightbox-close:hover { border-color: #f4ece0; color: #f4ece0; }

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 52px;
  border: 1.5px solid rgba(244,236,224,0.25);
  border-radius: 50%;
  background: transparent;
  color: rgba(244,236,224,0.7);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s, opacity 0.35s;
  z-index: 9001;
  opacity: 0;
  pointer-events: none;
}

.lightbox.open .lightbox-prev,
.lightbox.open .lightbox-next { opacity: 1; pointer-events: auto; }

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

.lightbox-prev:hover,
.lightbox-next:hover {
  border-color: var(--gold-lt);
  color: var(--gold-lt);
}

.lightbox-counter {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: rgba(244,236,224,0.4);
  z-index: 9001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}

.lightbox.open .lightbox-counter { opacity: 1; }

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 1024px) {
  .masonry-grid { columns: 2; }
  .lightbox-prev { left: 0.75rem; }
  .lightbox-next { right: 0.75rem; }
}

@media (max-width: 560px) {
  .masonry-grid { columns: 1; }
  .gallery-filters { padding: 2rem 1rem 1.5rem; top: 0; position: static; }
  .lightbox-prev,
  .lightbox-next { display: none; }
}
