/* ==========================================================================
   self-hosted-video component
   Mirrors vendor.css :is(vimeo-embed, youtube-embed) rules (L3922–4104)
   ========================================================================== */

self-hosted-video {
  aspect-ratio: 16/9;
  border-radius: 32px;
  display: grid;
  inline-size: 100%;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: 0.3s ease-in-out;
  will-change: transform;
}

self-hosted-video:after {
  content: "";
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2));
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  transition: opacity 300ms ease-in-out, visibility 300ms ease-in-out;
  z-index: 1;
}

self-hosted-video:hover::after {
  opacity: 0;
  visibility: hidden;
}

/* Play button */
self-hosted-video button {
  background-color: #28334A;
  width: 60px;
  height: 60px;
  border: 1px solid #FFFFFF;
  border-radius: 50px;
  display: grid;
  place-self: center;
  opacity: 1;
  visibility: visible;
  transition: all 0.2s ease-in;
  cursor: pointer;
  z-index: 2;
}

self-hosted-video button:hover {
  background-color: #006680;
}

self-hosted-video button:focus {
  background-color: #006680;
  box-shadow: 0px 0px 12px rgba(0, 204, 255, 0.6);
}

self-hosted-video button::before {
  aspect-ratio: 1;
  background: #FFF;
  block-size: 1.5em;
  width: 21px;
  height: 18px;
  -webkit-clip-path: polygon(20% 0%, 20% 100%, 100% 50%);
          clip-path: polygon(20% 0%, 20% 100%, 100% 50%);
  content: "";
  place-self: center;
}

self-hosted-video button:after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
}

/* Poster image & video element */
self-hosted-video :is(video, img) {
  block-size: 100%;
  border: 0;
  border-radius: inherit;
  inline-size: 100%;
  inset: 0;
  -o-object-fit: cover;
     object-fit: cover;
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

/* Playing state — hide play button, enable video interaction */
self-hosted-video.is-playing button {
  opacity: 0;
  visibility: hidden;
}

self-hosted-video.is-playing video {
  pointer-events: auto;
}

self-hosted-video.is-playing:hover {
  transform: none;
}

/* ---- Responsive ---- */

@media (min-width: 1025px) {
  self-hosted-video:hover {
    transform: scale(1.02);
  }
}

@media (min-width: 1340px) {
  self-hosted-video:hover {
    transform: scale(1.1);
  }
}

@media screen and (max-width: 767.98px) {
  .video-large .video-box self-hosted-video {
    border-radius: 0;
    aspect-ratio: 9/10;
  }
}

@media screen and (max-width: 575.98px) {
  .video-large .video-box self-hosted-video {
    aspect-ratio: 9/14;
  }
}
