/* ── Gallery-specific styles ── */
/* Complements style.css – uses the same CSS custom properties */

/* Gallery header (compact hero) */
.gallery-header {
  position: relative;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.gallery-header .gallery-top-bar {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gallery-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.2s ease;
}

.gallery-back:hover {
  color: var(--primary);
}

.gallery-back svg {
  width: 16px;
  height: 16px;
}

.gallery-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.gallery-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  color: var(--text);
  text-align: center;
}

/* Filter bar */
.gallery-filters {
  width: 100%;
  max-width: 1200px;
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.gallery-filters::-webkit-scrollbar {
  display: none;
}

.gallery-filters .tab-btn {
  flex-shrink: 0;
  font-size: 0.8rem;
  padding: 0.55rem 1.1rem;
}

/* Gallery grid */
.gallery-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem 2rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.gallery-item {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  cursor: pointer;
  aspect-ratio: 4 / 3;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.gallery-item:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.15);
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

/* Video play overlay */
.gallery-item .video-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  pointer-events: none;
  transition: background 0.2s ease;
}

.gallery-item:hover .video-badge {
  background: rgba(0, 0, 0, 0.15);
}

.video-badge svg {
  width: 48px;
  height: 48px;
  fill: #fff;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

/* Load-more button */
.gallery-load-more {
  display: flex;
  justify-content: center;
  padding: 1rem 1.25rem 3rem;
}

.btn-load-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 2rem;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-load-more:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-load-more.hidden {
  display: none;
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img,
.lightbox-content video {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 0.75rem;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1010;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1010;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.lightbox-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.4);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
}

/* ── Responsive ── */
@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1rem 2rem 2rem;
  }

  .gallery-filters {
    justify-content: center;
    padding: 1rem 2rem;
  }

  .gallery-header {
    padding: 2rem 2rem 1.5rem;
  }

  .gallery-title {
    font-size: 1.6rem;
  }

  .gallery-item {
    border-radius: 1.2rem;
  }
}
