@charset "utf-8";

.nex-modal--video {
  --video-modal-vertical-gap: calc(152px + env(safe-area-inset-top) + env(safe-area-inset-bottom));
  width: min(70vw, calc((100dvh - var(--video-modal-vertical-gap)) * 16 / 9));
  max-width: none;
  max-height: none;
  overflow: visible;
  padding: 0;
  border-radius: 0;
  background: #000;
  color: var(--white);
}

.nex-modal--video .nex-modal__content {
  width: 100%;
}

.nex-modal--video .nex-modal__close {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 50%;
  width: 44px;
  min-height: 44px;
  margin: -68px 0 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  overflow: hidden;
  color: transparent;
  background: rgba(0, 0, 0, 0.35);
  font-size: 0;
  transform: translateX(-50%);
}

.nex-modal--video .nex-modal__close::before,
.nex-modal--video .nex-modal__close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 1px;
  background: var(--white);
}

.nex-modal--video .nex-modal__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.nex-modal--video .nex-modal__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.nex-modal--video .nex-modal__close:hover,
.nex-modal--video .nex-modal__close:focus-visible {
  background: rgba(255, 255, 255, 0.16);
}

.video-modal,
.video-modal__frame,
.video-modal__iframe {
  width: 100%;
}

.video-modal {
  background: #000;
}

.video-modal__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0f1113;
}

.video-modal__iframe {
  position: absolute;
  z-index: 0;
  inset: 0;
  height: 100%;
  border: 0;
}

.video-modal__skeleton {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  background: #0f1113;
  transition: opacity 0.3s ease;
}

.video-modal__skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  animation: video-modal-skeleton 1.4s ease-in-out infinite;
}

.video-modal__skeleton-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.video-modal__skeleton-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 53%;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid rgba(255, 255, 255, 0.55);
  transform: translate(-50%, -50%);
}

.video-modal.is-loaded .video-modal__skeleton,
.video-modal.has-thumbnail.is-thumbnail-loaded .video-modal__skeleton {
  opacity: 0;
  pointer-events: none;
}

.video-modal__thumbnail {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  background: #0f1113;
  transition: opacity 0.4s ease;
}

.video-modal__thumbnail[hidden],
.video-modal__play[hidden] {
  display: none;
}

.video-modal__thumbnail-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-modal__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  color: var(--white);
  background: rgba(0, 0, 0, 0.42);
  transform: translate(-50%, -50%);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.25s ease;
}

.video-modal__play span {
  width: 0;
  height: 0;
  margin-left: 5px;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 16px solid currentColor;
}

.video-modal__play:hover,
.video-modal__play:focus-visible {
  background: rgba(0, 0, 0, 0.68);
  outline: 2px solid var(--white);
  outline-offset: 4px;
}

.video-modal.is-autoplay .video-modal__thumbnail {
  pointer-events: none;
}

.video-modal.is-loaded .video-modal__thumbnail {
  opacity: 0;
  pointer-events: none;
}

.video-modal__error {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  padding: 24px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.82);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.video-modal__error[hidden] {
  display: none;
}

.video-modal__error p {
  margin: 0 0 12px;
}

.video-modal__error a {
  display: inline-flex;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid currentColor;
  border-radius: 999px;
  align-items: center;
}

@keyframes video-modal-skeleton {
  to {
    transform: translateX(100%);
  }
}

@supports not (height: 100dvh) {
  .nex-modal--video {
    width: min(80vw, calc((100vh - var(--video-modal-vertical-gap)) * 16 / 9));
  }
}

@media screen and (max-width: 1024px) {
  .nex-modal--video {
    width: min(90vw, calc((100dvh - var(--video-modal-vertical-gap)) * 16 / 9));
  }

  .nex-modal--video .nex-modal__close {
    top: 100%;
    width: 44px;
    min-height: 44px;
    margin: 24px 0 0;
  }

  .nex-modal--video .nex-modal__close::before,
  .nex-modal--video .nex-modal__close::after {
    width: 20px;
    height: 1px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .video-modal__skeleton,
  .video-modal__skeleton::after,
  .video-modal__thumbnail,
  .video-modal__play {
    transition: none;
    animation: none;
  }
}
