/*
 * Sticky scrolling for the standard Columns block.
 *
 * The chosen column (.qid-is-fixed) stays in view while the other columns scroll,
 * and lets go once the bottom of the tallest column is reached. position: sticky is
 * bounded by the Columns block, which is as tall as its tallest column. It stops
 * working if an ancestor sets overflow (hidden, auto, scroll).
 *
 * align-self: flex-start stops the fixed column stretching to the full height of the
 * block, which would leave it no room to move.
 */
.wp-block-columns.qid-sticky-columns > .wp-block-column.qid-is-fixed {
    position: sticky;
    top: var(--qid-top, 24px);
    align-self: flex-start;
}

/* Columns that stack on small screens are no longer side by side: nothing sticks. */
@media (max-width: 781px) {
    .wp-block-columns.qid-sticky-columns:not(.is-not-stacked-on-mobile) > .wp-block-column.qid-is-fixed {
        position: static;
    }
}
