.efmg-gallery-wrap {
	width: 100%;
	margin-right: auto;
	margin-left: auto;
}

.efmg-gallery {
	--efmg-columns: 4;
	--efmg-columns-tablet: var(--efmg-columns);
	--efmg-columns-mobile: 1;
	--efmg-gap: 12px;
	--efmg-gap-tablet: var(--efmg-gap);
	--efmg-gap-mobile: var(--efmg-gap-tablet);
	--efmg-row-height: 160px;
	--efmg-row-height-tablet: var(--efmg-row-height);
	--efmg-row-height-mobile: var(--efmg-row-height-tablet);
	--efmg-current-columns: var(--efmg-columns);
	--efmg-current-gap: var(--efmg-gap);
	--efmg-current-row-height: var(--efmg-row-height);
	display: grid;
	grid-template-columns: repeat(var(--efmg-current-columns), minmax(0, 1fr));
	grid-auto-rows: var(--efmg-current-row-height);
	grid-auto-flow: dense;
	gap: var(--efmg-current-gap);
	width: 100%;
}

.efmg-gallery__item {
	display: flex;
	flex-direction: column;
	grid-column: span var(--efmg-col-span-desktop, 1);
	grid-row: span var(--efmg-row-span, 1);
	min-width: 0;
	min-height: 0;
	margin: 0;
}

.efmg-gallery__link,
.efmg-gallery__media {
	display: block;
	flex: 1 1 auto;
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
	border-radius: 0;
	overflow: hidden;
}

.efmg-gallery__image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	border: 0;
	border-radius: 0 !important;
	box-shadow: none;
	object-fit: cover;
	object-position: center center;
}

.efmg-gallery--masonry.efmg-gallery--ready {
	position: relative;
	display: block;
}

.efmg-gallery--masonry.efmg-gallery--ready .efmg-gallery__item {
	position: absolute;
	top: 0;
	left: 0;
	will-change: transform;
}

.efmg-gallery--masonry.efmg-gallery--ready .efmg-gallery__link,
.efmg-gallery--masonry.efmg-gallery--ready .efmg-gallery__media {
	height: 100%;
}

.efmg-gallery--masonry.efmg-gallery--ready .efmg-gallery__image {
	height: 100%;
	object-fit: cover;
}

.efmg-gallery__caption {
	margin: 8px 0 0;
	font-size: 16px;
	line-height: 1.35;
}

.efmg-gallery__editor-placeholder,
.efmg-gallery__editor-warning {
	padding: 12px 14px;
	border: 1px solid #d5d8dc;
	background: #ffffff;
	color: #1f2933;
	font-size: 13px;
	line-height: 1.45;
}

.efmg-gallery__editor-warning {
	margin-top: 10px;
	border-color: #dba617;
	background: #fff8e5;
}

@media (max-width: 1024px) {
	.efmg-gallery {
		--efmg-current-columns: var(--efmg-columns-tablet);
		--efmg-current-gap: var(--efmg-gap-tablet);
		--efmg-current-row-height: var(--efmg-row-height-tablet);
	}

	.efmg-gallery__item {
		grid-column: span var(--efmg-col-span-tablet, 1);
	}
}

@media (max-width: 767px) {
	.efmg-gallery {
		--efmg-current-columns: var(--efmg-columns-mobile);
		--efmg-current-gap: var(--efmg-gap-mobile);
		--efmg-current-row-height: var(--efmg-row-height-mobile);
		grid-template-columns: repeat(var(--efmg-current-columns), minmax(0, 1fr));
	}

	.efmg-gallery__item {
		grid-column: span var(--efmg-col-span-mobile, 1);
		grid-row: span 1;
	}
}
