.video-dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 1100px);
  max-width: 90vw;
  max-height: 90vh;
  height: auto;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: #000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.video-dialog::backdrop {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

#video-frame {
  width: 100%;
  height: min(70vh, 620px);
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  position: relative;
  flex-shrink: 0;
}

#video-frame video,
#video-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border: 0;
}

#video-caption {
  flex-shrink: 0;
  padding: 10px 16px;
  margin: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
}

html:has(.video-dialog[open]),
body:has(.video-dialog[open]) {
  overflow: hidden;
}

@media (max-width: 768px) {
  .video-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    inset: 0;
    transform: none;
  }

  #video-frame {
    height: calc(100vh - 52px);
    max-height: calc(100vh - 52px);
  }
}
