.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.gallery-mount__grids {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .gallery-mount__grids {
    gap: 0.75rem;
  }
}

@media (min-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }

  .gallery-mount__grids {
    gap: 1rem;
  }
}

.gallery-item {
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}

.gallery-item--quer {
  aspect-ratio: 5 / 4;
}

.gallery-item--hoch {
  aspect-ratio: 4 / 5;
}

.gallery-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  pointer-events: none;
  z-index: 1;
}

.gallery-item:hover::before,
.gallery-item:focus-visible::before {
  opacity: 0.35;
}

.gallery-item:focus-visible {
  outline: 2px solid #6592e6;
  outline-offset: 2px;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.gallery-item--quer img,
.gallery-item--hoch img {
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.gallery-item__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 2rem;
  line-height: 44px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
  pointer-events: none;
}

.gallery-item:hover .gallery-item__icon,
.gallery-item:focus-visible .gallery-item__icon {
  opacity: 1;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
}

.lightbox[hidden] {
  display: none;
}

.lightbox__dialog {
  position: relative;
  width: min(96vw, 1200px);
  max-height: 96vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__image {
  max-width: 100%;
  max-height: 96vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  border: 0;
  background: #1b1b1b;
  color: #fff;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.75rem 1rem;
  transition: background 0.2s;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover,
.lightbox__close:focus-visible,
.lightbox__prev:focus-visible,
.lightbox__next:focus-visible {
  background: #333;
}

.lightbox__close {
  top: 1rem;
  right: 1rem;
  z-index: 2;
}

.lightbox__prev {
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__next {
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.95rem;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
}
