.home-video { position: relative; }
.home-video-panel {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  background: #000;
}
.home-video-play { gap: .65rem; }
.home-video-play::before {
  content: "";
  border-block: .42em solid transparent;
  border-inline-start: .68em solid currentColor;
}
.home-video video {
  display: block;
  width: auto;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}
.home-video-close {
  position: absolute;
  inset-block-start: .65rem;
  inset-inline-end: .65rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgb(255 255 255 / .6);
  border-radius: 50%;
  background: rgb(16 9 13 / .9);
  color: white;
  font: 400 1.65rem/1 sans-serif;
  cursor: pointer;
}
.home-video :is(video, button):focus-visible {
  outline: 3px solid #e7b5c7;
  outline-offset: -3px;
}
.home-hero.is-playing :is(.home-video picture, .home-video-play) { visibility: hidden; }

@media (min-width: 48rem) {
  .home-video { display: contents; }
  .home-video-panel {
    --cinema-scene: url("/assets/sala-cinema-pubblico-rifinito.webp");
    container-type: size;
    overflow: clip;
  }
  .home-video video {
    min-height: 0;
    /* The picture reaches the seats at 85.5% of the panel height (85.5 × 16 / 9). */
    width: min(100%, 152cqh);
    object-position: center top;
  }
  .home-video video:fullscreen { object-position: center; }

  /* The backdrop and the spectator cutouts must use the same dimensions. */
  .home-video-panel::before,
  .home-video-panel::after {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 50%;
    width: max(100%, calc(100cqh * 2117 / 743));
    transform: translateX(-50%);
    pointer-events: none;
    background: var(--cinema-scene) center / 100% 100% no-repeat;
  }
  .home-video-panel::before { z-index: -1; }
  .home-video-panel::after {
    z-index: 1;
    mask: url("/assets/sala-cinema-sagome.svg") center / 100% 100% no-repeat;
  }
  .home-video-close { z-index: 2; }
  .home-hero.is-playing :is(h1, .hero-lead) { visibility: hidden; }
}
@media print {
  .home-video, .home-video-play { display: none; }
}
