/* video-embed-caption — a video-embed with a caption band under the player (see video-embed-caption.html.twig).
   The frame rounds the player and the band together; --video-embed-caption-border adds a thick outer border.
   The wrapper resets video-embed's own box tokens — desktop, tablet and phone (they inherit), so the player fills the frame. */

.video-embed-caption {
    --video-embed-padding: 0;
    --video-embed-gutter: 0;
    --video-embed-max-width: none;
    --video-embed-radius: 0;
    --video-embed-padding-tablet: 0;
    --video-embed-max-width-tablet: none;
    --video-embed-padding-mobile: 0;
    --video-embed-gutter-mobile: 0;
    --video-embed-radius-mobile: 0;
    width: 100%;
    max-width: var(--video-embed-caption-max-width, var(--content-max-width, 1140px));
    margin: var(--video-embed-caption-margin, 0 auto);
    padding: var(--video-embed-caption-padding, 0 15px);
    box-sizing: border-box;
}

.video-embed-caption__frame {
    overflow: hidden;
    border: var(--video-embed-caption-border, 0);
    border-radius: var(--video-embed-caption-radius, 25px);
}

.video-embed-caption__text {
    margin: 0;
    padding: var(--video-embed-caption-text-padding, 25px);
    background: var(--video-embed-caption-bg, var(--color-primary, #000));
    color: var(--video-embed-caption-color, #fff);
    text-align: var(--video-embed-caption-text-align, center);
}

@media (max-width: 767px) {
    .video-embed-caption__text {
        padding-left: var(--video-embed-caption-text-inset-mobile, var(--video-embed-caption-text-padding, 25px));
        padding-right: var(--video-embed-caption-text-inset-mobile, var(--video-embed-caption-text-padding, 25px));
    }
}

@media (min-width: 768px) {
    .video-embed-caption__text {
        padding-left: var(--video-embed-caption-text-inset, 20%);
        padding-right: var(--video-embed-caption-text-inset, 20%);
    }
}

/* a framed video: a thick border and a larger radius round the player and the band together */
.video-embed-caption--framed .video-embed-caption__frame {
    border: var(--video-embed-caption-framed-border, 12px solid var(--color-primary, #000));
    border-radius: var(--video-embed-caption-framed-radius, 40px);
}

.video-embed-caption--framed .video-embed-caption__text {
    padding-top: var(--video-embed-caption-framed-text-padding-y, 25px);
    padding-bottom: var(--video-embed-caption-framed-text-padding-y, 25px);
}

/* the framed look on phones: its own border and radius, the desktop ones without them */
@media (max-width: 767px) {
    .video-embed-caption--framed .video-embed-caption__frame {
        border: var(--video-embed-caption-framed-border-mobile, var(--video-embed-caption-framed-border, 12px solid var(--color-primary, #000)));
        border-radius: var(--video-embed-caption-framed-radius-mobile, var(--video-embed-caption-framed-radius, 40px));
    }
}

/* --- Optional tokens on properties video-embed-caption did not set before ---
   The caption's style (e.g. italic) and size. Their fallback (inherit) is only a placeholder: the rules sit in a
   cascade layer, so with no token they lose to every unlayered rule (a brand's `p { font-size }`…) whatever its
   weight or order, exactly as before they existed. A brand that sets the token gets its value, unless one of its
   own rules sets the same property on the same element. Browsers without cascade layers skip the block. */
@layer video-embed-caption-tokens {
    .video-embed-caption__text {
        font-style: var(--video-embed-caption-text-style, inherit);
        font-size: var(--video-embed-caption-text-size, inherit);
    }
}
