/* [catture_gallery] — responsive masonry grid */

.lvcore-catture-gallery {
	--lvcore-cg-cols: 2;
	--lvcore-cg-gap:  12px;

	width: 100%;
	min-width: 0;
}

@media (min-width: 768px) {
	.lvcore-catture-gallery {
		--lvcore-cg-cols: 3;
		--lvcore-cg-gap:  16px;
	}
}

@media (min-width: 1200px) {
	.lvcore-catture-gallery {
		--lvcore-cg-cols: 4;
	}
}

/*
 * Masonry takes over once initialised (it positions the items absolutely and
 */
.lvcore-catture-gallery__grid {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 0 var(--lvcore-cg-gap);
	opacity: 0;
	animation: lvcore-cg-reveal .01s 1.5s forwards;
}

.lvcore-catture-gallery.is-ready .lvcore-catture-gallery__grid {
	opacity: 1;
	animation: none;
	transition: opacity .25s ease;
}

@keyframes lvcore-cg-reveal {
	to { opacity: 1; }
}

/* Zero-height measuring elements Masonry reads the column + gutter widths from. */
.lvcore-catture-gallery__sizer,
.lvcore-catture-gallery__gutter {
	position: absolute;
	height: 0;
	visibility: hidden;
	pointer-events: none;
}

.lvcore-catture-gallery__sizer,
.lvcore-catture-gallery__item {
	width: calc((100% - var(--lvcore-cg-gap) * (var(--lvcore-cg-cols) - 1)) / var(--lvcore-cg-cols));
}

.lvcore-catture-gallery__gutter {
	width: var(--lvcore-cg-gap);
}

.lvcore-catture-gallery__item {
	margin: 0 0 var(--lvcore-cg-gap);
	padding: 0;
}

.lvcore-catture-gallery__item img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
}
