.ke-media-modal {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .82);
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease, backdrop-filter .28s ease;
  backdrop-filter: blur(0);
}

.ke-media-modal[hidden] {
  display: none;
}

.ke-media-modal.is-open {
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(4px);
}

.ke-media-modal.is-closing {
  opacity: 0;
  pointer-events: none;
}

.ke-media-modal__content {
  position: relative;
  width: min(100%, 960px);
  max-height: calc(100vh - 48px);
  opacity: 0;
  transform: translateY(18px) scale(.96);
  transition: opacity .32s cubic-bezier(.22, 1, .36, 1), transform .32s cubic-bezier(.22, 1, .36, 1);
  will-change: opacity, transform;
}

.ke-media-modal.is-open .ke-media-modal__content {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.ke-media-modal.is-closing .ke-media-modal__content {
  opacity: 0;
  transform: translateY(12px) scale(.97);
}

.ke-media-modal__body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.ke-media-modal__body > * {
  opacity: 0;
  transform: scale(.985);
}

.ke-media-modal__body.is-ready > * {
  animation: ke-media-item-in .34s cubic-bezier(.22, 1, .36, 1) forwards;
}

.ke-media-modal__body img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 96px);
  margin: 0 auto;
  border-radius: 6px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

.ke-media-modal__video {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

.ke-media-modal__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
}

.ke-media-modal__close,
.ke-media-modal__prev,
.ke-media-modal__next {
  cursor: pointer;
  position: absolute;
  border: 0;
  color: #fff;
  font: inherit;
  transition: background-color .2s ease, opacity .2s ease, transform .2s ease;
}

.ke-media-modal__close {
  top: -42px;
  right: 0;
  width: 36px;
  height: 36px;
  background: transparent;
  font-size: 3.2rem;
  line-height: 1;
}

.ke-media-modal__close:hover {
  opacity: .72;
  transform: rotate(90deg);
}

.ke-media-modal__prev,
.ke-media-modal__next {
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 64px;
  background: rgba(0, 0, 0, .3);
  font-size: 4rem;
  line-height: 1;
}

.ke-media-modal__prev:hover,
.ke-media-modal__next:hover {
  background: rgba(255, 255, 255, .18);
}

.ke-media-modal__prev {
  left: -56px;
}

.ke-media-modal__next {
  right: -56px;
}

@media screen and (max-width: 660px) {
  .ke-media-modal {
    padding: 16px;
  }

  .ke-media-modal__close {
    top: -40px;
  }

  .ke-media-modal__prev,
  .ke-media-modal__next {
    width: 36px;
    height: 52px;
    font-size: 3.2rem;
  }

  .ke-media-modal__prev {
    left: 0;
  }

  .ke-media-modal__next {
    right: 0;
  }
}

@keyframes ke-media-item-in {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(.985);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ke-media-modal,
  .ke-media-modal__content,
  .ke-media-modal__close,
  .ke-media-modal__prev,
  .ke-media-modal__next {
    transition-duration: .01ms !important;
  }

  .ke-media-modal__body.is-ready > * {
    animation-duration: .01ms !important;
  }
}
