/*
  Video in popup — a preview image with a centred play button (.video-popup__trigger)
  that opens the player in a native <dialog> modal. The play button enlarges a touch
  on hover/focus; the dialog is capped at the content width and holds a responsive
  16:9 iframe. Open/close + lazy iframe src are handled by assets/js/video-popup.js.
*/

.video-popup {
  display: flex;
}

/* ---- Trigger: poster + play button ---- */
.video-popup__trigger {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  border-radius: var(--radius);
  overflow: clip;
  cursor: pointer;
}

.video-popup__poster {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.video-popup__poster--placeholder {
  background-color: var(--color-green-muted);
}

/* Subtle dim so the white play button always has contrast over the image. */
.video-popup__trigger::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgb(0 0 0 / 0.15);
  transition: background-color 0.2s ease;
}

.video-popup__trigger:hover::after,
.video-popup__trigger:focus-visible::after {
  background-color: rgb(0 0 0 / 0.25);
}

.video-popup__play {
  position: absolute;
  inset: 0;
  margin: auto;
  z-index: 1;
  display: grid;
  place-items: center;
  inline-size: 4.5rem;
  block-size: 4.5rem;
  border-radius: 50%;
  background-color: var(--color-white);
  color: var(--color-green-dark);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease;
}

.video-popup__play svg {
  inline-size: 45%;
  block-size: 45%;
}

.video-popup__trigger:hover .video-popup__play,
.video-popup__trigger:focus-visible .video-popup__play {
  transform: scale(1.12);
}

/* ---- Player frame (16:9) ----
   The dialog shell + close button are the shared .modal / .modal__close
   (components/modal.css); only the video-specific frame lives here. */
.video-popup__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: clip;
  background-color: var(--color-black);
}

.video-popup__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .video-popup__play,
  .video-popup__trigger::after {
    transition: none;
  }
}
