/* KHAJISTAN CAPTIONS — shared Filmfarsi typography and three house skins.
   Recorded films and live captions use the opaque house plates below. Live TV and
   radio use the same neutral semibold face on one fully opaque HTML plate,
   timed by the media clock. Native fullscreen/PiP keeps an accessible TextTrack
   with a light foreground because WebKit may ignore its background color.
   Live blocks are limited to two 42-character lines in kj-captions-live.js.
   System captions opts out of the house native rules completely; the inline
   plate scales to its frame, without a fixed desktop/fullscreen size cap. */
video:not(.kj-system-captions)::cue{
  font-family:'Helvetica Neue',Helvetica,Arial,'Liberation Sans','Noto Sans',sans-serif;
  font-weight:700;
  font-size:1.10em;
  line-height:1.15;
  color:#F3FB04;
  background-color:#000;
  box-shadow:.4em 0 0 #000,-.4em 0 0 #000;
  text-shadow:none;
}
/* System fullscreen/PiP owns its native backdrop. Do not add another plate
   inside it. The inline live player uses the HTML plate below. */
video:not(.kj-system-captions)::cue(.kj-caption){background-color:transparent;box-shadow:none;}
/* Suppress the additional browser window behind house cues. System captions
   keeps the viewer's OS background preferences. The HTML renderer has one plate. */
video:not(.kj-system-captions)::-webkit-media-text-track-display { background:transparent; }
video:not(.kj-system-captions)::-webkit-media-text-track-display-backdrop { background:transparent; }
/* Live TV and radio use a single page-owned plate. Native cues remain for
   system fullscreen and picture-in-picture, where sibling HTML cannot render. */
.kj-caption-frame { container-type:inline-size; }
.captions-audio-line {
  position:absolute; z-index:5; left:0; right:0; bottom:max(calc(6% + 0.1in),env(safe-area-inset-bottom,0px));
  margin:0; padding:0 6%;
  text-align:center; pointer-events:none; background:transparent;
  font:600 max(13px,2.7cqw)/1.25 'Helvetica Neue',Helvetica,Arial,sans-serif;
}
video.kj-live-captions::cue(.kj-caption){font-size:.85em;font-weight:600;}
.captions-audio-line[hidden] { display:none; }
.captions-audio-line > span {
  display:inline-block; max-width:100%; padding:.12em .4em;
  white-space:pre-line; overflow-wrap:anywhere;
  color:#F3FB04; background-color:#000; opacity:1;
  border:0; border-radius:0; box-shadow:none; text-shadow:none; margin:0;
}
/* The inline plate follows the site or the viewer's saved caption skin.
   System fullscreen/PiP retains the legible native yellow-on-dark style above:
   WebKit may ignore ::cue background colors, so a black Day foreground is unsafe.
   Palette source: kj-theme.js. One typography/geometry across all three skins. */
html[data-kj-theme="day"] .captions-audio-line:not([data-kj-caption-skin]) > span,
.captions-audio-line[data-kj-caption-skin="day"] > span{color:#000;background-color:#F3FB04;box-shadow:none;}
html[data-kj-theme="grove"] .captions-audio-line:not([data-kj-caption-skin]) > span,
.captions-audio-line[data-kj-caption-skin="grove"] > span{color:#F3FB04;background-color:#002800;box-shadow:none;}
html[data-kj-theme="smut"] .captions-audio-line:not([data-kj-caption-skin]) > span,
.captions-audio-line[data-kj-caption-skin="smut"] > span{color:#F3FB04;background-color:#6E003F;box-shadow:none;}

/* Recorded subtitle cues use the same plate styles, with each source block kept
   intact. The native renderer remains available for OS preferences, PiP and
   uncommon WebVTT layouts. No timing or language transformation happens here. */
.kjp-captions { position:absolute; inset:0; z-index:5; pointer-events:none; }
.kjp-captions[hidden] { display:none; }
.kjp-caption-stack {
  position:absolute; left:0; right:0;
  bottom:max(calc(6% + 0.1in),env(safe-area-inset-bottom,0px));
  padding:0 6%; display:flex; flex-direction:column; align-items:stretch;
}
.kjp-caption-stack > .captions-audio-line { position:static; padding:0; }

.kjp-caption-stack i { font-style:italic; }
.kjp-caption-stack b { font-weight:700; }
.kjp-caption-stack u { text-decoration:underline; }
