/* ==========================================================
   Spark video popup (Vimeo lightbox)
   ========================================================== */

/* The popup window. Uses the native <dialog> element, which sits
   above everything on the page (including sticky headers). */
.spark-vp-dialog {
  /* As wide as possible, but never taller than 85% of the screen */
  width: min(1100px, 92vw, calc(85vh * 16 / 9));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.spark-vp-dialog::backdrop {
  background: rgba(0, 0, 0, 0.88);
}

.spark-vp-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.spark-vp-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Close button, sitting just above the video's top-right corner */
.spark-vp-close {
  position: absolute;
  top: -52px;
  right: -6px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.spark-vp-close:hover {
  background: rgba(255, 255, 255, 0.14);
}

.spark-vp-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* "Tap for sound": covers the whole video so a tap anywhere turns
   the sound on, with a visible label in the middle */
.spark-vp-sound {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.spark-vp-sound-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px 14px 20px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
  color: #fff;
  font-family: inherit;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
  animation: spark-vp-pulse 2.4s ease-in-out infinite;
  transition: background-color 0.2s ease;
}

.spark-vp-sound:hover .spark-vp-sound-pill {
  background: rgba(0, 0, 0, 0.82);
}

.spark-vp-sound:focus-visible {
  outline: none;
}

.spark-vp-sound:focus-visible .spark-vp-sound-pill {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

@keyframes spark-vp-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

@media (max-width: 575px) {
  .spark-vp-sound-pill {
    gap: 8px;
    padding: 10px 18px 10px 14px;
    font-size: 16px;
  }
}

/* Gentle fade/zoom when the popup opens */
.spark-vp-dialog[open] {
  animation: spark-vp-in 0.25s ease-out;
}

.spark-vp-dialog[open]::backdrop {
  animation: spark-vp-fade 0.25s ease-out;
}

@keyframes spark-vp-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes spark-vp-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .spark-vp-dialog[open],
  .spark-vp-dialog[open]::backdrop,
  .spark-vp-sound-pill {
    animation: none;
  }
}

/* Stops the page behind the popup from scrolling */
html.spark-vp-lock {
  overflow: hidden;
}

/* ----------------------------------------------------------
   Optional: play-button overlay for a clickable image.
   Add class="spark-vp-thumb" to the link wrapped around an <img>.
   ---------------------------------------------------------- */
.spark-vp-thumb {
  position: relative;
  display: inline-block;
  max-width: 100%;
  cursor: pointer;
}

.spark-vp-thumb img {
  display: block;
  max-width: 100%;
  height: auto;
}

.spark-vp-thumb::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 88px;
  height: 88px;
  margin: -44px 0 0 -44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M8 5v14l11-7z'/%3E%3C/svg%3E")
    no-repeat 58% 50% / 38px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.spark-vp-thumb:hover::after,
.spark-vp-thumb:focus-visible::after {
  transform: scale(1.08);
  background-color: rgba(0, 0, 0, 0.75);
}

.spark-vp-thumb:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 4px;
}

@media (max-width: 575px) {
  .spark-vp-thumb::after {
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    background-size: 28px;
  }
}
