/* Shared media pieces used by several sections: thumbnail frames, section clips, library cards, the six caption
   styles of the LimePlayer player (classic / minimal / outline / yellow / bold / karaoke) and the small unmute pill. */
@layer components {
    /* ---- thumbnails: media.php 'thumbs' (<img class="thumb-img">) or frames of images/thumbs.jpg (4 × 2 sprite) ---- */
    .thumb, .thumb-img { display: block; width: 100%; height: 100%; object-fit: cover; background-color: #10161E; }
    .thumb {
        background-image: url('/images/thumbs.jpg');
        background-size: 400% 200%;
        background-repeat: no-repeat;
    }
    .thumb--0 { background-position: 0 0; }
    .thumb--1 { background-position: 33.333% 0; }
    .thumb--2 { background-position: 66.667% 0; }
    .thumb--3 { background-position: 100% 0; }
    .thumb--4 { background-position: 0 100%; }
    .thumb--5 { background-position: 33.333% 100%; }
    .thumb--6 { background-position: 66.667% 100%; }
    .thumb--7 { background-position: 100% 100%; }

    /* a muted section clip (clip_video()): fills its frame; the poster shows until it plays */
    video[data-clip] { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--surface-film); }
    /* a LimePlayer embed (clip_video() with an id, the hero stage, the playground) */
    iframe.fv-embed { display: block; width: 100%; height: 100%; border: 0; background: var(--surface-film); color-scheme: normal; }
    iframe.fv-embed--bg { pointer-events: none; }   /* a background loop: the section's own buttons sit over it */

    /* ---- a library card (migration grid) ---- */
    .vcard { display: grid; gap: 3px; min-width: 0; }
    .vcard__thumb { position: relative; display: block; aspect-ratio: 16 / 9; margin-bottom: 6px; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line), 0 10px 24px -12px var(--black-a80); }
    .vcard__thumb em { position: absolute; right: 6px; bottom: 6px; padding: 2px 6px; border-radius: 6px; background: var(--black-a70); color: var(--white); font-size: 10.5px; font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; }
    .vcard b { overflow: hidden; color: var(--text); font-size: 13px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
    .vcard small { color: var(--text-3); font-size: 11.5px; font-weight: 600; }
    .vcard.is-new small { color: var(--cyan-300); }

    /* ---- the six caption styles (playground player + its picker faces) ---- */
    .cc { position: absolute; left: 6%; right: 6%; bottom: 15%; z-index: 3; display: grid; justify-items: center; pointer-events: none; transition: bottom .35s var(--ease); }
    .cc__line { grid-area: 1 / 1; max-width: 86%; margin: 0; text-align: center; font-family: var(--font-caption); font-size: clamp(13px, 2.2vw, 22px); line-height: 1.3; opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s var(--ease); }
    .cc__line.is-on { opacity: 1; transform: none; }
    html:not(.js) .cc__line:first-child { opacity: 1; transform: none; }
    .cc__line span { transition: color .15s, opacity .15s, background-color .15s; }

    .cc--classic .cc__line, .ccpick__face.cc--classic span { padding: .14em .5em; border-radius: .3em; background: var(--black-a70); color: var(--white); font-weight: 600; }
    .cc--minimal .cc__line, .ccpick__face.cc--minimal span { color: var(--white); font-weight: 600; text-shadow: 0 1px 3px rgb(0 0 0 / .9), 0 0 12px rgb(0 0 0 / .6); }
    .cc--outline .cc__line, .ccpick__face.cc--outline span { color: var(--white); font-weight: 900; -webkit-text-stroke: .12em #000; paint-order: stroke fill; }
    .cc--yellow .cc__line, .ccpick__face.cc--yellow span { color: var(--yellow-caption); font-weight: 800; text-shadow: 0 2px 4px rgb(0 0 0 / .85); }
    .cc--bold .cc__line, .ccpick__face.cc--bold span { padding: .1em .45em; border-radius: .25em; background: var(--accent, var(--cyan-400)); color: var(--cyan-ink); font-weight: 900; text-transform: uppercase; letter-spacing: .01em; }
    .cc--karaoke .cc__line, .ccpick__face.cc--karaoke span { color: var(--white); font-weight: 900; text-shadow: 0 2px 0 rgb(0 0 0 / .55), 0 0 20px rgb(0 0 0 / .6); }
    .cc--karaoke .cc__line span { opacity: .4; display: inline-block; transition: opacity .15s, color .15s, transform .2s var(--ease); }
    .cc--karaoke .cc__line span.is-said { opacity: 1; }
    .cc--karaoke .cc__line span.is-now { color: var(--accent, var(--cyan-300)); transform: translateY(-1px) scale(1.06); }
    .ccpick__face.cc--karaoke span { background: linear-gradient(90deg, var(--yellow-caption) 50%, var(--white) 50%); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }

    /* ---- the small unmute pill (teaser demo, playground) ---- */
    .unmute--sm { gap: 8px; padding: 4px 14px 4px 4px; font-size: 13px; }
    .unmute--sm .unmute__circle { width: 28px; height: 28px; }
    .unmute--sm .unmute__circle .i { width: 14px; height: 14px; }
}
