/* Service Gallery v1.0.0 */

.svcg {
	--svcg-gap: 8px;
	--svcg-radius: 6px;
	--svcg-row-h: 200px;
	--svcg-cols: 4;
	--svcg-cols-m: 2;
	--svcg-ratio: 4 / 3;
	--svcg-more-color: #fff;
	margin: 0;
	width: 100%;
}

.svcg__heading {
	margin: 0 0 16px;
}

.svcg__grid {
	display: grid;
	gap: var(--svcg-gap);
}

/* Strong reset so theme / Elementor Kit button styles never leak onto tiles. */
.svcg .svcg__tile,
.svcg .svcg__tile:hover,
.svcg .svcg__tile:focus,
.svcg .svcg__tile:active {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--svcg-radius);
	background: #e8e9e9;
	box-shadow: none;
	color: inherit;
	font: inherit;
	line-height: 0;
	text-transform: none;
	overflow: hidden;
	cursor: zoom-in;
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
	isolation: isolate;
}

.svcg .svcg__tile:focus-visible {
	outline: 3px solid var(--svcg-accent, #252627);
	outline-offset: 3px;
}

.svcg .svcg__tile img,
.svcg .svcg__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	border: 0;
	border-radius: 0;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (hover: hover) {
	.svcg .svcg__tile:hover img {
		transform: scale(1.045);
	}
}

/* "+N more photos" tile */
.svcg__more {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px;
	background: var(--svcg-more-bg, color-mix(in srgb, var(--svcg-accent, #252627) 80%, transparent));
	color: var(--svcg-more-color);
	line-height: 1.1;
	text-align: center;
	transition: background-color 0.25s ease;
}

.svcg__more-num {
	font-size: clamp(26px, 3vw, 38px);
	font-weight: 600;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}

.svcg__more-label {
	font-size: 14px;
	opacity: 0.9;
}

@media (hover: hover) {
	.svcg .svcg__tile--more:hover .svcg__more {
		background: var(--svcg-more-bg, color-mix(in srgb, var(--svcg-accent, #252627) 90%, transparent));
	}
}

/* ---------- Mosaic (mobile first) ---------- */
.svcg--mosaic .svcg__grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-auto-rows: calc(var(--svcg-row-h) * 0.7);
}

.svcg--mosaic .svcg__tile:first-child {
	grid-column: span 2;
	grid-row: span 2;
}

/* A lone tile on the last row fills the width. */
.svcg--mosaic .svcg__tile:last-child:nth-child(even) {
	grid-column: span 2;
}

@media (min-width: 768px) {
	.svcg--mosaic .svcg__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		grid-auto-rows: var(--svcg-row-h);
	}

	.svcg--mosaic .svcg__tile:last-child:nth-child(even) {
		grid-column: auto;
	}

	.svcg--mosaic .svcg__tile:first-child {
		grid-column: span 2;
		grid-row: span 2;
	}

	/* 1 photo */
	.svcg--count-1 .svcg__grid {
		grid-template-columns: minmax(0, 1fr);
	}
	.svcg--count-1 .svcg__tile:first-child {
		grid-column: span 1;
	}

	/* 2 photos: side by side */
	.svcg--count-2 .svcg__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.svcg--count-2 .svcg__tile:first-child,
	.svcg--count-2 .svcg__tile {
		grid-column: span 1;
		grid-row: span 2;
	}

	/* 3 photos: large + two stacked */
	.svcg--count-3 .svcg__grid {
		grid-template-columns: 2fr 1fr;
	}
	.svcg--count-3 .svcg__tile:first-child {
		grid-column: span 1;
	}

	/* 4 photos: large + two + one wide */
	.svcg--count-4 .svcg__grid {
		grid-template-columns: 2fr 1fr 1fr;
	}
	.svcg--count-4 .svcg__tile:first-child {
		grid-column: span 1;
	}
	.svcg--count-4 .svcg__tile:nth-child(4) {
		grid-column: span 2;
	}

	/* More than 5: stretch the last row so there are no gaps. */
	.svcg--rem-1 .svcg__tile:last-child {
		grid-column: span 4;
	}
	.svcg--rem-2 .svcg__tile:nth-last-child(-n + 2) {
		grid-column: span 2;
	}
	.svcg--rem-3 .svcg__tile:last-child {
		grid-column: span 2;
	}
}

/* ---------- Even grid ---------- */
.svcg--grid .svcg__grid {
	grid-template-columns: repeat(var(--svcg-cols-m), minmax(0, 1fr));
}

.svcg.svcg--grid .svcg__tile,
.svcg.svcg--grid .svcg__tile:hover,
.svcg.svcg--grid .svcg__tile:focus {
	height: auto;
	aspect-ratio: var(--svcg-ratio);
}

@media (min-width: 768px) {
	.svcg--grid .svcg__grid {
		grid-template-columns: repeat(var(--svcg-cols), minmax(0, 1fr));
	}
}

/* Elementor editor placeholder */
.svcg-empty {
	padding: 28px 20px;
	border: 1px dashed #c3c4c7;
	border-radius: 6px;
	color: #646970;
	font-size: 14px;
	line-height: 1.5;
	text-align: center;
}

/* ================= Lightbox ================= */
html.svcg-lock,
html.svcg-lock body {
	overflow: hidden;
}

.svcg-lb {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	flex-direction: column;
	background: rgba(20, 21, 22, 0.97);
	color: #f3f3f3;
	font-family: inherit;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.22s ease, visibility 0s linear 0.22s;
	-webkit-tap-highlight-color: transparent;
}

.svcg-lb.is-open {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.22s ease;
}

.svcg-lb [hidden] {
	display: none !important;
}

.svcg-lb__bar {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: space-between;
	padding: calc(12px + env(safe-area-inset-top)) 12px 0 20px;
}

.svcg-lb__count {
	font-size: 14px;
	line-height: 1;
	opacity: 0.75;
	font-variant-numeric: tabular-nums;
}

.svcg-lb__stage {
	position: relative;
	display: flex;
	flex: 1;
	min-height: 0;
	align-items: center;
	justify-content: center;
	padding: 12px 76px;
	touch-action: pan-y;
}

.svcg-lb__figure {
	display: flex;
	margin: 0;
	max-width: 100%;
	max-height: 100%;
}

.svcg-lb__img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: calc(100vh - 200px);
	max-height: calc(100dvh - 200px);
	margin: 0;
	border-radius: 4px;
	object-fit: contain;
	opacity: 0;
	transform: scale(0.985);
	transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
	user-select: none;
	-webkit-user-drag: none;
}

.svcg-lb__img.is-loaded {
	opacity: 1;
	transform: none;
}

.svcg-lb--single .svcg-lb__img {
	max-height: calc(100vh - 120px);
	max-height: calc(100dvh - 120px);
}

/* Buttons (reset theme / Kit button styles) */
.svcg-lb .svcg-lb__btn,
.svcg-lb .svcg-lb__btn:hover,
.svcg-lb .svcg-lb__btn:focus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	box-shadow: none;
	color: #fff;
	line-height: 0;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.svcg-lb .svcg-lb__btn:hover {
	background: rgba(255, 255, 255, 0.18);
}

.svcg-lb .svcg-lb__btn:focus-visible,
.svcg-lb .svcg-lb__thumb:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.svcg-lb__btn svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.svcg-lb .svcg-lb__prev,
.svcg-lb .svcg-lb__next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
}

.svcg-lb .svcg-lb__prev {
	left: 16px;
}

.svcg-lb .svcg-lb__next {
	right: 16px;
}

.svcg-lb__caption {
	flex: none;
	min-height: 1.4em;
	max-width: 70ch;
	margin: 6px auto 0;
	padding: 0 20px;
	font-size: 14px;
	line-height: 1.4;
	text-align: center;
	opacity: 0.85;
}

.svcg-lb__thumbs {
	display: flex;
	flex: none;
	gap: 6px;
	padding: 14px 20px calc(16px + env(safe-area-inset-bottom));
	overflow-x: auto;
	scrollbar-width: none;
	scroll-behavior: smooth;
}

.svcg-lb__thumbs::-webkit-scrollbar {
	display: none;
}

/* Centres the strip when it fits, scrolls cleanly when it doesn't. */
.svcg-lb .svcg-lb__thumb,
.svcg-lb .svcg-lb__thumb:hover,
.svcg-lb .svcg-lb__thumb:focus {
	flex: none;
	width: 64px;
	height: 48px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: #333;
	box-shadow: none;
	line-height: 0;
	overflow: hidden;
	cursor: pointer;
	opacity: 0.45;
	transition: opacity 0.2s ease;
}

.svcg-lb .svcg-lb__thumb:hover {
	opacity: 0.8;
}

.svcg-lb .svcg-lb__thumb.is-active {
	opacity: 1;
	box-shadow: 0 0 0 2px #fff;
}

.svcg-lb__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.svcg-lb .svcg-lb__thumbs > .svcg-lb__thumb:first-child {
	margin-left: auto;
}
.svcg-lb .svcg-lb__thumbs > .svcg-lb__thumb:last-child {
	margin-right: auto;
}

@media (max-width: 767px) {
	.svcg-lb__stage {
		padding: 8px;
	}
	.svcg-lb .svcg-lb__prev,
	.svcg-lb .svcg-lb__next,
	.svcg-lb .svcg-lb__prev:hover,
	.svcg-lb .svcg-lb__next:hover {
		width: 40px;
		height: 40px;
		background: rgba(0, 0, 0, 0.45);
	}
	.svcg-lb .svcg-lb__prev {
		left: 12px;
	}
	.svcg-lb .svcg-lb__next {
		right: 12px;
	}
	.svcg-lb .svcg-lb__thumb {
		width: 52px;
		height: 40px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.svcg .svcg__tile img,
	.svcg-lb,
	.svcg-lb__img,
	.svcg__more {
		transition: none;
	}
	.svcg-lb__thumbs {
		scroll-behavior: auto;
	}
	.svcg .svcg__tile:hover img {
		transform: none;
	}
}
