/**
 * @file
 */

/** Fix for unclean destroy. */
.pswp[aria-hidden="true"] {
  display: none;
}

.pswp--open {
  z-index: 9999;
}

.pswp__item {
  text-align: center;
}

.pswp .media-wrapper {
  position: relative;
  top: 50%;
  display: inline-block;
  overflow: hidden;
  width: 100%;
  max-width: 98%;
  margin: 0 auto;
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
  text-align: left;
  vertical-align: middle;
  line-height: 0;
}

.pswp__item--html .pswp__img {
  cursor: -webkit-grab;
  cursor: -moz-grab;
  cursor: grab;
}

.pswp.pswp--dragging .pswp__img {
  cursor: -webkit-grabbing;
  cursor: -moz-grabbing;
  cursor: grabbing;
}

/**
 * @todo: Remove temp fix for FF will-change warning:
 * https://github.com/dimsemenov/PhotoSwipe/issues/855
 */
.pswp__zoom-wrap {
  will-change: auto !important;
  -webkit-backface-visibility: visible !important;
}

.pswp .pswp__item .media {
  margin: auto;
}

.pswp__custom-caption {
  position: absolute;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  padding: 2px 8px;
  text-align: center;
  color: #fff;
  font-size: 1rem;
}

.pswp .pswp__caption h2,
.pswp .pswp__custom-caption h2 {
  margin-bottom: 0;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1.2;
}

.pswp__custom-caption.is-not-empty {
  background: rgba(0, 0, 0, 0.5);
}

.pswp__caption a,
.pswp__custom-caption a {
  color: #fff;
}

/* Videos/ html are not swipeable at mobile devices, override hidden arrows. */
.pswp--touch.pswp--is-html .pswp__button--arrow {
  visibility: visible;
}

/* PhotoSwipe 4 with Responsive image wrapped with pswp__item--html. */
.pswp__item--html img,
.pswp .media-wrapper--noratio {
  max-width: 100%;
}

/** @todo remove once Blazy updated to fix this regression video size. */
@media screen and (min-width: 1280px) {
  /** Prevents oversized video player. Adjust it accordingly. */
  .pswp .media-wrapper {
    max-width: 72%;
  }

  .pswp .media-wrapper--noratio {
    max-width: 100%;
  }
}
