/* Gallery Grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-sm);
}

.gallery__item {
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.gallery__item img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery__item:hover img {
  transform: scale(1.05);
}

/* Featured/Hero image */
.gallery__featured {
  grid-column: 1 / -1;
}

.gallery__featured img {
  aspect-ratio: 16 / 9;
  max-height: 60vh;
  width: 100%;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--color-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

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

.lightbox__content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}

.lightbox__close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  color: var(--color-white);
  font-size: 2rem;
  z-index: 201;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition-fast);
}

.lightbox__close:hover {
  opacity: 0.7;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-white);
  font-size: 3rem;
  z-index: 201;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition-fast);
}

.lightbox__nav:hover {
  opacity: 0.7;
}

.lightbox__prev {
  left: var(--space-md);
}

.lightbox__next {
  right: var(--space-md);
}

.lightbox__counter {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-white);
  font-size: var(--fs-sm);
  z-index: 201;
}

@media (max-width: 767px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .lightbox__nav {
    font-size: 2rem;
    width: 44px;
    height: 44px;
  }
}
