.pbgallery li {
  list-style: none;
  perspective: 100px;
  display: inline-block;
  vertical-align: middle;
  position: relative;
  transition: 0.1s;
}
.pbgallery li.video::before {
  content: '\25BA';
  color: #fff;
  font-size: 20px;
  height: 20px;
  width: 20px;
  line-height: 0.9;
  position: absolute;
  bottom: 3px;
  left: 4px;
  z-index: 1;
  background: rgb(0 0 0 / 40%);
  box-shadow: 0 0 0 3px rgb(0 0 0 / 40%);
  border-radius: 0 3px 0 0;
  pointer-events: none;
  opacity: 0;
  transition: 0.5s 0.2s;
}
.pbgallery li.video::before {
  opacity: 1;
}

.pbgallery a {
  display: block;
  vertical-align: bottom;
  overflow: hidden;
  background: rgb(0 0 0 / 10%);
  transition: 0.4s ease-out;
  transform: rotateX(90deg) translate(-50px, -50%);
}
.pbgallery a:active,
.pbgallery a:focus {
  outline: none;
}
.pbgallery a img {
  min-height: 100%;
  width: 100%;
  transition: 0.3s ease-out;
}
.pbgallery a {
  transform: rotateX(0deg) translate(0, 0);
}
.pbgallery li:hover {
  z-index: 2;
  transform: scale(1.4);
}
.pbgallery li a:hover {
  box-shadow:
    0 0 0 2px #fff,
    0 0 20px 5px #000;
  transition: 0.1s;
}
.pbgallery li:hover img {
  transform: scale(1.2);
}
.pbgallery li.video:hover::before {
  opacity: 0;
}

/* Normilizes box-sizing  */
#pbOverlay *,
#pbOverlay *::before,
#pbOverlay *::after {
  box-sizing: content-box;
}

#pbOverlay.show {
  opacity: 1;
  pointer-events: auto;
}

#pbOverlay {
  opacity: 0;
  overflow: hidden;
  width: 100%;
  height: 100%;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  text-align: center;
  pointer-events: none;
  user-select: none;
  background: rgb(0 0 0 / 90%);

  /* background:radial-gradient(rgba(0,0,0,.6) 0%, rgba(0,0,0,.9) 100%); */
  transform: translate3d(0, 0, 0);
  transition: opacity 300ms ease;
}
#pbOverlay.msie {
  background-color: rgb(0 0 0 / 60%);
}
.msie.pbLoading .pbWrapper {
  background: url('../images/loading.gif') no-repeat center center;
}

@keyframes pbLoaderFrames {
  50% {
    height: 5px;
  }
}

@keyframes pbLoaderFrames {
  50% {
    height: 5px;
  }
}

.pbLoader {
  display: none;
  width: 100px;
  height: 100px;
  position: absolute;
  z-index: 999;
  inset: 0;
  margin: auto;
  text-align: center;
  border-radius: 100%;
  box-shadow:
    15px 32px 60px -20px #fff inset,
    1px 1px 3px 1px #fff inset,
    0 0 20px;
  transition: 0.3s;
}
.thumbs .pbLoader {
  transform: translateY(-50px);
}
.pbLoading:not(.msie, .error) .pbLoader {
  display: block;
}
.pbLoader b {
  display: inline-block;
  vertical-align: middle;
  margin: 0 2px;
  width: 8px;
  height: 60px;
  border-radius: 5px;
  background: rgb(255 255 255 / 80%);
  box-shadow: 0 0 10px rgb(0 0 0 / 50%);
  animation: 0.9s pbLoaderFrames infinite linear;
}
.pbLoader b:nth-child(2) {
  animation-delay: 0.3s;
}
.pbLoader b:nth-child(3) {
  animation-delay: 0.6s;
}

.mobile.pbLoading .pbLoader {
  transform: none;
  transition: 0s;
}

.pbWrapper::after,
#pbCaption .pbThumbs ul::after,
#pbOverlay .prevNext::after,
#pbOverlay .pbLoader::before {
  content: '';
  display: inline-block;
  height: 100%;
  margin-right: -0.25em;
  vertical-align: middle;
}

