/* =============================================================================
   Joy Data Solutions — Video slot and transcript
   =============================================================================
   The click-to-play slot (templates/components/_video.html, static/js/video.js)
   and the transcript that sits under it. Split from line.css, which holds the
   drawing language; this file is only the player. Tokens come from brand.css.
   ============================================================================= */

/* --- Video slot ----------------------------------------------------------
   See templates/components/_video.html. Nothing from a video host loads until
   play is pressed; the pending state is the honest one, not a broken player. */
.video-slot {
    position: relative;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--rule);
    border-radius: var(--radius-l);
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--shadow-m);
}

.video-slot__poster {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-rows: 1fr auto;
}

.video-slot__art {
    display: grid;
    place-items: center;
    padding: 6% 8%;
    color: var(--ink-900);
    background:
        linear-gradient(to right, rgba(14, 74, 71, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(14, 74, 71, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
}

.video-slot__art svg { width: 100%; height: auto; }

.video-slot__node { fill: var(--amber-bright); stroke: none; }

.video-slot__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3rem 0.9rem;
    padding: var(--space-s) var(--space-m);
    border-top: 1px solid var(--rule);
    background: var(--paper);
}

.video-slot__eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--slate-400);
}

.video-slot__title {
    font-family: var(--font-display);
    font-size: var(--step-1);
    font-weight: 500;
    font-variation-settings: 'SOFT' 0, 'WONK' 0, 'opsz' 24;
    letter-spacing: -0.01em;
    color: var(--fg);
}

.video-slot__length {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--slate-400);
}

.video-slot__play,
.video-slot__pending {
    position: absolute;
    left: 50%;
    top: 40%;
    transform: translate(-50%, -50%);
}

.video-slot__play {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.3rem 0.75rem 1.05rem;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--ink-900);
    color: var(--paper);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-l);
    transition: background var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
}

.video-slot__play:hover {
    background: var(--ink-950);
    transform: translate(-50%, -50%) translateY(-1px);
}

.video-slot__pending {
    padding: 0.5rem 0.95rem;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-pill);
    background: rgba(252, 252, 250, 0.92);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--slate-500);
    white-space: nowrap;
}

.video-slot iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* The player fills the slot. Without this a <video> takes its intrinsic
   1920px and a phone shows one cream corner of it while the audio plays. */
.video-slot video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--white);
}

.video-slot.is-playing .video-slot__poster { display: none; }

/* --- Transcript ---------------------------------------------------------
   The captions file as a list under the player. Closed by default, scrolls
   inside itself when open, and video.js marks the line being spoken. */
.video-transcript {
    margin-top: 0.75rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius-l);
    background: var(--white);
}

.video-transcript__toggle {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2rem 0.8rem;
    padding: 0.7rem 1rem;
    cursor: pointer;
    list-style: none;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fg);
}

.video-transcript__toggle::-webkit-details-marker { display: none; }

.video-transcript__toggle::before {
    content: '+';
    width: 1rem;
    color: var(--amber-bright);
    font-weight: 700;
}

.video-transcript[open] .video-transcript__toggle::before { content: '\2212'; }

.video-transcript__hint {
    font-family: inherit;
    font-size: 0.8rem;
    letter-spacing: 0;
    text-transform: none;
    color: var(--slate-400);
}

.video-transcript__cues {
    position: relative;
    margin: 0;
    padding: 0.3rem 0 0.5rem;
    list-style: none;
    max-height: 16rem;
    overflow-y: auto;
    border-top: 1px solid var(--rule);
    scroll-behavior: smooth;
}

.video-transcript__cue button {
    display: grid;
    grid-template-columns: 3rem 1fr;
    gap: 0.75rem;
    width: 100%;
    padding: 0.5rem 1rem;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: left;
    color: var(--slate-600);
    cursor: pointer;
}

.video-transcript__cue button:hover { background: rgba(14, 74, 71, 0.04); color: var(--fg); }

.video-transcript__cue.is-current button {
    color: var(--fg);
    background: rgba(216, 154, 43, 0.12);
    box-shadow: inset 3px 0 0 var(--amber-bright);
}

.video-transcript__time {
    padding-top: 0.2rem;
    font-size: 0.74rem;
    color: var(--slate-400);
}

@media (prefers-reduced-motion: reduce) {
    .video-transcript__cues { scroll-behavior: auto; }
}

