.homepage-gallery h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.homepage-gallery a {
  display: block;
  overflow: hidden;
  border-radius: 0.375rem;
  aspect-ratio: 4 / 3;
}

.homepage-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.homepage-gallery a:hover img,
.homepage-gallery a:focus-visible img {
  transform: scale(1.05);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 26, 32, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

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

.lightbox img {
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 6rem);
  border-radius: 0.25rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  user-select: none;
}

.lightbox button {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}

.lightbox button:hover,
.lightbox button:focus-visible {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
}

.lightbox-prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-counter {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
}

@media (max-width: 639px) {
  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: 0.75rem;
    transform: none;
  }
}