/* Animation when image was not loaded */
@keyframes deadImage {
  50% {
    text-shadow: 0 0 25px rgb(255 255 255 / 50%);
    transform: scale(0.85);
  }
}

@keyframes deadImage {
  50% {
    text-shadow: 0 0 25px rgb(255 255 255 / 50%);
    transform: scale(0.85);
  }
}

.pbWrapper {
  box-sizing: border-box;
  transform: rotate(0deg);
  vertical-align: middle;
  height: 100%;
  perspective: 1200px;
  position: relative;
  transition: 0.2s;
}
.video > .pbWrapper {
  z-index: 11;
  display: inline-block;
}

/* #pbOverlay.error .pbWrapper{ display:inline-block; width:100%; } */
.pbLoading .pbWrapper {
  display: inline-block\9;
  width: 100%;
} /* ie8+9 hack */
.pbWrapper::before {
  content: '\2716';
  color: transparent;
  text-shadow: 0 2px 35px rgb(255 255 255 / 0%);
  font-size: 0;
  vertical-align: middle;
  cursor: default;
  transition: text-shadow 0.7s ease-out;
}
.error .pbWrapper::before {
  font-size: 22em;
  text-shadow: 0 0 0 #fff;
  animation: 2s 1s deadImage infinite linear;
}
.thumbs .pbWrapper {
  padding: 0;
  margin: 0;
}
.error .pbWrapperr img {
  width: 0;
}

.pbWrapper > div {
  display: none;
  width: 624px;
  height: 351px;
  vertical-align: middle;
  border-radius: 5px;
  background: rgb(0 0 0 / 50%);
}
.video > .pbWrapper > div {
  display: inline-block;
}
#pbOverlay iframe,
#pbOverlay embed,
#pbOverlay object {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 1;
  transition: 0.5s;
}
.pbWrapper .hide iframe {
  opacity: 0;
}

.pbWrapper > div,
.pbWrapper > img {
  transition: 0.3s 0.5s ease-out;
  transition: 0.8s 0.5s cubic-bezier(0.1, 0.87, 0.48, 1);
  transform: none;
  backface-visibility: hidden;
  box-shadow: 0 0 20px #000;
}

/* FOR MOBILE */
.mobile.show .pbWrapper > div,
.mobile.show .pbWrapper > img {
  transition: 30ms;
}

.pbWrapper > *,
.hide .pbWrapper > .prepare {
  opacity: 1;
  vertical-align: middle;
  transform: scale(0) rotateX(80deg);
  border-radius: 6px;
  border: none;
  max-height: 95%;
  max-width: 100%;
}
.on .pbWrapper > * {
  transition-delay: 0s;
}
.pbWrapper .zoomable {
  transition: 0s;
  position: relative;
  z-index: 9;
}
.hide .pbWrapper > * {
  transform: scale(1.2);
  transform: none\9;
  opacity: 0;
  transition: 0.4s ease-in;
}

/* -- close button -- */
#pbCloseBtn,
#pbAutoplayBtn {
  position: absolute;
  top: -50px;
  right: -50px;
  z-index: 999;
  display: block;
  padding: 0 0 20px 20px;
  text-align: center;
  cursor: pointer;
  color: #fff;
  transition: 0.3s 0.3s ease-out;
}
.hide #pbCloseBtn {
  top: -50px;
  right: -50px;
}
.on #pbCloseBtn {
  top: -2px;
  right: -2px;
}

#pbCloseBtn::before {
  content: '\00D7';
  font: bold 1em/1 arial;
}
#pbCloseBtn::before,
#pbAutoplayBtn::before {
  display: inline-block;
  height: 35px;
  width: 35px;
  padding: 8px 8px 12px 12px;
  font-size: 2em;
  opacity: 0.8;
  vertical-align: middle;
  background: rgb(255 255 255 / 20%);
  border-radius: 0 0 0 70px;
  transition: 0.1s ease-out;
}
#pbCloseBtn:hover::before {
  padding: 15px 10px 24px 24px;
  background: rgb(255 100 100 / 40%);
}

