.image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  width: 100%;
  max-width: 1800px;
  padding: 0 4rem;
  box-sizing: border-box;
  margin: 0 auto;
}

.image-grid img {
  width: 100%;
  height: 40vh;
  object-fit: cover;
  border-radius: 1rem;
  display: block;
  cursor: pointer;
}

#gallery h2,
#gallery p {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

#gallery p {
  max-width: 600px;
}

#gallery h2 {
  margin-top: 8rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 1rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.lightbox-close {
  position: fixed;
  top: 24px;
  right: 28px;
  border: none;
  background: transparent;
  color: white;
  font-size: 3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  z-index: 10001;
}

.lightbox-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 64px;
  height: 64px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: white;
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-arrow:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: translateY(-50%) scale(1.05);
}

.lightbox-arrow.left {
  left: 24px;
}

.lightbox-arrow.right {
  right: 24px;
}

@media (max-width: 768px) {
  .lightbox-arrow {
    width: 48px;
    height: 48px;
    font-size: 2rem;
  }

  .lightbox-arrow.left {
    left: 12px;
  }

  .lightbox-arrow.right {
    right: 12px;
  }

  .lightbox-close {
    top: 12px;
    right: 16px;
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .image-grid {
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }

  .image-grid img {
    margin-bottom: 1rem;
  }

  .lightbox-close {
    top: 0.75rem;
    right: 1rem;
    font-size: 2.5rem;
  }
}
