/* Videospeler. Alle regels vallen onder .vp, dus er is geen conflict met de rest van je site. */

.vp {
  --accent: #19b5a5;   /* wordt overschreven via data-accent */
  --ctl: 44px;         /* knopgrootte, via data-size */
  --r: 14px;           /* hoekafronding, via data-radius */
  --barh: 35px;        /* hoogte van de zwarte balk */
  --arn: 1.7778;       /* beeldverhouding als getal, door player.js ingevuld */

  position: relative;
  box-sizing: border-box;
  width: 100%;
  background: #000;
  border-radius: var(--r);
  overflow: hidden;
  color: #fff;
  font-size: 17px;
  line-height: 1.1;
  font-family: 'Roboto', system-ui, -apple-system, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.vp *, .vp *::before, .vp *::after { box-sizing: border-box; }

.vp-box { width: 100%; }

/* Beeld */
.vp-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  cursor: pointer;
}
.vp-stage:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.vp video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.vp-poster {
  position: absolute;
  inset: 0;
  display: none;
  background: #000 center / contain no-repeat;
  pointer-events: none;
}
.vp-poster.on { display: block; }

.vp-ind {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--ctl) * 1.6);
  height: calc(var(--ctl) * 1.6);
  transform: translate(-50%, -50%);
  display: none;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  pointer-events: none;
}
.vp-ind.on { display: grid; }
.vp-ind svg { width: 75%; height: 75%; margin-left: 3%; fill: currentColor; }

.vp-msg {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  font-size: 1rem;
  pointer-events: none;
}
.vp-msg.on { display: flex; }

/* Zwarte balk onder de video */
.vp-bar {
  display: flex;
  align-items: center;
  height: var(--barh);
  padding: 0 0px 0 14px;
  background: #000;
}
.vp-row { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; }
.vp-time {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.vp-full {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--ctl);
  height: var(--ctl);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #fff;
  cursor: pointer;
}
.vp-full svg { width: 55%; height: 55%; fill: currentColor; }
.vp-full:focus-visible, .vp-seek:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Voortgangsbalk */
.vp-seek {
  flex: 1;
  min-width: 0;
  height: 24px;
  margin: 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  touch-action: none;
}
.vp-seek::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 5px;
  background: linear-gradient(to right, var(--accent) var(--p, 0%), rgba(255,255,255,.35) var(--p, 0%));
}
.vp-seek::-moz-range-track {
  height: 5px;
  border-radius: 5px;
  background: linear-gradient(to right, var(--accent) var(--p, 0%), rgba(255,255,255,.35) var(--p, 0%));
}
.vp-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: #fff;
}
.vp-seek::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; }

/* Volledig scherm: beeld behoudt de gekozen beeldverhouding (standaard 16:9) op elk scherm */
.vp.fs {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.vp.fs .vp-box {
  width: min(100%, calc((100vh - var(--barh) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) * var(--arn)));
  width: min(100%, calc((100dvh - var(--barh) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) * var(--arn)));
}
