.single-gallery-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin: 24px 0;
  overflow: hidden;
  background: #fff;
  font-family: inherit;
}

.single-gallery-slider__track,
.single-gallery-slide,
.single-gallery-slide__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #fff;
}

.single-gallery-slide {
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease;
}

.single-gallery-slide.is-active {
  opacity: 1;
  visibility: visible;
}

.single-gallery-slide__image {
  padding: 0;
  border: 0;
  background: #fff;
  cursor: zoom-in;
}

.single-gallery-slide__image img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  object-position: center;
}

.hero-slider__arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-family: inherit;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  transform: translateY(-50%);
}

.hero-slider__arrow--prev {
  left: 12px;
}

.hero-slider__arrow--next {
  right: 12px;
}

.single-gallery-slider__counter,
.single-gallery-lightbox__counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 6;
  padding: 6px 10px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-size: 11px;
}

.single-gallery-lightbox {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  background: #090909;
  font-family: inherit;
  isolation: isolate;
}

.single-gallery-lightbox[hidden] {
  display: none !important;
}

.single-gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, .96);
}

.single-gallery-lightbox__inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: 58px 76px 48px;
}

.single-gallery-lightbox__stage {
  position: relative;
  width: min(1600px, calc(100vw - 152px));
  height: calc(100vh - 106px);
  height: calc(100dvh - 106px);
  max-height: calc(100vh - 106px);
  max-height: calc(100dvh - 106px);
}

.single-gallery-lightbox__slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease;
}

.single-gallery-lightbox__slide.is-active {
  opacity: 1;
  visibility: visible;
}

.single-gallery-lightbox__slide img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  margin: auto;
  object-fit: contain;
  object-position: center;
  transform: none !important;
}

.single-gallery-lightbox__caption {
  position: absolute;
  right: 0;
  bottom: -28px;
  left: 0;
  margin: 0;
  color: #ddd;
  font-size: 11px;
  text-align: center;
}

.single-gallery-lightbox__close {
  all: unset;
  box-sizing: border-box;
  position: fixed !important;
  top: max(14px, env(safe-area-inset-top)) !important;
  right: max(14px, env(safe-area-inset-right)) !important;
  z-index: 2147483646 !important;
  display: block !important;
  width: 44px !important;
  height: 44px !important;
  border: 1px solid rgba(255, 255, 255, .45) !important;
  border-radius: 3px !important;
  background: rgba(0, 0, 0, .78) !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  cursor: pointer !important;
}

.single-gallery-lightbox__close::before,
.single-gallery-lightbox__close::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 9px;
  display: block;
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  pointer-events: none;
}

.single-gallery-lightbox__close::before {
  transform: rotate(45deg);
}

.single-gallery-lightbox__close::after {
  transform: rotate(-45deg);
}

.single-gallery-lightbox__close:hover,
.single-gallery-lightbox__close:focus-visible {
  border-color: #fff !important;
  background: rgba(255, 255, 255, .18) !important;
  outline: 1px solid rgba(255, 255, 255, .8) !important;
  outline-offset: 1px;
}

.single-gallery-lightbox__arrow--prev {
  left: 18px;
}

.single-gallery-lightbox__arrow--next {
  right: 18px;
}

body.single-gallery-lightbox-open {
  overflow: hidden !important;
}

/*
 * Лайтбокс при открытии переносится JavaScript-ом непосредственно в body,
 * поэтому шапка и меню не создают над ним отдельный слой.
 */
body.single-gallery-lightbox-open .header-main-sticky,
body.single-gallery-lightbox-open .header-nav-row,
body.single-gallery-lightbox-open .breaking-bar,
body.single-gallery-lightbox-open .mobile-nav-drawer,
body.single-gallery-lightbox-open .mobile-sticky-menu-toggle,
body.single-gallery-lightbox-open .scroll-to-top,
body.single-gallery-lightbox-open #wpadminbar {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 700px) {
  .single-gallery-lightbox__inner {
    padding: 58px 12px 42px;
  }

  .single-gallery-lightbox__stage {
    width: calc(100vw - 24px);
    height: calc(100vh - 100px);
    height: calc(100dvh - 100px);
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
  }

  .single-gallery-lightbox__close {
    width: 42px !important;
    height: 42px !important;
  }

  .single-gallery-lightbox__close::before,
  .single-gallery-lightbox__close::after {
    top: 19px;
    left: 8px;
    width: 24px;
  }

  .hero-slider__arrow {
    width: 34px;
    height: 34px;
    font-size: 24px;
  }
}
