/* Tutorial: video with chapters, text to read along, step images as one slideshow next to the step text. */

.cb-tutorial {
    margin-bottom: var(--cb-tutorial-gap, 2rem);
}

/* Video and chapter list: side by side from lg, stacked below */
.cb-tutorial-video {
    display: grid;
    gap: var(--cb-tutorial-gap, 2rem);
    margin-bottom: var(--cb-tutorial-gap, 2rem);
}

@media (min-width: 992px) {
    .cb-tutorial-video {
        grid-template-columns: 2fr 1fr;
        align-items: start;
    }
}

.cb-tutorial-player {
    width: 100%;
    border: var(--bs-border-width, 1px) solid var(--cb-tutorial-border-color, var(--bs-border-color));
    border-radius: var(--cb-tutorial-border-radius, var(--bs-border-radius));
    background-color: #000;
}

.cb-tutorial-chapters-heading,
.cb-tutorial-block-heading {
    font-size: var(--cb-tutorial-heading-size, 1.25rem);
    margin-bottom: 0.75rem;
}

.cb-tutorial-chapter-list,
.cb-tutorial-lines {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cb-tutorial-chapter,
.cb-tutorial-line {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    border: var(--bs-border-width, 1px) solid transparent;
    border-radius: var(--cb-tutorial-border-radius, var(--bs-border-radius));
    background: none;
    color: inherit;
    text-align: left;
}

.cb-tutorial-chapter:hover,
.cb-tutorial-line:hover {
    border-color: var(--cb-tutorial-border-color, var(--bs-border-color));
}

/* icon, title and time in their own columns: a long title wraps within its column, the time stays on the right of the
   first line (a floated time dropped below a wrapping title in narrow columns, e.g. next to the topic menu) */
.cb-tutorial-chapter {
    display: grid;
    grid-template-columns: auto 1fr auto;
    column-gap: 0.5rem;
    align-items: baseline;
}

.cb-tutorial-chapter-time {
    color: var(--bs-secondary-color);
}

.cb-tutorial-line.is-active {
    border-color: var(--cb-tutorial-active-color, var(--bs-primary));
    background-color: var(--cb-tutorial-active-bg, var(--bs-primary-bg-subtle));
}

.cb-tutorial-line > :last-child {
    margin-bottom: 0;
}

/* Text to read along */
.cb-tutorial-transcript {
    margin-bottom: var(--cb-tutorial-gap, 2rem);
    border: var(--bs-border-width, 1px) solid var(--cb-tutorial-border-color, var(--bs-border-color));
    border-radius: var(--cb-tutorial-border-radius, var(--bs-border-radius));
}

.cb-tutorial-transcript-summary {
    padding: 1rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
}

.cb-tutorial-transcript-body {
    padding: 0 1.25rem 1rem;
}

/* Steps: slideshow left, step text right from lg */
.cb-tutorial-steps {
    display: grid;
    gap: var(--cb-tutorial-gap, 2rem);
}

/* grid items default to min-width: auto; the scrolling thumbnail strip would widen its column to all thumbnails */
.cb-tutorial-gallery,
.cb-tutorial-text {
    min-width: 0;
}

@media (min-width: 992px) {
    .cb-tutorial-steps {
        grid-template-columns: 7fr 5fr;
        align-items: start;
    }
}

.cb-tutorial-stage {
    margin: 0;
}

.cb-tutorial-stage-button {
    display: block;
    width: 100%;
    padding: 0;
    border: var(--bs-border-width, 1px) solid var(--cb-tutorial-border-color, var(--bs-border-color));
    border-radius: var(--cb-tutorial-border-radius, var(--bs-border-radius));
    background: none;
    cursor: zoom-in;
    overflow: hidden;
}

.cb-tutorial-stage-image {
    display: block;
    width: 100%;
    height: auto;
}

.cb-tutorial-caption {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 0;
}

.cb-tutorial-caption-note {
    color: var(--bs-secondary-color);
}

.cb-tutorial-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.cb-tutorial-thumbs {
    position: relative;
    display: flex;
    gap: 0.5rem;
    margin: 0;
    padding: 0 0 0.5rem;
    list-style: none;
    overflow-x: auto;
}

.cb-tutorial-thumb {
    display: block;
    flex-shrink: 0;
    width: var(--cb-tutorial-thumb-width, 7rem);
    padding: 0;
    border: 3px solid transparent;
    border-radius: var(--cb-tutorial-border-radius, var(--bs-border-radius));
    background: none;
    opacity: 0.7;
}

.cb-tutorial-thumb img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: calc(var(--cb-tutorial-border-radius, var(--bs-border-radius)) - 2px);
}

.cb-tutorial-thumb.is-active,
.cb-tutorial-thumb:hover {
    border-color: var(--cb-tutorial-active-color, var(--bs-primary));
    opacity: 1;
}

.cb-tutorial-watch {
    margin: 0.5rem 0 1.5rem;
}

/* Full-size dialog */
.cb-tutorial-dialog {
    width: min(96vw, 1400px);
    max-height: 96vh;
    overflow-y: auto;
    padding: 1rem;
    border: 0;
    border-radius: var(--cb-tutorial-border-radius, var(--bs-border-radius));
    background-color: #111;
    color: #fff;
}

.cb-tutorial-dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.8);
}

.cb-tutorial-dialog-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.cb-tutorial-dialog-bar .btn-close {
    margin-left: auto;
}

.cb-tutorial-dialog-figure {
    margin: 0;
}

.cb-tutorial-dialog-image {
    display: block;
    max-width: 100%;
    max-height: 72vh;
    margin: 0 auto;
}

.cb-tutorial-dialog .cb-tutorial-caption-note {
    color: rgba(255, 255, 255, 0.75);
}

/* the step text of "Schritt für Schritt" below the image (taken from the page, see frontend.js) */
.cb-tutorial-dialog:has(.cb-tutorial-caption-detail) .cb-tutorial-dialog-image {
    max-height: 60vh;
}

.cb-tutorial-caption-detail {
    max-width: 60rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    line-height: 1.5;
}

.cb-tutorial-caption-detail > :last-child {
    margin-bottom: 0;
}

.cb-tutorial-chapter:focus-visible,
.cb-tutorial-line:focus-visible,
.cb-tutorial-thumb:focus-visible,
.cb-tutorial-stage-button:focus-visible,
.cb-tutorial-transcript-summary:focus-visible {
    outline: 0;
    box-shadow: var(--cb-tutorial-focus-shadow, 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25));
}

/* source label (fiz_ai_label) on the video: above the player's control bar, which takes the lower edge */
.cb-tutorial-player-frame .fiz-ai-label-group {
    bottom: var(--cb-tutorial-label-bottom, 3.5rem);
}

/* the dialog image is centred and narrower than the dialog: the frame shrinks to it, so the label sits on the image */
.cb-tutorial-dialog-frame {
    width: fit-content;
    margin: 0 auto;
}
