/* ==========================================================================
   Wedding Photo Gallery & Lightbox Styles
   ========================================================================== */

.gallery-section {
  padding: 6rem 0;
  background: #FAF8F5;
  position: relative;
}

/* Gallery Filter Tabs */
.gallery-filters {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: #FFFFFF;
  border: 1px solid rgba(197, 160, 89, 0.3);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.55rem 1.4rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.filter-btn:hover {
  border-color: var(--gold-primary);
  color: var(--text-main);
  transform: translateY(-2px);
}

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

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 260px;
  gap: 1.5rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  background: #EAE6DF;
  transition: var(--transition);
  border: 1px solid rgba(197, 160, 89, 0.2);
}

/* Dynamic tile spans for a trending editorial look */
.gallery-item.tall {
  grid-row: span 2;
}

.gallery-item.wide {
  grid-column: span 2;
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold-primary);
}

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

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

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(30, 27, 24, 0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  opacity: 0;
  transition: var(--transition);
}

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

.gallery-title {
  color: #FFFFFF;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin-bottom: 0.2rem;
  transform: translateY(10px);
  transition: var(--transition);
}

.gallery-caption {
  color: #E2DFD8;
  font-size: 0.85rem;
  transform: translateY(10px);
  transition: var(--transition);
  transition-delay: 0.05s;
}

.gallery-item:hover .gallery-title,
.gallery-item:hover .gallery-caption {
  transform: translateY(0);
}

.gallery-view-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 1.1rem;
  opacity: 0;
  transform: scale(0.8);
  transition: var(--transition);
}

.gallery-item:hover .gallery-view-icon {
  opacity: 1;
  transform: scale(1);
}

/* ==========================================================================
   Fullscreen Lightbox Modal
   ========================================================================== */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(14, 12, 11, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  padding: 1.5rem;
}

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

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

.lightbox-img-wrapper {
  max-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(197, 160, 89, 0.3);
  animation: fadeIn 0.3s ease-out;
}

.lightbox-info {
  margin-top: 1rem;
  text-align: center;
  color: #FAF8F5;
}

.lightbox-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin-bottom: 0.2rem;
  color: var(--gold-light);
}

.lightbox-caption {
  font-size: 0.9rem;
  color: #C8C2BC;
}

.lightbox-counter {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: #8E8781;
  margin-top: 0.4rem;
}

/* Lightbox Controls */
.lightbox-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.4rem;
  user-select: none;
}

.lightbox-btn:hover {
  background: var(--gold-primary);
  border-color: var(--gold-primary);
  transform: scale(1.1);
}

.lightbox-close {
  top: 2rem;
  right: 2rem;
}

.lightbox-prev {
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev:hover {
  transform: translateY(-50%) scale(1.1);
}

.lightbox-next:hover {
  transform: translateY(-50%) scale(1.1);
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-auto-rows: 220px;
  }

  .gallery-item.tall {
    grid-row: span 1;
  }

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

  .lightbox-prev {
    left: 0.5rem;
    width: 40px;
    height: 40px;
  }

  .lightbox-next {
    right: 0.5rem;
    width: 40px;
    height: 40px;
  }

  .lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
}
