/* <ba-player>: see js/ba-player.js. Sizes are in the app's canvas pixels: 1cqw/10.8 is 1 px of a 1080 px wide video.
   Before the script runs, a slider shows its half-way frame. */
ba-player {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  container-type: inline-size;
  background: #e9ecf2; /* shows only while the photos load: they always cover the frame */
  -webkit-user-select: none;
  user-select: none;
}
ba-player[format="4:5"] { aspect-ratio: 1080 / 1350; }
ba-player[format="9:16"] { aspect-ratio: 1080 / 1920; }
ba-player[mode=side-by-side],
ba-player[mode=top-bottom] { background: #fff; }
ba-player[interactive] { cursor: ew-resize; touch-action: pan-y; }
ba-player[interactive][direction=vertical] { cursor: ns-resize; touch-action: pan-x; }

ba-player img[slot] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  display: block;
}
ba-player:not(:defined) img[slot=after] { clip-path: inset(0 50% 0 0); }
ba-player[mode=crossfade]:not(:defined) img[slot=after] { clip-path: none; opacity: 0; }

ba-player .ba-layer { position: absolute; inset: 0; overflow: hidden; }
ba-player .ba-fill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
ba-player .ba-shade { position: absolute; inset: 0; background: #000; }

/* LabelOverlay: Helvetica, black on white, 0.1 em side padding, 20 px from the edge; 74.4 px at the default size. */
ba-player .ba-label {
  position: absolute;
  margin: calc(20cqw / 10.8);
  padding: 0 calc(var(--ba-label, 74.4) * 0.1cqw / 10.8);
  font: 400 calc(var(--ba-label, 74.4) * 1cqw / 10.8) / 1.15 Helvetica, "Helvetica Neue", Arial, sans-serif;
  white-space: nowrap;
  color: #000;
  background: #fff;
}

/* LogoOverlay: 3% of the width from the edges. */
ba-player .ba-logo { position: absolute; margin: 3cqw; pointer-events: none; }
ba-player .ba-logo > img { width: 100%; height: 100%; object-fit: contain; display: block; }

ba-player svg.ba-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