/* -- autoplay controller -- */
#pbAutoplayBtn {
  display: none;
  right: auto;
  left: -50px;
  padding: 0;
  width: 50px;
  height: 50px;
  font-size: 13px;
}
.hasAutoplay #pbAutoplayBtn {
  display: block;
}
#pbAutoplayBtn:hover {
  width: 60px;
  height: 60px;
}
.on #pbAutoplayBtn {
  top: 0;
  left: 0;
  transition: 0.1s ease-out;
}
#pbAutoplayBtn::before {
  content: '\2016';
  width: 100%;
  height: 100%;
  border-radius: 0 0 70px;
  font-weight: bold;
  padding: 0;
  text-indent: -6px;
  line-height: 1.6;
}
#pbAutoplayBtn:active::before {
  text-shadow:
    0 0 3px #fff,
    0 0 6px #fff;
}
#pbAutoplayBtn.play::before {
  content: '\25BA';
}

#pbAutoplayBtn .pbProgress {
  display: none\9;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: absolute;
  padding: 6px;
  top: 0;
  left: 0;
  opacity: 0.2;
  transform: rotateZ(0deg);
  transform-origin: 0 0;
  transition: 0.3s;
}
.mobile #pbAutoplayBtn .pbProgress {
  transition: 0s;
}
#pbAutoplayBtn.playing .pbProgress {
  transform: rotateZ(90deg);
}
#pbAutoplayBtn .pbProgress::before {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 200%;
  height: 200%;
  border-radius: 50%;
  box-shadow: 0 0 0 8px #fff inset;
}

#pbCaption,
.hide #pbCaption {
  position: absolute;
  z-index: 999;
  margin-bottom: 5px;
  bottom: -120px;
  width: 100%;
  overflow: hidden;
  transition: 0.4s;
}
.show.on #pbCaption {
  bottom: 0;
  transition-delay: 0.5s;
}
#pbOverlay.thumbs #pbCaption label {
  display: block;
}
#pbCaption label {
  display: none;
  position: relative;
  z-index: 1;
  top: -5px;
  float: right;
  width: 60px;
  margin-right: 10px;
  color: #fff;
  opacity: 0.3;
  transition: 0.2s;
  cursor: pointer;
}
#pbCaption label::after {
  background: #fff;
  box-shadow:
    12px 0 #fff,
    -12px 0 #fff;
  content: '';
  display: inline-block;
  height: 0;
  padding: 10px 5px;
  text-align: right;
  vertical-align: top;
  width: 0;
}
#pbCaption label:hover {
  opacity: 1;
}
#pbCaption .title,
#pbCaption .counter {
  display: inline-block;
  color: #fff;
  margin: 0 6px;
}
#pbCaption .counter {
  display: none;
  opacity: 0.55;
}
.hasCounter #pbCaption .counter {
  display: inline-block;
}
.pbCaptionText {
  transition: 0.3s;
  opacity: 0.9;
  font-weight: bold;
  font-size: 0.9em;
  text-shadow: 1px 1px 1px rgb(0 0 0 / 50%);
  padding-left: 60px;
} /* padding-left from <label> */
.pbCaptionText.change {
  transform: translateY(25px);
  opacity: 0;
}

.mobile #pbCaption label {
  display: none;
  z-index: -1;
  color: red;
}
.mobile .pbCaptionText {
  padding: 0;
}

/* hide thumbnails */
#pbThumbsToggler:checked ~ #pbCaption .pbThumbs {
  margin: 0;
}
#pbThumbsToggler:checked ~ .pbWrapper {
  margin-top: -50px;
  padding: 50px 0;
}

