.icm-photo-gallery {
	--icm-photo-accent: var(--e-global-color-accent, #f55b69);
	width: 100%;
	min-width: 0;
}

/* Resolve the flex item's width before Elementor measures the aspect-ratio cards. */
.elementor-widget-shortcode:has(.icm-photo-gallery--albums) {
	width: 100%;
}

.icm-photo-gallery__album + .icm-photo-gallery__album {
	margin-top: 40px;
}

.icm-photo-gallery .icm-photo-gallery__heading {
	margin: 0 0 20px;
}

.icm-photo-gallery .icm-photo-gallery__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.icm-photo-gallery__grid > li {
	min-width: 0;
	margin: 0;
	padding: 0;
}

.icm-photo-gallery__grid > li[hidden] {
	display: none;
}

.icm-photo-gallery--albums {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
}

.icm-photo-gallery--albums > .icm-photo-gallery__album {
	min-width: 0;
	margin: 0;
}

.icm-photo-gallery--albums .icm-photo-gallery__grid {
	display: block;
}

.icm-photo-gallery__thumbnail {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 16px;
	background: #f1f1f1;
}

.icm-photo-gallery .icm-photo-gallery__thumbnail img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 180ms ease;
}

.icm-photo-gallery__thumbnail:hover img {
	transform: scale(1.025);
}

.icm-photo-gallery__thumbnail:focus-visible {
	outline: 3px solid var(--icm-photo-accent);
	outline-offset: 3px;
}

.icm-photo-gallery .icm-photo-gallery__cover {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	isolation: isolate;
	aspect-ratio: 1.15;
	border-radius: 24px;
	color: #fff;
	text-decoration: none;
}

.icm-photo-gallery__cover img {
	position: absolute;
	inset: 0;
}

.icm-photo-gallery__cover::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgb(14 18 33 / 40%);
}

.icm-photo-gallery__album-title {
	position: relative;
	z-index: 1;
	display: -webkit-box;
	margin: 20px;
	overflow: hidden;
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(24px, 4vw, 56px);
	font-weight: 700;
	line-height: 1.15;
	text-align: center;
	overflow-wrap: anywhere;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.icm-photo-lightbox {
	--icm-photo-accent: var(--e-global-color-accent, #f55b69);
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	height: 100dvh;
	max-width: none;
	max-height: none;
	box-sizing: border-box;
	margin: 0;
	padding: 60px 80px 24px;
	border: 0;
	background: rgb(14 18 33 / 96%);
	color: #fff;
}

.icm-photo-lightbox[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}

.icm-photo-lightbox::backdrop {
	background: rgb(14 18 33 / 80%);
}

.icm-photo-lightbox .icm-photo-lightbox__figure {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 1600px;
	max-height: 100%;
	min-height: 0;
	margin: 0;
}

.icm-photo-lightbox__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 auto;
	min-height: 0;
}

.icm-photo-lightbox .icm-photo-lightbox__image {
	display: block;
	max-width: 100%;
	max-height: calc(100dvh - 180px);
	width: auto;
	height: auto;
	object-fit: contain;
	touch-action: pan-y pinch-zoom;
}

.icm-photo-lightbox .icm-photo-lightbox__image[hidden] {
	display: none;
}

.icm-photo-lightbox__status {
	margin: 24px;
	text-align: center;
}

.icm-photo-lightbox__status:empty {
	display: none;
}

.icm-photo-lightbox .icm-photo-lightbox__caption,
.icm-photo-lightbox .icm-photo-lightbox__counter {
	flex: 0 0 auto;
	margin: 12px 0 0;
	color: #fff;
	text-align: center;
	font-size: 16px;
	line-height: 1.4;
}

.icm-photo-lightbox__caption {
	max-height: 80px;
	overflow-y: auto;
	overflow-wrap: anywhere;
}

.icm-photo-lightbox__caption:empty {
	display: none;
}

.icm-photo-lightbox button {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--icm-photo-accent, #f55b69);
	color: #fff;
	cursor: pointer;
}

.icm-photo-lightbox button:hover {
	background: #da4553;
	color: #fff;
}

.icm-photo-lightbox button:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

.icm-photo-lightbox button[hidden] {
	display: none;
}

.icm-photo-lightbox button svg {
	width: 24px;
	height: 24px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.icm-photo-lightbox__close {
	top: max(12px, env(safe-area-inset-top));
	right: max(16px, env(safe-area-inset-right));
}

.icm-photo-lightbox__previous,
.icm-photo-lightbox__next {
	top: 50%;
	transform: translateY(-50%);
}

.icm-photo-lightbox__previous {
	left: 16px;
}

.icm-photo-lightbox__next {
	right: 16px;
}

html.icm-photo-lightbox-open {
	overflow: hidden;
}

.icm-photo-gallery__sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

@media (max-width: 1024px) {
	.icm-photo-gallery--albums {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.icm-photo-gallery .icm-photo-gallery__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.icm-photo-gallery--albums {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.icm-photo-gallery .icm-photo-gallery__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.icm-photo-lightbox {
		padding: 64px 12px 80px;
	}

	.icm-photo-lightbox__previous,
	.icm-photo-lightbox__next {
		top: auto;
		bottom: max(16px, env(safe-area-inset-bottom));
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.icm-photo-gallery .icm-photo-gallery__thumbnail img {
		transition: none;
	}
}
