/* Linkifi VSL player. Colours follow the page's --brand tokens when present. */

.vp {
  --vp-accent: var(--brand, #5a4dbf);
  --vp-accent-hover: var(--brand-light, #6c60d4);
  --vp-fill: #8278f0;
  --vp-hot-1: #725bff;
  --vp-hot-2: #a64ae6;
  --vp-hot-3: #d733a2;
  --vp-hot-4: #ff4fcb;
  --vp-controls-h: 60px;
  position: relative;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: var(--font-body, system-ui, -apple-system, "Segoe UI", sans-serif);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  outline: none;
}

.vp video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  cursor: pointer;
}

.vp.is-started.is-playing:not(.is-active),
.vp.is-started.is-playing:not(.is-active) video { cursor: none; }

/* Low-specificity reset so the component rules below win without !important. */
:where(.vp) button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.vp svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.vp svg .stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

/* ---------- Muted autoplay: sound prompt ---------- */

/* The whole player is the click target; the badge sits in the top-right corner. */
.vp-unmute {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 16px;
}

.vp.is-preview .vp-unmute { display: flex; }

.vp-unmute:focus-visible { outline: none; }
.vp-unmute:focus-visible .vp-unmute-badge { outline: 2px solid #fff; outline-offset: 3px; }

.vp-unmute-badge {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 20px 7px 7px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: linear-gradient(115deg, var(--vp-hot-1) 0%, var(--vp-hot-2) 40%, var(--vp-hot-3) 75%, var(--vp-hot-4) 100%);
  background-size: 180% 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 12px 32px -8px rgba(215, 51, 162, 0.7);
  text-align: left;
  animation:
    vp-badge-in 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.15) backwards,
    vp-gradient 4s ease-in-out infinite alternate,
    vp-ring 2.2s ease-out 0.8s infinite;
  transition: transform 0.15s ease, filter 0.15s ease;
}

/* Light sweep across the badge */
.vp-unmute-badge::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: vp-shine 3.4s ease-in-out 1.2s infinite;
  pointer-events: none;
}

.vp-unmute:hover .vp-unmute-badge {
  transform: translateY(-1px) scale(1.03);
  filter: brightness(1.08) saturate(1.1);
}

.vp-unmute-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  color: var(--vp-hot-2);
  box-shadow: 0 2px 10px rgba(40, 10, 60, 0.25);
}

.vp-unmute-icon svg { width: 22px; height: 22px; }

.vp-unmute-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(60, 10, 70, 0.25);
}

.vp-unmute-big {
  font-family: var(--font-display, inherit);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.vp-unmute-small {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.9;
}

.vp-if-touch { display: none; }

@media (hover: none) {
  .vp-if-touch { display: inline; }
  .vp-if-mouse { display: none; }
}

.vp-wave1 { animation: vp-wave 1.6s ease-in-out infinite; }
.vp-wave2 { animation: vp-wave 1.6s ease-in-out 0.25s infinite; }

@keyframes vp-wave {
  0%, 100% { opacity: 0; }
  35%, 75% { opacity: 1; }
}

@keyframes vp-badge-in {
  from { opacity: 0; transform: translateX(28px) scale(0.94); }
}

@keyframes vp-gradient {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

@keyframes vp-ring {
  0% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 12px 32px -8px rgba(215, 51, 162, 0.7), 0 0 0 0 rgba(255, 79, 203, 0.6); }
  70%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 12px 32px -8px rgba(215, 51, 162, 0.7), 0 0 0 14px rgba(255, 79, 203, 0); }
}

@keyframes vp-shine {
  0% { transform: translateX(-120%); }
  40%, 100% { transform: translateX(120%); }
}

/* ---------- Big play button ---------- */

.vp-bigplay {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 96px;
  height: 64px;
  margin: -32px 0 0 -48px;
  border-radius: 14px;
  background: var(--vp-accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.15s ease, opacity 0.2s ease, visibility 0s linear 0.2s;
}

.vp-bigplay svg { width: 34px; height: 34px; }
.vp-bigplay:hover { transform: scale(1.06); }

.vp.is-paused:not(.is-starting):not(.is-preview):not(.is-scrubbing):not(.is-error) .vp-bigplay {
  opacity: 1;
  visibility: visible;
  transition: transform 0.15s ease, opacity 0.2s ease, visibility 0s;
}

.vp-bigplay .i-replay,
.vp.is-ended .vp-bigplay .i-play { display: none; }
.vp.is-ended .vp-bigplay .i-replay { display: block; }

/* ---------- Control bar ---------- */

.vp-controls {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 36px 12px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.32) 55%, transparent);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

.vp.is-started.is-active .vp-controls,
.vp.is-started.is-paused .vp-controls,
.vp.is-started.is-scrubbing .vp-controls,
.vp.is-started .vp-controls:has(:focus-visible) {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
}

.vp.is-error .vp-controls { display: none; }

.vp-btn {
  flex: none;
  width: 38px;
  height: 38px;
  padding: 8px;
  border-radius: 9px;
  transition: background 0.15s ease;
}

.vp-btn:hover { background: rgba(255, 255, 255, 0.16); }
.vp-btn[hidden] { display: none; }

.vp-play .i-pause,
.vp.is-playing .vp-play .i-play { display: none; }
.vp.is-playing .vp-play .i-pause { display: block; }

.vp-mute .i-muted,
.vp.is-muted .vp-mute .i-volume { display: none; }
.vp.is-muted .vp-mute .i-muted { display: block; }

