@layer block {
  .video {
    text-align: center;
    max-width: var(--content-max-width);
    display: grid;
  }

  .video > * {
    grid-area: 1/1;
  }

  .video > div {
    aspect-ratio: 9/16;
    display: flex;
    justify-content: center;
  }

  @media (width >= 1024px) {
    .video > div {
      /* reserve an approximate space to avoid extensive layout shifts */
      aspect-ratio: 16 / 9;
    }
  }

  .video video {
    max-width: 100%;
  }

  .video .video-placeholder {
    width: 100%;
    position: relative;

    @media (width >= 1024px) {
      aspect-ratio: 16 / 9;
    }
  }

  .video > div:has(iframe) {
    z-index: 2;
  }

  .video .video-placeholder picture img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  .video .video-placeholder-play {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    inset: 0;
  }

  .video .video-placeholder-play button {
    position: relative;
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    outline: 2px solid;
    padding: 0;
  }

  .video .video-placeholder-play button::before {
    content: '';
    display: block;
    box-sizing: border-box;
    position: absolute;
    width: 0;
    height: 24px;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 18px solid;
    top: 50%;
    left: calc(50% + 2px);
    transform: translate(-50%, -50%);
  }
}
