.wdmg-gallery {
	column-count: var(--wdmg-columns-desktop, 4);
	column-gap: var(--wdmg-gap, 20px);
	width: 100%;
}

.wdmg-item {
	position: relative;
	display: inline-block;
	break-inside: avoid;
	width: 100%;
	margin: 0 0 var(--wdmg-gap, 20px);
	padding: 0;
	vertical-align: top;
	overflow: hidden;
	border-radius: var(--wdmg-radius, 0);
}

.wdmg-link {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: inherit;
	line-height: 0;
}

.wdmg-image {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
	border-radius: inherit;
	transition: transform 350ms ease;
}

.wdmg-item:hover .wdmg-image,
.wdmg-item:focus-within .wdmg-image {
	transform: scale(var(--wdmg-scale, 1.03));
}

.wdmg-overlay {
	position: absolute;
	inset: 0;
	background: var(--wdmg-overlay, rgba(0, 0, 0, 0.28));
	opacity: 0;
	transition: opacity 250ms ease;
	pointer-events: none;
}

.wdmg-item:hover .wdmg-overlay,
.wdmg-item:focus-within .wdmg-overlay {
	opacity: 1;
}

.wdmg-caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	display: block;
	padding: 12px 14px;
	background: var(--wdmg-caption-bg, rgba(0, 0, 0, 0.72));
	color: var(--wdmg-caption-color, #fff);
	font-size: var(--wdmg-caption-size, 14px);
	line-height: 1.35;
	text-align: left;
	white-space: normal;
}

.wdmg-empty {
	padding: 18px;
	border: 1px dashed currentColor;
	border-radius: 4px;
	text-align: center;
	opacity: 0.7;
}

@media (max-width: 980px) {
	.wdmg-gallery {
		column-count: var(--wdmg-columns-tablet, 3);
	}
}

@media (max-width: 767px) {
	.wdmg-gallery {
		column-count: var(--wdmg-columns-phone, 1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.wdmg-image,
	.wdmg-overlay {
		transition: none;
	}

	.wdmg-item:hover .wdmg-image,
	.wdmg-item:focus-within .wdmg-image {
		transform: none;
	}
}

/* Built-in gallery lightbox */
.wdmg-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 28px;
}

.wdmg-lightbox.is-open {
	display: flex;
}

.wdmg-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.9);
}

.wdmg-lightbox__dialog {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: min(94vw, 1500px);
	height: 92vh;
	outline: none;
}

.wdmg-lightbox__stage {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	max-width: calc(100% - 130px);
	max-height: 100%;
}

.wdmg-lightbox__image {
	display: block;
	max-width: 100%;
	max-height: calc(92vh - 62px);
	width: auto;
	height: auto;
	object-fit: contain;
	box-shadow: 0 10px 45px rgba(0, 0, 0, 0.35);
}

.wdmg-lightbox__details {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	width: 100%;
	padding-top: 12px;
	color: #fff;
	font-size: 14px;
	line-height: 1.4;
}

.wdmg-lightbox__caption {
	flex: 1;
}

.wdmg-lightbox__caption[hidden] {
	display: none !important;
}

.wdmg-lightbox__counter {
	flex: 0 0 auto;
	opacity: 0.75;
}

.wdmg-lightbox__close,
.wdmg-lightbox__nav {
	position: absolute;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	font: inherit;
	line-height: 1;
	transition: opacity 180ms ease, background 180ms ease;
}

.wdmg-lightbox__close:hover,
.wdmg-lightbox__close:focus-visible,
.wdmg-lightbox__nav:hover,
.wdmg-lightbox__nav:focus-visible {
	background: rgba(255, 255, 255, 0.14);
	outline: 2px solid rgba(255, 255, 255, 0.8);
	outline-offset: 2px;
}

.wdmg-lightbox__close {
	top: 0;
	right: 0;
	width: 48px;
	height: 48px;
	font-size: 42px;
	font-weight: 300;
}

.wdmg-lightbox__nav {
	top: 50%;
	width: 52px;
	height: 70px;
	transform: translateY(-50%);
	font-size: 34px;
}

.wdmg-lightbox__previous {
	left: 0;
}

.wdmg-lightbox__next {
	right: 0;
}

@media (max-width: 767px) {
	.wdmg-lightbox {
		padding: 12px;
	}

	.wdmg-lightbox__dialog {
		width: 100%;
		height: 96vh;
	}

	.wdmg-lightbox__stage {
		max-width: 100%;
		padding: 54px 0 72px;
	}

	.wdmg-lightbox__image {
		max-height: calc(96vh - 150px);
	}

	.wdmg-lightbox__nav {
		top: auto;
		bottom: 0;
		transform: none;
	}

	.wdmg-lightbox__previous {
		left: calc(50% - 62px);
	}

	.wdmg-lightbox__next {
		right: calc(50% - 62px);
	}
}
