/**
 * EDEUS Masonry Container for Elementor.
 *
 * Every rule is gated behind `.edeus-masonry-ready`, which is only added by
 * JavaScript. Without JS (or on an unsupported browser) the container stays a
 * plain, perfectly usable Elementor Grid container.
 *
 * `.edeus-masonry-active` sits on the container element itself.
 * `.edeus-masonry-ready` sits on whichever element actually carries the grid:
 * the container for full-width containers, `.e-con-inner` for boxed ones.
 */

.e-con.edeus-masonry-active.edeus-masonry-ready,
.e-con.edeus-masonry-active > .e-con-inner.edeus-masonry-ready {
	/* Explicit rows would fight the measured spans. */
	grid-template-rows: none;
	/* 1px implicit rows: spans are written in whole pixels, so packing is exact. */
	grid-auto-rows: 1px;
	grid-auto-flow: row;
	align-content: start;
	align-items: start;
}

/*
 * Critical: items must never stretch to fill the rows they span, otherwise
 * measuring their height would feed back into the span that was just written.
 */
.edeus-masonry-ready > .elementor-element {
	align-self: start;
}

/*
 * Editor-only children (empty-container placeholder, inline add-section button)
 * are not grid items we measure, so give them a full-width band of their own.
 */
.edeus-masonry-ready > :not(.elementor-element) {
	grid-column: 1 / -1;
	grid-row-end: span 120;
}