.pbThumbs {
  display: none;
  transition: 0.35s;
  -webkit-overflow-scrolling: touch;
}
.thumbs .pbThumbs {
  display: block;
  width: 100%;
  padding: 5px 0 2px;
  margin-bottom: -100px;
  overflow: hidden;
}
.mobile .pbThumbs {
  overflow: auto;
}
.pbThumbs:hover {
  clear: both;
}
.pbThumbs ul {
  display: inline-block;
  position: relative;
  list-style: none;
  height: 80px;
  padding: 0 5px;
  margin: 0;
  white-space: pre;
  transition: 0.2s;
}
.pbThumbs ul::after {
  vertical-align: bottom;
}
.pbThumbs li {
  display: inline-block;
  vertical-align: bottom;
  height: 70%;
  opacity: 0.6;
  text-align: center;
  position: relative;
  transition: 0.15s;
}
.pbThumbs li.active {
  height: 100%;
  opacity: 1;
}
.pbThumbs li:hover {
  height: 100%;
  opacity: 1;
}
.pbThumbs li.video::before {
  content: '\25BA';
  color: #fff;
  font-size: 20px;
  height: 20px;
  width: 20px;
  line-height: 0.9;
  position: absolute;
  bottom: 4px;
  left: 7px;
  background: rgb(0 0 0 / 40%);
  box-shadow: 0 0 0 3px rgb(0 0 0 / 40%);
  border-radius: 0 3px 0 0;
  pointer-events: none;
}
.pbThumbs a {
  height: 100%;
  padding: 0 2px;
  display: block;
  user-select: none;
}
.pbThumbs li:hover a {
}
.pbThumbs img {
  height: 96%;
  min-height: 95.9%;
  border: 2px solid #fff;
  max-width: none;
  border-radius: 0;
  transition: 0.15s;
}
.pbThumbs li:hover img {
  min-height: 96%;
} /* fix a bug in Chrome and Opera */
.pbThumbs li.fast a img {
  transition: none;
}
.pbThumbs li.active a img {
  border-color: #d8ff16;
  min-height: 96%;
}

#pbOverlay .prevNext {
  display: none;
  background: rgb(0 0 0 / 0%);
  position: absolute;
  z-index: 10;
  height: 100%;
  width: 35%;
  padding: 80px 0;
  opacity: 0;
  box-sizing: border-box;
  top: 0;
  transition: 0.2s ease-out;
  text-shadow:
    0 0 12px #000,
    0 0 10px #fff;
  user-select: none;
  cursor: pointer;
}
#pbOverlay.hasArrows .prevNext {
  display: block;
}
#pbOverlay .prevNext.hide {
  display: none;
}
#pbOverlay.on .prevNext:hover {
  opacity: 0.5;
}
#pbOverlay.on .prevNext:hover:active {
  transition: 80ms;
  opacity: 1;
  text-shadow:
    0 0 16px #fff,
    0 0 10px #000;
}
.prevNext b {
  display: inline-block;
  vertical-align: middle;
  transition: 0.2s ease-in;
}
.prevNext:hover b {
  transition: 0.2s cubic-bezier(0.095, 0.87, 0.485, 0.985);
}
#pbPrevBtn b {
  transform: scale(0.4) translateX(350px);
}
#pbNextBtn b {
  transform: scale(0.4) translateX(-350px);
}

/* */
#pbPrevBtn b::before,
#pbNextBtn b::after {
  display: inline;
  line-height: 0.3;
  font-size: 18em;
  font-weight: normal;
  color: #fff;
  font-family: Arial;
}

#pbPrevBtn b::before {
  content: '\2039';
}
#pbNextBtn b::after {
  content: '\203A';
}

/* */
.on #pbPrevBtn:hover b {
  transform: scale(1) translateX(20px);
}
.on #pbNextBtn:hover b {
  transform: scale(1) translateX(-20px);
}

.show #pbPrevBtn,
#pbOverlay.show #pbNextBtn {
}
.show #pbPrevBtn {
  left: 0;
  text-align: left;
}
.show #pbNextBtn {
  right: 0;
  text-align: right;
}

/* ------- media queries (for small screens) ----------- */
@media all and (width <=700px) {
  .pbWrapper img,
  .hide .pbWrapper img.prepare {
    max-height: 100%;
  }

  .thumbs .pbWrapper {
    padding: 0;
    margin: 0;
  }
  .pbThumbs {
    margin-bottom: -60px;
  }
  .pbThumbs.show {
    margin: 0;
  }

  .pbThumbs ul {
    height: 50px;
  }
  .pbThumbs li {
    height: 100%;
    opacity: 1;
  }
  .pbThumbs li img {
    min-height: 96.5%;
  }
}

/* fix for Chrome */
@media all and (width <=710px) {
  .pbThumbs li.active a img {
    min-height: 96%;
  }
}
