/* Subtitles. The variables are rewritten from the settings by applyStyle() in
   js/subtitles.js; these are the defaults until it runs. Native <track>
   subtitles are styled by the video::cue rules applyStyle() writes. The
   classes below belong to the custom renderer, renderInto(). */
:root {
  --subs-size: 1;
  --subs-color: #fff;
  --subs-bg: transparent;
  --subs-shadow: 0 2px 4px rgba(0, 0, 0, .9), 0 0 2px rgba(0, 0, 0, .9);
  --subs-bottom: 0%;
}

.subs-render {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.subs-box {
  position: absolute;
  left: 5%;
  right: 5%;
  text-align: center;
  font-size: calc(var(--subs-size) * clamp(16px, 4.2vh, 56px));
  line-height: 1.3;
  font-weight: 500;
}
.subs-bottom { bottom: max(var(--subs-bottom), 4%); }
.subs-top { top: 5%; }

.subs-cue {
  display: inline;
  padding: .05em .3em;
  color: var(--subs-color);
  background: var(--subs-bg);
  text-shadow: var(--subs-shadow);
  white-space: pre-wrap;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.subs-cue i { font-style: italic; }
.subs-cue b { font-weight: 700; }

/* Lift the subtitles while the player controls are visible. */
.player:not(.idle) .subs-bottom { bottom: max(var(--subs-bottom), 140px); transition: bottom .2s; }
