/* Showcase Gallery – front end
 * Customise from your theme, e.g.  .scg-gallery { --scg-accent: #e63946; --scg-gap: 16px; }
 */
.scg-gallery {
	--scg-accent: #1a8cff;
	--scg-gap: 22px;
	--scg-bg: #eef0f3;
	--scg-radius: 0px;
	position: relative;
	width: 100%;
	margin: 0 0 1.5em;
}
.scg-gallery *, .scg-gallery *::before, .scg-gallery *::after { box-sizing: border-box; }
.scg-gallery a { text-decoration: none; box-shadow: none; }
.scg-gallery button {
	margin: 0; padding: 0; min-height: 0; min-width: 0;
	font: inherit; line-height: 1; letter-spacing: 0; text-transform: none;
	box-shadow: none; cursor: pointer;
}
.scg-gallery img {
	display: block; width: 100%; height: 100%; max-width: none;
	margin: 0; border: 0; border-radius: 0; box-shadow: none;
	object-fit: cover;
}

/* ---------- Desktop: featured grid ---------- */
.scg-desktop {
	display: grid;
	grid-template-columns: 1.85fr 1fr;
	gap: var(--scg-gap);
	aspect-ratio: 12 / 5;
}
.scg-desktop.scg-n-1 { grid-template-columns: 1fr; aspect-ratio: 16 / 7; }

.scg-open {
	display: block; position: relative;
	min-width: 0; min-height: 0;
	overflow: hidden;
	background: var(--scg-bg);
	border-radius: var(--scg-radius);
}
.scg-open img { transition: transform .5s ease; }
.scg-open:hover img { transform: scale(1.03); }
.scg-gallery :focus-visible { outline: 3px solid var(--scg-accent); outline-offset: 2px; }

.scg-side {
	display: grid;
	grid-template-rows: 1.4fr 1fr;
	gap: var(--scg-gap);
	min-height: 0;
}
.scg-n-2 .scg-side { grid-template-rows: 1fr; }

.scg-side-bottom {
	display: flex;
	align-items: flex-end;
	gap: var(--scg-gap);
	min-height: 0;
}
.scg-side-bottom > .scg-open:first-child { flex: 1 1 auto; height: 100%; }

.scg-gallery .scg-more {
	flex: 0 0 auto;
	display: flex; align-items: center; justify-content: center;
	width: 64px; height: 64px;
	background: #fff;
	border: 1px solid #d3d7de;
	color: #1d2327;
	font-size: 20px; font-weight: 600;
	transition: border-color .2s, color .2s;
}
.scg-gallery .scg-more:hover { border-color: var(--scg-accent); color: var(--scg-accent); }

/* ---------- Mobile: slider + thumbnails + dots ---------- */
.scg-mobile { display: none; }

@media (max-width: 767px) {
	.scg-desktop { display: none; }
	.scg-mobile { display: block; }
}

.scg-stage {
	position: relative;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: var(--scg-bg);
	border-radius: var(--scg-radius);
}
.scg-track {
	display: flex;
	height: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
}
.scg-track::-webkit-scrollbar { display: none; }
.scg-track:focus-visible { outline-offset: -3px; }
.scg-gallery .scg-slide {
	flex: 0 0 100%;
	height: 100%;
	border: 0;
	background: transparent;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

.scg-gallery .scg-expand {
	position: absolute; right: 12px; bottom: 12px;
	display: flex; align-items: center; justify-content: center;
	width: 48px; height: 48px;
	border: 0;
	background: rgba(255, 255, 255, .78);
	color: #111;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}
.scg-expand svg {
	width: 26px; height: 26px;
	fill: none; stroke: currentColor; stroke-width: 2.4;
	stroke-linecap: round; stroke-linejoin: round;
}

.scg-thumbs {
	position: relative;
	display: flex;
	gap: 10px;
	max-width: 340px;
	margin: 20px auto 0;
	padding: 2px;
	overflow-x: auto;
	scrollbar-width: none;
}
.scg-thumbs::-webkit-scrollbar { display: none; }
.scg-gallery .scg-thumb {
	flex: 0 0 calc((100% - 20px) / 3);
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border: 4px solid transparent;
	background: var(--scg-bg);
	background-clip: padding-box;
	transition: border-color .2s;
}
.scg-thumb:first-child { margin-left: auto; }
.scg-thumb:last-child { margin-right: auto; }
.scg-gallery .scg-thumb.is-active { border-color: var(--scg-accent); }

.scg-dots {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-top: 22px;
}
.scg-gallery .scg-dot {
	width: 11px; height: 11px;
	border: 0; border-radius: 999px;
	background: #9aa0a6;
	transition: width .25s ease, background-color .25s ease;
}
.scg-gallery .scg-dot.is-active { width: 36px; background: var(--scg-accent); }

/* ---------- Lightbox ---------- */
html.scg-lock { overflow: hidden; }

.scg-lightbox {
	position: fixed; inset: 0; z-index: 999999;
	display: flex; align-items: center; justify-content: center;
	background: rgba(10, 12, 16, .94);
	opacity: 0;
	transition: opacity .25s ease;
}
.scg-lightbox[hidden] { display: none; }
.scg-lightbox.is-open { opacity: 1; }

.scg-lightbox .scg-lb-figure {
	display: flex; flex-direction: column; align-items: center;
	max-width: calc(100vw - 170px);
	margin: 0;
}
.scg-lightbox .scg-lb-img {
	display: block;
	width: auto; height: auto;
	max-width: 100%; max-height: calc(100vh - 130px);
	margin: 0; border: 0;
	object-fit: contain;
	transition: opacity .2s ease;
}
.scg-lightbox .scg-lb-img.is-loading { opacity: .25; }
.scg-lb-caption { margin-top: 12px; color: #e8eaed; font-size: 14px; line-height: 1.5; text-align: center; }
.scg-lb-caption:empty { display: none; }
.scg-lb-counter { position: absolute; top: 30px; left: 26px; color: #cfd3d8; font-size: 14px; }

.scg-lightbox button {
	position: absolute;
	display: flex; align-items: center; justify-content: center;
	width: 52px; height: 52px;
	margin: 0; padding: 0;
	border: 0; border-radius: 50%;
	background: rgba(255, 255, 255, .1);
	color: #fff;
	cursor: pointer;
	transition: background-color .2s;
}
.scg-lightbox button:hover { background: rgba(255, 255, 255, .22); }
.scg-lightbox button:focus-visible { outline: 3px solid #1a8cff; outline-offset: 2px; }
.scg-lightbox svg {
	width: 24px; height: 24px;
	fill: none; stroke: currentColor; stroke-width: 2;
	stroke-linecap: round; stroke-linejoin: round;
}
.scg-lb-close { top: 16px; right: 16px; }
.scg-lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.scg-lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
.scg-lightbox.scg-single .scg-lb-prev,
.scg-lightbox.scg-single .scg-lb-next,
.scg-lightbox.scg-single .scg-lb-counter { display: none; }

@media (max-width: 767px) {
	.scg-lightbox .scg-lb-figure { max-width: 100vw; }
	.scg-lightbox .scg-lb-img { max-height: calc(100vh - 180px); }
	.scg-lb-prev, .scg-lb-next { top: auto; bottom: 24px; transform: none; }
	.scg-lb-prev { left: calc(50% - 64px); }
	.scg-lb-next { right: calc(50% - 64px); }
}

@media (prefers-reduced-motion: reduce) {
	.scg-gallery *, .scg-lightbox, .scg-lightbox * { transition: none !important; }
	.scg-open:hover img { transform: none; }
}
