.youtube-video {
    --youtube-video-accent: #5f7a4f;
    --youtube-video-overlay: rgba(0, 0, 0, 0.72);
    width: 100%;
    max-width: 80rem;
    min-width: 0;
    container-type: inline-size;
}

.youtube-video__stage {
    position: relative;
    display: grid;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 0.5rem;
    background: #242621;
    color: #fff;
}

.youtube-video__preview,
.youtube-video__player {
    width: 100%;
    height: 100%;
    border: 0;
}

.youtube-video__preview {
    position: absolute;
    inset: 0;
    object-fit: cover;
}

.youtube-video__consent {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    min-width: 0;
    padding: clamp(1rem, 4vw, 3rem);
    background: var(--youtube-video-overlay);
    text-align: center;
}

.youtube-video__consent-inner {
    max-width: 46rem;
}

.youtube-video__privacy,
.youtube-video__no-preview,
.youtube-video__javascript-note {
    margin: 0 0 1rem;
    color: inherit;
    line-height: 1.5;
}

.youtube-video__privacy a,
.youtube-video__external-link {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.youtube-video__privacy a:focus-visible,
.youtube-video__external-link:focus-visible,
.youtube-video__load:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.youtube-video .youtube-video__load {
    display: none;
    margin-bottom: 0.9rem;
}

.youtube-video.youtube-video--js .youtube-video__load {
    display: inline-flex;
}

.youtube-video__external-link {
    display: block;
    width: fit-content;
    margin: 0 auto;
}

.youtube-video__placeholder {
    display: grid;
    place-items: center;
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 1rem;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.youtube-video__play-icon {
    width: 0;
    height: 0;
    margin-left: 0.35rem;
    border-top: 0.8rem solid transparent;
    border-bottom: 0.8rem solid transparent;
    border-left: 1.25rem solid currentColor;
}

@container (max-width: 42rem) {
    .youtube-video__stage {
        display: flex;
        flex-direction: column;
        aspect-ratio: auto;
        border: 1px solid rgba(0, 0, 0, 0.1);
        background: #242621;
    }

    .youtube-video__preview {
        position: relative;
        inset: auto;
        flex: 0 0 auto;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .youtube-video__consent {
        flex: 1 1 auto;
        padding: 1.25rem;
        background: #242621;
    }

    .youtube-video__privacy,
    .youtube-video__no-preview,
    .youtube-video__javascript-note {
        margin-bottom: 0.75rem;
        font-size: 0.9rem;
        line-height: 1.45;
    }

    .youtube-video .youtube-video__load {
        max-width: 100%;
        margin-bottom: 0.75rem;
        padding: 0.65rem 1rem;
        font-size: 0.8rem;
    }

    .youtube-video__external-link {
        font-size: 0.85rem;
    }

    .youtube-video--loaded .youtube-video__stage {
        display: grid;
        aspect-ratio: 16 / 9;
        border: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .youtube-video__load {
        transition: none;
    }
}
