
/*
 * The Elstree Project – Interactive Transcript
 * v0.2.0
 *
 * Intentionally inherits the site's typography and most colours.
 * The plugin defines only the structural styling needed for the player.
 */

.eit-player {
    --eit-surface: var(--wp--preset--color--base, #ffffff);
    --eit-text: var(--wp--preset--color--contrast, currentColor);
    --eit-accent: var(
        --wp--preset--color--accent-1,
        var(--wp--preset--color--primary, #8b1e2d)
    );
    --eit-soft-accent: color-mix(in srgb, var(--eit-accent) 14%, transparent);
    --eit-border: color-mix(in srgb, currentColor 18%, transparent);

    width: 100%;
    max-width: none;
    margin: 1.5rem 0 2.5rem;
    color: inherit;
    font: inherit;
}

.eit-player *,
.eit-player *::before,
.eit-player *::after {
    box-sizing: border-box;
}

/* v0.2: video and transcript are stacked, not side by side. */
.eit-layout {
    display: block;
    width: 100%;
}

.eit-video-column,
.eit-transcript-panel {
    width: 100%;
    max-width: none;
}

/* Full-width 16:9 FrameRate player. */
.eit-video-column {
    background: transparent;
}

.eit-video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

.eit-framerate {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* A very quiet status line so it doesn't fight with the site's design. */
.eit-player-status {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 2.1rem;
    padding: .45rem .1rem .2rem;
    color: inherit;
    opacity: .65;
    font: inherit;
    font-size: .78em;
}

.eit-status-dot {
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: currentColor;
    opacity: .35;
    flex: 0 0 auto;
}

.eit-status-dot.is-ready {
    background: var(--eit-accent);
    opacity: 1;
}

.eit-time {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

/* Transcript occupies exactly the same width as the video. */
.eit-transcript-panel {
    margin-top: 1.1rem;
    color: inherit;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: .25rem;
    overflow: hidden;
}

.eit-transcript-heading {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-end;
    padding: 1.15rem 1.35rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .18);
    background: transparent;
}

.eit-kicker {
    display: block;
    margin-bottom: .28rem;
    color: #ffffff;
    font: inherit;
    font-size: .72em;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.eit-transcript-heading h2 {
    margin: 0;
    color: #ffffff;
    font: inherit;
    font-size: clamp(1.3rem, 2.1vw, 2rem);
    font-weight: 600;
    line-height: 1.18;
}

.eit-transcript-note {
    max-width: 13rem;
    color: #ffffff;
    opacity: .72;
    font: inherit;
    font-size: .76em;
    line-height: 1.35;
    text-align: right;
}

.eit-transcript {
    width: 100%;
    height: min(58vh, 650px);
    overflow-y: auto;
    padding: 1.4rem 1.55rem 2.4rem;
    color: #ffffff;
    background: transparent;
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

.eit-speaker {
    margin: 1.45rem 0 .45rem;
    color: #ffffff;
    font: inherit;
    font-size: .78em;
    font-weight: 750;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.eit-speaker:first-child {
    margin-top: 0;
}

.eit-paragraph {
    margin: 0 0 1rem !important;
    color: #ffffff;
    font: inherit;
    font-size: 1em;
    line-height: 1.72;
}

.eit-word {
    border-radius: .18rem;
    padding: .03em .04em .08em;
    cursor: pointer;
    transition: background-color .08s linear, box-shadow .08s linear;
}

.eit-word:hover {
    background: rgba(255, 255, 255, .12);
}

.eit-word.is-active {
    background: rgba(255, 255, 255, .18);
    box-shadow: inset 0 -.14em 0 #ffffff;
}

.eit-word:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.eit-error {
    padding: 1rem;
    border: 1px solid currentColor;
}

@supports not (background: color-mix(in srgb, black 10%, transparent)) {
    .eit-player {
        --eit-soft-accent: rgba(139, 30, 45, .12);
        --eit-border: rgba(0, 0, 0, .14);
    }
}

@media (max-width: 700px) {
    .eit-transcript-heading {
        display: block;
        padding: 1rem;
    }

    .eit-transcript-note {
        max-width: none;
        margin-top: .45rem;
        text-align: left;
    }

    .eit-transcript {
        height: 55vh;
        padding: 1.1rem 1rem 2rem;
    }
}

/* v0.2.1: dark-site treatment for The Elstree Project */
.eit-transcript-panel,
.eit-transcript-heading,
.eit-transcript {
    background: transparent !important;
}

.eit-transcript-panel,
.eit-transcript-panel h2,
.eit-transcript,
.eit-paragraph,
.eit-speaker,
.eit-transcript-note,
.eit-kicker {
    color: #ffffff !important;
}

.eit-word:hover {
    background: rgba(255, 255, 255, .12) !important;
}

.eit-word.is-active {
    background: rgba(255, 255, 255, .18) !important;
    box-shadow: inset 0 -.14em 0 #ffffff !important;
}


/* v0.3.3: shorter transcript viewport so the video remains visible */
.eit-transcript {
    height: clamp(260px, 38vh, 420px) !important;
}

@media (max-width: 700px) {
    .eit-transcript {
        height: clamp(240px, 36vh, 380px) !important;
    }
}


/* v0.3.4: more restrained interview title */
.eit-transcript-heading h2 {
    font-size: clamp(1rem, 1.35vw, 1.35rem) !important;
    line-height: 1.25 !important;
    font-weight: 600 !important;
}


/* v0.3.5: compact transcript header and shallower transcript viewport */
.eit-transcript-panel {
    margin-top: .65rem !important;
}

.eit-transcript-heading {
    padding: .65rem 1.1rem .6rem !important;
    gap: 1rem !important;
    align-items: center !important;
}

.eit-kicker {
    margin-bottom: .15rem !important;
    font-size: .62em !important;
    line-height: 1.1 !important;
}

.eit-transcript-heading h2 {
    font-size: clamp(.98rem, 1.05vw, 1.12rem) !important;
    line-height: 1.18 !important;
    font-weight: 600 !important;
}

.eit-transcript-note {
    font-size: .68em !important;
    line-height: 1.25 !important;
}

.eit-transcript {
    height: clamp(190px, 24vh, 240px) !important;
    padding-top: 1rem !important;
    padding-bottom: 1.25rem !important;
}

@media (max-width: 700px) {
    .eit-transcript-heading {
        padding: .7rem .9rem !important;
    }

    .eit-transcript {
        height: clamp(210px, 30vh, 280px) !important;
    }
}
