.dhi-hls-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.dhi-hls-wrap video.dhi-hls {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Background mode: the script moves .dhi-hls-bg into the Avada container
   and marks the container as the host. Hidden until it has been moved. */
.dhi-hls-bg {
  visibility: hidden;
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.dhi-hls-bg-host {
  isolation: isolate; /* keeps z-index:-1 above the container's own background */
}
.dhi-hls-bg-host > .dhi-hls-bg {
  visibility: visible;
}
.dhi-hls-bg video.dhi-hls {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dhi-hls-bg .dhi-hls-overlay {
  position: absolute;
  inset: 0;
}

/* Popup / lightbox mode */
.dhi-hls-popup-lock,
.dhi-hls-popup-lock body {
  overflow: hidden;
}
.dhi-hls-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.dhi-hls-modal.is-open {
  opacity: 1;
}
.dhi-hls-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
}
.dhi-hls-modal-box {
  position: relative;
  width: 100%;
  /* never taller than the screen (minus padding), keeping the ratio */
  max-width: 1200px;
}
.dhi-hls-modal-frame {
  position: relative;
  width: 100%;
  aspect-ratio: var(--dhi-ratio, 16/9);
  margin: 0 auto;
  background: #000;
}
.dhi-hls-modal-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}
.dhi-hls-modal-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 30px;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s;
}
.dhi-hls-modal-close:hover,
.dhi-hls-modal-close:focus-visible {
  background: rgba(255, 255, 255, 0.3);
  outline: none;
}
