.video-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  margin-block: 32px 48px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--coral);
  background: var(--surface-solid);
  font: inherit;
  font-weight: 720;
  text-align: start;
  cursor: pointer;
}

.video-trigger svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.video-dialog {
  width: max-content;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 60px 12px 12px;
  overflow: hidden;
  border: 1px solid #444;
  border-radius: 24px;
  color: #fff;
  background: #000;
  box-shadow: 0 24px 80px #0006;
}

.video-dialog::backdrop {
  background: #000b;
}

.video-dialog video {
  display: block;
  width: min(380px, calc(100vw - 58px), calc((100dvh - 108px) * 0.4625));
  height: auto;
  aspect-ratio: 888 / 1920;
  border-radius: 12px;
  background: #000;
}

.video-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid #444;
  border-radius: 50%;
  color: inherit;
  background: #222;
  cursor: pointer;
}

.video-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.video-open,
.video-open body {
  overflow: hidden;
}

.video-trigger:focus-visible,
.video-close:focus-visible {
  outline-offset: 4px;
}

.video-trigger:hover {
  border-color: var(--coral);
}

.video-close:hover {
  background: #333;
}

.video-dialog video:fullscreen {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  object-fit: contain;
}

@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  .video-dialog {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  .video-dialog video {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
    object-fit: contain;
  }

  .video-close {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    z-index: 1;
  }
}

