/* ============================================================
   GALLERY SECTION
   ============================================================ */

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

/* Every 7th item spans 2 columns for visual variety */
.gallery__item:nth-child(7n+1) {
  grid-column: span 2;
}

.gallery__item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  aspect-ratio: 1;
  cursor: pointer;
  background-color: var(--color-gray-200);
}

.gallery__item:nth-child(7n+1) {
  aspect-ratio: 2 / 1;
}

.gallery__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery__item:hover .gallery__img {
  transform: scale(1.06);
}

/* Hover overlay */
.gallery__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(53, 91, 52, 0.70) 0%,
    rgba(53, 91, 52, 0.10) 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  padding: var(--space-4);
}

.gallery__item:hover .gallery__overlay {
  opacity: 1;
}

.gallery__overlay-icon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.20);
  border: 1.5px solid rgba(255,255,255,0.50);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  backdrop-filter: blur(4px);
}

.gallery__overlay-icon svg {
  width: 16px;
  height: 16px;
  color: var(--color-white);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lightbox__inner {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.lightbox__img-wrap {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.60);
}

.lightbox__img {
  display: block;
  max-width: 80vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-xl);
  transition: opacity 0.2s ease;
}

.lightbox__img.loading {
  opacity: 0;
}

/* Navigation buttons */
.lightbox__btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}

.lightbox__btn:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.08);
}

.lightbox__btn svg {
  width: 22px;
  height: 22px;
  color: var(--color-white);
}

/* Close button */
.lightbox__close {
  position: absolute;
  top: -16px;
  right: -16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.30);
}

.lightbox__close:hover {
  transform: scale(1.1);
  background: var(--color-gray-100);
}

.lightbox__close svg {
  width: 18px;
  height: 18px;
  color: var(--color-black);
}

/* Counter */
.lightbox__counter {
  position: absolute;
  bottom: -36px;
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,0.60);
  white-space: nowrap;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 960px) {
  .gallery__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }

  .gallery__item {
    border-radius: var(--radius-lg);
  }

  .gallery__item:nth-child(7n+1) {
    grid-column: span 2;
    aspect-ratio: 2 / 1;
  }

  .lightbox__inner {
    gap: var(--space-2);
  }

  .lightbox__img {
    max-width: 95vw;
    border-radius: var(--radius-lg);
  }

  .lightbox__btn {
    width: 40px;
    height: 40px;
  }
}
