/*
 * Public gallery renderer
 * Loaded only on gallery.html. The static WordPress gallery stays as the
 * no-JavaScript and first-load fallback; this file makes the same grid work
 * for the JSON-driven manual uploads.
 */

.elementor-6550 .elementor-element.elementor-element-1305b20 .gallery.ofm-gallery {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 30px;
	margin: 0;
}

.elementor-6550 .elementor-element.elementor-element-1305b20 .gallery.ofm-gallery figure.gallery-item {
	width: auto;
	margin: 0;
	padding: 0;
	float: none;
}

.gallery.ofm-gallery .gallery-icon,
.gallery.ofm-gallery .ofm-gallery-link {
	display: block;
	width: 100%;
	height: 100%;
}

.gallery.ofm-gallery .ofm-gallery-link {
	position: relative;
	overflow: hidden;
	border-radius: 20px;
	background: #121820;
}

.gallery.ofm-gallery .ofm-gallery-link img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 20px;
	transition: transform 0.45s ease;
}

.gallery.ofm-gallery .ofm-gallery-link:hover img {
	transform: scale(1.035);
}

.gallery.ofm-gallery .ofm-gallery-link:focus-visible {
	outline: 3px solid var(--e-global-color-white);
	outline-offset: 4px;
}

.gallery.ofm-gallery .ofm-gallery-link:focus-visible img {
	transform: scale(1.035);
}

.ofm-gallery-dialog {
	width: min(1100px, 94vw);
	max-width: 94vw;
	max-height: 92vh;
	padding: 0;
	border: 0;
	border-radius: 18px;
	background: transparent;
	color: var(--e-global-color-white);
	overflow: visible;
}

.ofm-gallery-dialog::backdrop {
	background: rgba(6, 9, 13, 0.86);
	backdrop-filter: blur(6px);
}

.ofm-gallery-dialog__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	max-height: 90vh;
	overflow: hidden;
	border-radius: 18px;
	background: #0f141b;
	box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.ofm-gallery-dialog__image {
	display: block;
	width: 100%;
	max-height: 72vh;
	object-fit: contain;
	background: #0b0f14;
}

.ofm-gallery-dialog__body {
	padding: 20px 24px 24px;
}

.ofm-gallery-dialog__title {
	margin: 0 0 6px;
	color: var(--e-global-color-white);
	font-family: var(--e-global-typography-primary-font-family);
	font-size: 22px;
	font-weight: 600;
	line-height: 1.2;
}

.ofm-gallery-dialog__caption {
	margin: 0 0 14px;
	color: rgba(255, 255, 255, 0.78);
	font-family: var(--e-global-typography-text-font-family);
	font-size: 15px;
	line-height: 1.6;
}

.ofm-gallery-dialog__caption[hidden] {
	display: none;
}

.ofm-gallery-dialog__close {
	position: absolute;
	top: 12px;
	right: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 50%;
	background: rgba(8, 12, 17, 0.72);
	color: #ffffff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.25s ease, border-color 0.25s ease;
}

.ofm-gallery-dialog__close:hover {
	background: rgba(195, 26, 38, 0.9);
	border-color: rgba(255, 255, 255, 0.55);
}

.ofm-gallery-dialog__close:focus-visible {
	outline: 3px solid var(--e-global-color-white);
	outline-offset: 3px;
}

body.ofm-gallery-dialog-open {
	overflow: hidden;
}

@media (max-width: 1024px) {
	.elementor-6550 .elementor-element.elementor-element-1305b20 .gallery.ofm-gallery {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 20px;
	}
}

@media (max-width: 600px) {
	.elementor-6550 .elementor-element.elementor-element-1305b20 .gallery.ofm-gallery {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.gallery.ofm-gallery .ofm-gallery-link,
	.gallery.ofm-gallery .ofm-gallery-link img {
		border-radius: 14px;
	}

	.ofm-gallery-dialog {
		width: 94vw;
		max-width: 94vw;
	}

	.ofm-gallery-dialog__panel {
		border-radius: 14px;
	}

	.ofm-gallery-dialog__image {
		max-height: 62vh;
	}

	.ofm-gallery-dialog__body {
		padding: 16px;
	}

	.ofm-gallery-dialog__title {
		font-size: 18px;
	}

	.ofm-gallery-dialog__caption {
		font-size: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gallery.ofm-gallery .ofm-gallery-link img,
	.ofm-gallery-dialog__close {
		transition: none;
	}

	.gallery.ofm-gallery .ofm-gallery-link:hover img,
	.gallery.ofm-gallery .ofm-gallery-link:focus-visible img {
		transform: none;
	}
}
