@charset "UTF-8";

.grav-youtube-subs {
    margin-bottom: 1rem;
}

/* 16:9 box the player iframe fills; the caption sits on top of it. */
.grav-youtube-subs__stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.grav-youtube-subs__stage iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Overlay caption (.srt): centred above YouTube's control bar, clicks pass through. */
.grav-youtube-subs__caption {
    visibility: hidden;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14%;
    width: fit-content;
    max-width: 90%;
    margin: 0 auto;
    padding: 0.2em 0.6em;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: clamp(0.85rem, 2.2vw, 1.25rem);
    line-height: 1.4;
    text-align: center;
    white-space: pre-line;
    pointer-events: none;
}

.grav-youtube-subs__caption.is-visible {
    visibility: visible;
}

/* Section list (.sections) below the video. */
.grav-youtube-subs__time,
.grav-youtube-subs__mono {
    font-family: monospace;
}

.grav-youtube-subs__time {
    margin-top: 0.5rem;
}

.grav-youtube-subs__sections {
    list-style-type: none;
    padding-left: 0;
    margin-left: 0;
}

.grav-youtube-subs__sections a[data-seek] {
    font-family: monospace;
}

.grav-youtube-subs__sections li::before {
    content: "\2022  ";
    display: inline-block;
    width: 1em;
    margin-right: 0.5em;
}

.grav-youtube-subs__sections li.waiting::before {
    content: "\23F3";
}

.grav-youtube-subs__sections li.active {
    font-weight: bold;
    color: rgb(48, 133, 238);
}

.grav-youtube-subs__sections li.active::before {
    content: "\25B6  ";
}
