/**
 * Sticky Text — left column stays fixed while the sibling gallery scrolls.
 *
 * Sticky is applied to the WPBakery column that contains .evc-sticky-text
 * (not the shortcode itself), so the text stays put without jump under a
 * fixed site header.
 */

/* Row must be a flex container so the sticky column’s containing block
   is as tall as the gallery column. */
.wpb-content-wrapper > .vc_row:has(.evc-sticky-text),
.entry__content > .vc_row:has(.evc-sticky-text),
.vc_row:has(.evc-sticky-text) {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
}

.vc_row:has(.evc-sticky-text) > .wpb_column > .vc_column-inner {
	width: 100%;
	padding-top: 0;
}

.vc_row:has(.evc-sticky-text) > .wpb_column > .vc_column-inner > .wpb_wrapper {
	width: 100%;
	margin-top: 0;
	padding-top: 0;
}

/* Column sticks under the site header (+ optional --evc-sticky-extra). */
.vc_row > .wpb_column:has(.evc-sticky-text) {
	position: sticky;
	top: calc(
		var(--site-header-height, 4.75rem)
		+ var(--work-content-pad-top, 2rem)
		+ var(--evc-sticky-extra, 0px)
	);
	z-index: 2;
	align-self: flex-start;
}

/* Shortcode itself is not sticky — the column owns it. */
.evc-sticky-text {
	position: static;
	top: auto;
	width: 100%;
	box-sizing: border-box;
	padding-right: clamp(0.75rem, 2vw, 1.5rem);
	margin-top: 0;
}

.evc-sticky-text > *:first-child {
	margin-top: 0;
}

.evc-sticky-text > *:last-child {
	margin-bottom: 0;
}

@media (max-width: 767px) {
	.vc_row > .wpb_column:has(.evc-sticky-text) {
		position: static;
		top: auto;
	}

	.evc-sticky-text {
		padding-right: 0;
		margin-bottom: 1.25rem;
	}
}
