/* Video slideshow. Tokens come from styles.css, each with a fallback. */

.wb-slideshow {
  --sl-bg: var(--bg, #0d1014);
  --sl-bg-2: var(--bg-2, #141920);
  --sl-line: var(--line, #29313c);
  --sl-text: var(--text, #e6ebf0);
  --sl-muted: var(--text-muted, #9aa6b2);
  --sl-mint: var(--mint, #7fe0c0);
  --sl-focus: var(--focus, #ffffff);
  display: block;
  min-width: 0;
  width: 100%;
}

/* ---- no JS (or JS failed): stacked clips with native controls ---- */
.wb-slideshow:not(.is-enhanced) video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 0 0 var(--s-3, 0.75rem);
  background: var(--sl-bg);
  border: 1px solid var(--sl-line);
  border-radius: var(--radius, 14px);
}

/* ---- enhanced ---- */
.wb-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--sl-bg);
  border: 1px solid var(--sl-line);
  border-radius: var(--radius, 14px);
}
.wb-clip { display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--sl-bg); }
.wb-clip.is-active { display: block; }

/* progress bar across the stage, fills left to right */
.wb-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgb(230 235 240 / 0.18); pointer-events: none; }
.wb-bar-fill { width: 100%; height: 100%; background: var(--sl-mint); transform: scaleX(0); transform-origin: left center; will-change: transform; }

/* controls: dots first and centred, then the buttons */
.wb-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: var(--s-2, 0.5rem);
  margin-top: var(--s-2, 0.5rem);
}
.wb-dots { display: flex; justify-content: center; flex-wrap: wrap; }
.wb-btns { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--s-2, 0.5rem); }

/* each dot has a >= 44px hit area; the visible dot is drawn by ::before */
.wb-dot {
  appearance: none;
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  touch-action: manipulation;
}
.wb-dot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: transparent;
  border: 1.5px solid var(--sl-muted);
  transition: width 220ms var(--ease, ease), background-color 220ms ease, border-color 220ms ease;
}
.wb-dot:hover::before { border-color: var(--sl-text); }
.wb-dot[aria-current="true"]::before { width: 1.5rem; background: var(--sl-mint); border-color: var(--sl-mint); }
.wb-dot:focus-visible { outline: 3px solid var(--sl-focus); outline-offset: -4px; border-radius: 10px; }

.wb-btn {
  appearance: none;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.4rem 1.1rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--sl-text);
  background: var(--sl-bg-2);
  border: 1px solid var(--sl-line);
  border-radius: var(--radius-pill, 999px);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.wb-btn:hover { border-color: var(--sl-muted); }
.wb-btn:focus-visible { outline: 3px solid var(--sl-focus); outline-offset: 2px; }
.wb-toggle { min-width: 5.5rem; }

@media (min-width: 40rem) {
  .wb-controls { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); justify-items: stretch; }
  .wb-controls .wb-dots { grid-column: 2; grid-row: 1; }
  .wb-controls .wb-btns { grid-column: 3; grid-row: 1; justify-content: flex-end; }
}

.wb-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .wb-dot::before, .wb-btn { transition: none; }
}
