.lv-lightbox-gallery {
  --lv-lg-gap: 18px;
  --lv-lg-thumb-height: 260px;
  display: grid;
  gap: var(--lv-lg-gap);
  margin: 32px 0;
}

.lv-lightbox-gallery--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lv-lightbox-gallery--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lv-lightbox-gallery--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lv-lightbox-gallery--cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.lv-lightbox-gallery--layout-masonry {
  grid-auto-rows: 8px;
  align-items: start;
}

.lv-lightbox-gallery__item {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}

.lv-lightbox-gallery__img {
  display: block;
  width: 100%;
  height: var(--lv-lg-thumb-height);
  transition: transform .35s ease, opacity .35s ease;
}

.lv-lightbox-gallery--fit-cover .lv-lightbox-gallery__img {
  object-fit: cover;
}

.lv-lightbox-gallery--fit-contain .lv-lightbox-gallery__img {
  object-fit: contain;
  background: #ffffff;
}

.lv-lightbox-gallery--layout-masonry .lv-lightbox-gallery__img {
  height: auto;
  object-fit: initial;
}

.lv-lightbox-gallery__item:hover .lv-lightbox-gallery__img,
.lv-lightbox-gallery__item:focus-visible .lv-lightbox-gallery__img {
  transform: scale(1.035);
  opacity: .9;
}

.lv-lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: rgba(0, 0, 0, .9);
}

.lv-lightbox-modal.is-active {
  display: flex;
}

.lv-lightbox-modal__img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
}

.lv-lightbox-modal--fullscreen {
  padding: 0;
  background: rgba(0, 0, 0, .96);
}

.lv-lightbox-modal--fullscreen .lv-lightbox-modal__img {
  max-width: 100vw;
  max-height: 100vh;
}

.lv-lightbox-modal__close,
.lv-lightbox-modal__prev,
.lv-lightbox-modal__next {
  position: fixed;
  border: 0;
  background: rgba(0, 0, 0, .25);
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

.lv-lightbox-modal__close {
  top: 22px;
  right: 26px;
  font-size: 42px;
  background: transparent;
}

.lv-lightbox-modal__prev,
.lv-lightbox-modal__next {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 64px;
  font-size: 42px;
}

.lv-lightbox-modal__prev { left: 18px; }
.lv-lightbox-modal__next { right: 18px; }

@media (max-width: 900px) {
  .lv-lightbox-gallery,
  .lv-lightbox-gallery--cols-2,
  .lv-lightbox-gallery--cols-3,
  .lv-lightbox-gallery--cols-4,
  .lv-lightbox-gallery--cols-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lv-lightbox-gallery__img {
    height: 220px;
  }

  .lv-lightbox-gallery--layout-masonry .lv-lightbox-gallery__img {
    height: auto;
  }
}

@media (max-width: 600px) {
  .lv-lightbox-gallery,
  .lv-lightbox-gallery--cols-2,
  .lv-lightbox-gallery--cols-3,
  .lv-lightbox-gallery--cols-4,
  .lv-lightbox-gallery--cols-5 {
    grid-template-columns: 1fr;
  }

  .lv-lightbox-gallery__img {
    height: auto;
  }

  .lv-lightbox-modal__prev,
  .lv-lightbox-modal__next {
    width: 40px;
    height: 54px;
    font-size: 34px;
  }
}
