/* ==========================================================================
   R9 CONVENTION — GALLERY & LIGHTBOX STYLES
   ========================================================================== */

/* Filter Controls */
.gallery-filters {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.gallery-filter-btn {
  padding: 0.6rem 1.35rem;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dark-secondary);
  background: var(--bg-white);
  border: 1px solid var(--border-light-subtle);
  border-radius: var(--radius-pill);
  transition: all var(--transition-smooth);
}

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

.gallery-filter-btn.active {
  background: var(--gold-gradient);
  color: #0b0d10;
  border-color: transparent;
  box-shadow: var(--shadow-gold);
}

/* Gallery Masonry & Grid */
.gallery-masonry {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--bg-dark-800);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light-subtle);
  aspect-ratio: 4/3;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), opacity var(--transition-smooth);
}

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

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-luxury);
  border-color: var(--border-gold-subtle);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-luxury);
}

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

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 11, 14, 0.2) 0%, rgba(9, 11, 14, 0.85) 100%);
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  transition: opacity var(--transition-smooth);
}

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

.gallery-item-title {
  color: #ffffff;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.gallery-item-category {
  color: var(--gold-400);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 10, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
}

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

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

.lightbox-image-container {
  position: relative;
  max-width: 100%;
  max-height: 75vh;
  overflow: hidden;
  border-radius: var(--radius-xs);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(197, 160, 89, 0.25);
}

.lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  display: block;
  object-fit: contain;
}

.lightbox-caption-bar {
  margin-top: 1rem;
  text-align: center;
  color: #ffffff;
}

.lightbox-caption-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--gold-300);
  margin-bottom: 0.25rem;
}

.lightbox-caption-cat {
  font-size: 0.8rem;
  color: var(--text-light-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Lightbox Controls */
.lightbox-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all var(--transition-fast);
  z-index: 2010;
}

.lightbox-close-btn:hover {
  background: var(--gold-500);
  color: #0b0d10;
  transform: rotate(90deg);
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all var(--transition-fast);
  z-index: 2010;
}

.lightbox-prev-btn {
  left: 2rem;
}

.lightbox-next-btn {
  right: 2rem;
}

.lightbox-nav-btn:hover {
  background: var(--gold-500);
  color: #0b0d10;
  border-color: var(--gold-500);
}

.lightbox-nav-btn svg,
.lightbox-close-btn svg {
  width: 24px;
  height: 24px;
}

/* Responsive Gallery */
@media (max-width: 991px) {
  .gallery-masonry {
    grid-template-columns: repeat(2, 1fr);
  }

  .lightbox-nav-btn {
    width: 42px;
    height: 42px;
  }

  .lightbox-prev-btn {
    left: 0.75rem;
  }

  .lightbox-next-btn {
    right: 0.75rem;
  }
}

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

  .lightbox-close-btn {
    top: 1rem;
    right: 1rem;
  }
}
