/** Gutenberg Motion Studio — scoped scroll mechanics for Video and Video Cover blocks. */
figure.gms-video-scroll.gms-is-active video {
    display: block;
    max-width: 100%;
    object-fit: var(--gms-object-fit, contain);
}
.gms-pin-track {
    position: relative;
    width: 100%;
    min-width: 0;
    height: calc(100vh + var(--gms-scroll-range, 200vh));
}
.gms-pin-holder {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    min-width: 0;
}
.gms-pin-holder > figure.gms-video-scroll {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    margin-top: 0;
    margin-bottom: 0;
}
.gms-pin-holder figure.gms-video-scroll video {
    width: 100%;
    max-height: 100vh;
    object-fit: var(--gms-object-fit, contain);
}
figure.gms-video-scroll.gms-is-active video:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

/* Cover is a genuine viewport-filling crop when the pin stage is active. */
.gms-pin-holder figure.gms-video-scroll.gms-fit-cover video {
    height: 100vh;
    max-height: 100vh;
    object-fit: cover;
}

/*
 * Full-bleed Video Cover: escape centered classic-theme content widths.
 * This stylesheet runs only on the frontend: Gutenberg's editor canvas uses
 * WordPress's own full-alignment layout, rather than the browser viewport.
 * The wrapper created for a pinned cover receives the alignment class too.
 */
.wp-block-gms-video-cover.alignfull:not(.gms-is-pinned),
.gms-pin-track--cover.alignfull {
    position: relative !important;
    box-sizing: border-box;
    /* CSS fallback works for centered themes; a tiny frontend layout sync also
       corrects asymmetric theme containers and scrollbar-width differences. */
    left: var(--gms-bleed-offset, 0px) !important;
    width: var(--gms-bleed-width, 100vw) !important;
    min-width: var(--gms-bleed-width, 100vw) !important;
    max-width: none !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
}

/* Once pinned, the TRACK handles viewport width, not the inner cover. */
.gms-pin-holder > .wp-block-gms-video-cover.alignfull {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
