/* ==================== Gallery ==================== */


.gallery-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.1);
  padding: var(--spacing-sm) 0;
}

.gallery-nav__back {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xxs);
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
}

.gallery-nav__back:hover {
  color: var(--color-accent);
}


.gallery-section {
  padding: var(--spacing-xl) 0;
}

.gallery-header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.gallery-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--color-primary);
  margin-bottom: var(--spacing-xxs);
  font-family: 'Playfair Display', serif;
}

.gallery-header p {
  color: var(--color-text-light);
  font-size: 1rem;
  margin: 0;
}


.gallery-grid {
  column-count: 3;
  column-gap: var(--spacing-sm);
}

.gallery-item {
  position: relative;
  break-inside: avoid;
  margin-bottom: var(--spacing-sm);
  overflow: hidden;
  border-radius: 2px;
  cursor: pointer;
  background: var(--color-bg-alt);
}


.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.03);
}

.gallery-item__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: #fff;
  padding: var(--spacing-sm);
  font-size: 0.875rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item__caption {
  opacity: 1;
}


.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.95);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}


.lightbox__image {
  max-width: 90%;
  max-height: 90%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.25rem;
  transition: background 0.3s ease;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  background: rgba(255,255,255,0.2);
}

.lightbox__close {
  top: var(--spacing-md);
  right: var(--spacing-md);
}

.lightbox__prev {
  left: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__next {
  right: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__caption {
  position: absolute;
  bottom: var(--spacing-md);
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 1rem;
  text-align: center;
  max-width: 80%;
}


@media (max-width: 1023px) {
  .gallery-grid {
    column-count: 2;
  }
}

@media (max-width: 767px) {
  .gallery-grid {
    column-count: 2;
    column-gap: var(--spacing-xxs);
  }
  
  .gallery-item {
    margin-bottom: var(--spacing-xxs);
  }
  
  .lightbox__close,
  .lightbox__prev,
  .lightbox__next {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }
}