/* Keep native video controls and offer a large central play target while paused. */
.dg-video-reading .video-detail-player.has-center-play { position: relative; }
.dg-video-reading .dg-video-center-play {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: clamp(56px, 8vw, 82px);
  height: clamp(56px, 8vw, 82px);
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #075aef;
  color: #fff;
  box-shadow: 0 6px 24px #071b3666;
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.dg-video-reading .dg-video-center-play[hidden] { display: none; }
.dg-video-reading .dg-video-center-play:hover { background: #064cc9; }
.dg-video-reading .dg-video-center-play:focus-visible { outline: 3px solid #fff; outline-offset: 5px; }
.dg-video-reading .dg-video-center-play svg { display: block; width: 32px; height: 32px; }

/* On phones, the description uses the space below the stationary player.
   Desktop video pages and video series/listing pages keep their usual flow. */
@media (max-width: 767px), (max-width: 1023px) and (max-height: 500px) {
  html:has(.dg-video-reading),
  body:has(.dg-video-reading) { height: 100%; overflow: hidden; }

  .dg-video-reading {
    --dg-canvas: #fff;
    --dg-canvas-gradient: #fff;
    background: #fff;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: clip;
  }

  .dg-video-reading .back-to-top { display: none; }

  .dg-video-reading .video-detail {
    box-sizing: border-box;
    height: calc(100vh - var(--dg-video-header-space, 87px));
    height: calc(100dvh - var(--dg-video-header-space, 87px));
    padding-block: 12px;
  }

  .dg-video-reading .video-detail-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }

  .dg-video-reading .video-detail-typebar,
  .dg-video-reading .video-detail-title,
  .dg-video-reading .video-detail-meta,
  .dg-video-reading .video-detail-player,
  .dg-video-reading .video-detail-footer {
    flex: 0 0 auto;
  }

  .dg-video-reading .video-detail-typebar { margin-bottom: 6px; }
  .dg-video-reading .video-detail-title { margin-block: 0 6px; font-size: 22px; line-height: 1.25; }
  .dg-video-reading .video-detail-meta { margin-bottom: 12px; }
  .dg-video-reading .video-detail-player { margin-bottom: 12px; background: #000; }

  .dg-video-reading .video-detail-player :is(video, iframe) {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 32vh;
    max-height: 32dvh;
    object-fit: contain;
  }

  .dg-video-reading .video-detail-content {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: 4px 0 12px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    outline: none;
    scrollbar-width: none;
    scroll-padding-block: 8px;
  }

  .dg-video-reading .video-detail-content::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .dg-video-reading .video-detail-footer { margin-top: 12px; }
}

/* Landscape phones keep room for reading beside the player. */
@media (min-width: 640px) and (max-width: 1023px) and (max-height: 500px) {
  .dg-video-reading .video-detail-container {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    column-gap: 16px;
  }
  .dg-video-reading .video-detail-container > :not(.video-detail-content) { grid-column: 1; }
  .dg-video-reading .video-detail-title { font-size: 18px; }
  .dg-video-reading .video-detail-player { align-self: start; margin: 0; }
  .dg-video-reading .video-detail-content { grid-column: 2; grid-row: 1 / -1; }
  .dg-video-reading .video-detail-footer { margin-top: 6px; }
}