.gallery-section {
  padding: 4rem 2rem;
  background: var(--primary-3);
}

.gallery-grid {
  max-width: 87.5rem;
  margin: 0 auto;
  column-count: 4;
  column-gap: 1rem;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  transition: transform 0.3s ease;
}

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

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.5rem;
  transition: opacity 0.3s ease;
}

.gallery-item:hover img {
  opacity: 0.9;
}


.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.5rem;
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  background: var(--primary-1);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2001;
}

.lightbox-close:hover {
  background: var(--primary-3);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2001;
  transition: background 0.3s ease;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev {
  left: 2rem;
}

.lightbox-next {
  right: 2rem;
}

.lightbox-counter {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  background: rgba(0, 0, 0, 0.5);
  padding: 0.5rem 1rem;
  border-radius: 1.5rem;
}

@media (max-width: 1024px) {
  .gallery-section {
    padding: 3.5rem 1.5rem;
  }

  .gallery-grid {
    column-count: 3;
  }

  .lightbox-close {
    top: 1.5rem;
    right: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
  }

  .lightbox-prev {
    left: 1.5rem;
  }

  .lightbox-next {
    right: 1.5rem;
  }
}

@media (max-width: 900px) {
  .gallery-section {
    padding: 3.25rem 1.4rem;
  }

  .gallery-grid {
    column-count: 3;
  }

  .lightbox-close {
    top: 1.25rem;
    right: 1.25rem;
    width: 2.35rem;
    height: 2.35rem;
    font-size: 1.2rem;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 2.35rem;
    height: 2.35rem;
    font-size: 1.2rem;
  }

  .lightbox-prev {
    left: 1.25rem;
  }

  .lightbox-next {
    right: 1.25rem;
  }
}

@media (max-width: 768px) {
  .gallery-section {
    padding: 3rem 1.25rem;
  }

  .gallery-grid {
    column-count: 2;
  }

  .lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.125rem;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.125rem;
  }

  .lightbox-prev {
    left: 1rem;
  }

  .lightbox-next {
    right: 1rem;
  }
}

@media (max-width: 480px) {
  .gallery-section {
    padding: 2.5rem 1rem;
  }

  .gallery-grid {
    column-count: 2;
    column-gap: 0.75rem;
  }

  .gallery-item {
    margin-bottom: 0.75rem;
  }

  .gallery-item:hover {
    transform: none;
  }

  .gallery-item:hover {
    transform: none;
  }

  .lightbox-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }

  .lightbox-prev {
    left: 0.75rem;
  }

  .lightbox-next {
    right: 0.75rem;
  }

  .lightbox-counter {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
  }
}

@media (max-width: 400px) {
  .gallery-section {
    padding: 2rem 0.75rem;
  }
}

@media (max-width: 375px) {
  .gallery-section {
    padding: 2rem 0.625rem;
  }
}
