/* KHAJISTAN CAPTIONS — shared Filmfarsi typography and three house skins.
   Recorded films and live captions use the opaque house plates below, unless the
   viewer picks the "Yellow text" style (end of this file). 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; }
/* Urdu, Persian and Arabic subtitles. System faces only; no font file
   ships (the same stacks as kj-tv-room.css and kj-chat.css). Urdu is Nastaliq, whose tails
   need the taller line; Persian and Arabic are Naskh. Same plate, 42 x 2, centred. */
.captions-audio-line > span:lang(ur){
  font-family:'Noto Nastaliq Urdu','Jameel Noori Nastaleeq','Urdu Typesetting','Noto Naskh Arabic','Geeza Pro',serif;
  font-weight:400; line-height:1.9; padding:.05em .4em .2em;
}
.captions-audio-line > span:lang(fa),
.captions-audio-line > span:lang(ar){
  font-family:'Noto Naskh Arabic','Geeza Pro','Segoe UI',Tahoma,serif;
  font-weight:600; line-height:1.5;
}
.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; }

/* "Yellow text" caption style: yellow letters with a black edge and no plate, for
   viewers who choose it. It is a fifth value of the device caption style
   (localStorage kj-caption-skin = "text"), set from the film player, the receiver's
   subtitle row or the live captions' Style button. The renderers put
   data-kj-caption-skin="text" on each caption line and on the <video> for native
   fullscreen cues (on <html> on video.html, whose cues are all native). Default
   stays the plate. */
.captions-audio-line[data-kj-caption-skin="text"] > span{
  color:#F3FB04; background-color:transparent; box-shadow:none;
  text-shadow:
    calc(-1 * max(1px,.06em)) calc(-1 * max(1px,.06em)) 0 #000, max(1px,.06em) calc(-1 * max(1px,.06em)) 0 #000,
    calc(-1 * max(1px,.06em)) max(1px,.06em) 0 #000, max(1px,.06em) max(1px,.06em) 0 #000,
    0 calc(-1 * max(1.2px,.07em)) 0 #000, 0 max(1.2px,.07em) 0 #000,
    calc(-1 * max(1.2px,.07em)) 0 0 #000, max(1.2px,.07em) 0 0 #000,
    0 .1em .3em rgba(0,0,0,.85);
}
video[data-kj-caption-skin="text"]:not(.kj-system-captions)::cue,
html[data-kj-caption-skin="text"] video:not(.kj-system-captions)::cue{
  color:#F3FB04; background-color:transparent; box-shadow:none;
  text-shadow:
    calc(-1 * max(1px,.06em)) calc(-1 * max(1px,.06em)) 0 #000, max(1px,.06em) calc(-1 * max(1px,.06em)) 0 #000,
    calc(-1 * max(1px,.06em)) max(1px,.06em) 0 #000, max(1px,.06em) max(1px,.06em) 0 #000,
    0 calc(-1 * max(1.2px,.07em)) 0 #000, 0 max(1.2px,.07em) 0 #000,
    calc(-1 * max(1.2px,.07em)) 0 0 #000, max(1.2px,.07em) 0 0 #000,
    0 .1em .3em #000;
}