.vp-fs .i-exit,
.vp.is-fullscreen .vp-fs .i-enter { display: none; }
.vp.is-fullscreen .vp-fs .i-exit { display: block; }

.vp-cc { position: relative; }
.vp-cc[aria-pressed="false"] { opacity: 0.6; }
.vp-cc[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  right: 11px;
  bottom: 4px;
  left: 11px;
  height: 2px;
  border-radius: 2px;
  background: var(--vp-fill);
}

/* ---------- Progress bar ---------- */

.vp-progress {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 60px;
  height: 28px;
  margin: 0 10px;
  cursor: pointer;
  touch-action: none;
}

.vp-progress:focus-visible { outline-offset: 0; border-radius: 4px; }

.vp-track {
  position: relative;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.28);
  transition: height 0.15s ease;
}

.vp-progress:hover .vp-track,
.vp.is-scrubbing .vp-track { height: 7px; }

.vp-buffered,
.vp-played {
  position: absolute;
  inset: 0;
  transform: scaleX(0);
  transform-origin: left center;
}

.vp-buffered { background: rgba(255, 255, 255, 0.4); }
.vp-played { background: var(--vp-fill); }

.vp-handle {
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  transform: scale(0);
  transition: transform 0.15s ease;
  pointer-events: none;
}

.vp-progress:hover .vp-handle,
.vp-progress:focus-visible .vp-handle,
.vp.is-scrubbing .vp-handle { transform: scale(1); }

.vp-tip {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 6px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.82);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.vp.is-scrubbing .vp-tip { opacity: 1; }

@media (hover: hover) {
  .vp-progress:hover .vp-tip { opacity: 1; }
}

.vp-time {
  flex: none;
  padding: 0 8px 0 2px;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0.92;
}

/* ---------- Volume ---------- */

.vp-volume {
  display: flex;
  flex: none;
  align-items: center;
}

.vp-volume-range {
  width: 0;
  height: 4px;
  margin: 0;
  border-radius: 4px;
  background: linear-gradient(to right, #fff var(--vp-vol, 100%), rgba(255, 255, 255, 0.3) var(--vp-vol, 100%));
  opacity: 0;
  cursor: pointer;
  transition: width 0.2s ease, opacity 0.2s ease, margin 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.vp-volume-range::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}

.vp-volume-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}

.vp-volume-range::-moz-range-track { background: transparent; }

@media (hover: hover) and (pointer: fine) {
  .vp-volume:hover .vp-volume-range,
  .vp-volume:focus-within .vp-volume-range {
    width: 72px;
    margin: 0 8px 0 4px;
    opacity: 1;
  }
}

@media (hover: none) {
  .vp-volume-range { display: none; }
}

/* ---------- Captions ---------- */

.vp-captions {
  position: absolute;
  right: 6%;
  bottom: 7%;
  left: 6%;
  z-index: 2;
  display: none;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  transition: bottom 0.25s ease;
}

.vp.has-captions .vp-captions { display: flex; }

.vp.is-started.is-active .vp-captions,
.vp.is-started.is-paused .vp-captions { bottom: calc(var(--vp-controls-h) + 8px); }

.vp-captions span {
  max-width: 100%;
  padding: 0.12em 0.5em;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.75);
  font-size: clamp(14px, 2.3vw, 24px);
  font-weight: 600;
  line-height: 1.45;
  white-space: pre-line;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.vp.is-fullscreen .vp-captions span { font-size: clamp(18px, 2.4vw, 40px); }

/* ---------- Buffering + errors ---------- */

.vp-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  visibility: hidden;
  animation: vp-spin 0.8s linear infinite;
  pointer-events: none;
}

.vp.is-buffering:not(.is-paused):not(.is-preview) .vp-spinner {
  opacity: 1;
  visibility: visible;
}

@keyframes vp-spin { to { transform: rotate(360deg); } }

.vp-error {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
  font-size: 15px;
  text-align: center;
}

.vp-error[hidden] { display: none; }

/* ---------- Full screen ---------- */

.vp:fullscreen { border-radius: 0; box-shadow: none; }
.vp:-webkit-full-screen { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }

/* ---------- Small players ---------- */

@media (max-width: 560px) {
  .vp { --vp-controls-h: 48px; }
  .vp-controls { gap: 0; padding: 26px 4px 4px; }
  .vp-btn { width: 34px; height: 34px; padding: 7px; }
  .vp-progress { margin: 0 6px; }
  .vp-time { padding: 0 4px 0 0; font-size: 12px; }
  .vp-bigplay { width: 76px; height: 52px; margin: -26px 0 0 -38px; border-radius: 12px; }
  .vp-bigplay svg { width: 28px; height: 28px; }
  .vp-unmute { padding: 10px; }
  .vp-unmute-badge { gap: 8px; padding: 5px 13px 5px 5px; }
  .vp-unmute-icon { width: 30px; height: 30px; }
  .vp-unmute-icon svg { width: 17px; height: 17px; }
  .vp-unmute-big { font-size: 13px; }
  .vp-unmute-small { margin-top: 1px; font-size: 10.5px; }
  .vp.is-paused .vp-captions { display: none; } /* keeps the play button clear on short players */
}

@media (prefers-reduced-motion: reduce) {
  .vp-unmute-badge, .vp-unmute-badge::after, .vp-wave1, .vp-wave2 { animation: none; }
  .vp-wave1, .vp-wave2 { opacity: 1; }
}
