.ce-image,
.ce-textmedia,
.ce-textpic {
	--gallery-gutter: 2rem;
	display: flex;
	flex-direction: column;
	gap: calc(var(--gallery-gutter) / 2) var(--gallery-gutter);
}

.ce-textmedia.ce-above,
.ce-textmedia.ce-below,
.ce-textpic.ce-above,
.ce-textpic.ce-below {
	flex-direction: column;
}

.ce-image,
.ce-textmedia:not(.ce-above):not(.ce-below) .ce-gallery,
.ce-textpic:not(.ce-above):not(.ce-below) .ce-gallery,
.ce-textmedia:not(.ce-above):not(.ce-below) .ce-bodytext,
.ce-textpic:not(.ce-above):not(.ce-below) .ce-bodytext {
	order: 1;
	/*flex-grow: 1;*/
}

.ce-textpic.ce-right .ce-gallery {
	order: 2 !important;
}

@media (min-width: 992px) {
	.ce-image.columns-1,
	.ce-textmedia.columns-1:not(.ce-above):not(.ce-below),
	.ce-textpic.columns-1:not(.ce-above):not(.ce-below) {
		flex-direction: row;
	}
	
	.ce-textpic.columns-1.ce-left .ce-gallery,
	.ce-textpic.columns-1.ce-right .ce-gallery {
		width: calc(40% - (var(--gallery-gutter) / 2));
	}
	
	.ce-textpic.columns-1.ce-left .ce-bodytext,
	.ce-textpic.columns-1.ce-right .ce-bodytext {
		width: calc(60% - (var(--gallery-gutter) / 2));
	}
}

@media (min-width: 992px) {
	.ce-image,
	.ce-textmedia:not(.ce-above):not(.ce-below),
	.ce-textpic:not(.ce-above):not(.ce-below) {
		flex-direction: row;
	}
	
	.ce-textpic.ce-left .ce-gallery,
	.ce-textpic.ce-right .ce-gallery {
		width: calc(40% - (var(--gallery-gutter) / 2));
	}
	
	.ce-textpic.ce-left .ce-bodytext,
	.ce-textpic.ce-right .ce-bodytext {
		width: calc(60% - (var(--gallery-gutter) / 2));
	}
}

.ce-textpic.ce-below .ce-bodytext {
	margin-bottom: 1rem;
}

.ce-gallery {
	--gallery-gap: var(--gallery-gutter);
	display: flex;
	flex-direction: column;
	gap: var(--gallery-gap);
	width: 100%;
}

.ce-intext .ce-gallery {
	--gallery-gap: calc(var(--gallery-gutter) / 2);
}

.ce-row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--gallery-gap);

	@media(min-width: 768px) {
		flex-wrap: nowrap;
	}
}

.columns-1 {
	--gallery-columns: 1;
}

.columns-2,
.columns-4 {
	--gallery-columns: 2;
}

.columns-3,
.columns-6 {
	--gallery-columns: 3;
}

@media(min-width: 768px) {
	
}

@media(min-width: 992px) {
	.columns-4 {
		--gallery-columns: 4;
	}

}

@media(min-width: 1200px) {
	.columns-6 {
		--gallery-columns: 6;
	}

}

@media(min-width: 1400px) {
	
}

.ce-gallery .ce-column {
	text-align: center;
	width: calc((100% / var(--gallery-columns)) - (var(--gallery-gap) * (var(--gallery-columns) - 1)) / var(--gallery-columns));
}

.ce-center .ce-row {
	justify-content: center;
}

.ce-right .ce-row {
	justify-content: flex-end;
}

figure {
	display: block;
	margin: 0;
}

.ce-col figure {
	margin-bottom: 0;
}

figure figcaption {
	font-size: 0.85rem;
	padding-top: 0.25rem;
	word-wrap: break-word;
}

.ce-border img {
	border: 1px solid var(--color-grey-900);
}

@media(max-width: 767px) {
	.frame-fluid .ce-gallery {
		margin: 0 calc(-1 * var(--gallery-gutter));
	}
}

.glightbox-clean .gslide-title,
.glightbox-clean .gslide-desc {
	color: var(--body-color);
	font-family: inherit;
}
