/* ============================================================
   Simple Gallery Pro — AMC theme
   Brand palette (from logo):
     --sg-gold  #DEAB26   --sg-teal #08A8A4   --sg-green #57A645
     --sg-ink   #121212 (near-black background)
   Performance: only transform / opacity / filter are animated
   (all GPU-accelerated); no width/height/margin transitions.
   ============================================================ */

.sg-wrap {
	--sg-gold: #DEAB26;
	--sg-teal: #08A8A4;
	--sg-green: #57A645;
	--sg-ink: #121212;
	--sg-cols: 3;
}

/* ---------- Filter bar ---------- */
.sg-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 20px;
}
.sg-filter-btn {
	border: 1px solid rgba(222,171,38,.45);
	background: transparent;
	color: #e9e9e9;
	padding: 8px 18px;
	border-radius: 999px;
	cursor: pointer;
	font-size: 14px;
	letter-spacing: .02em;
	line-height: 1;
	transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}
.sg-filter-btn:hover { border-color: var(--sg-gold); color: var(--sg-gold); }
.sg-filter-btn.is-active {
	background: var(--sg-gold);
	color: #111;
	border-color: var(--sg-gold);
}

/* ---------- Masonry (CSS columns) ---------- */
.sg-layout-masonry .sg-grid {
	column-count: var(--sg-cols, 3);
	column-gap: 14px;
}
.sg-layout-masonry .sg-cell {
	break-inside: avoid;
	margin: 0 0 14px;
	width: 100%;
}

/* ---------- Uniform grid (optional) ---------- */
.sg-layout-grid .sg-grid {
	display: grid;
	grid-template-columns: repeat(var(--sg-cols, 3), 1fr);
	gap: 14px;
}
.sg-layout-grid .sg-cell { aspect-ratio: 1 / 1; }
.sg-layout-grid .sg-cell img { height: 100%; object-fit: cover; }

/* ---------- Cell ---------- */
.sg-cell {
	position: relative;
	overflow: hidden;
	border-radius: 10px;
	cursor: pointer;
	background: var(--sg-ink);
	display: block;
}
.sg-cell img {
	width: 100%;
	display: block;
	/* The premium portfolio move: start desaturated, reveal colour on hover.
	   filter + transform are GPU-composited, so this stays smooth. */
	filter: grayscale(100%) contrast(1.02);
	transform: scale(1.001);
	transition: filter .45s ease, transform .55s cubic-bezier(.2,.7,.2,1);
	will-change: filter, transform;
}
.sg-cell:hover img,
.sg-cell:focus-within img {
	filter: grayscale(0%);
	transform: scale(1.06);
}

/* Gold gradient wash + caption reveal */
.sg-cell::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(18,18,18,.85) 0%, rgba(18,18,18,0) 45%);
	opacity: 0;
	transition: opacity .35s ease;
	pointer-events: none;
}
.sg-cell:hover::after,
.sg-cell:focus-within::after { opacity: 1; }

.sg-caption {
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 12px;
	z-index: 2;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .01em;
	opacity: 0;
	transform: translateY(10px);
	transition: opacity .35s ease, transform .35s ease;
	pointer-events: none;
	text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.sg-caption::before {
	content: "";
	display: inline-block;
	width: 18px;
	height: 2px;
	background: var(--sg-gold);
	vertical-align: middle;
	margin-right: 8px;
}
.sg-cell:hover .sg-caption,
.sg-cell:focus-within .sg-caption {
	opacity: 1;
	transform: translateY(0);
}

/* Play badge for videos */
.sg-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 2;
	width: 62px;
	height: 62px;
	border-radius: 50%;
	background: rgba(222,171,38,.92);
	color: #111;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	padding-left: 4px;
	pointer-events: none;
	transition: transform .3s ease, background-color .3s ease;
}
.sg-cell:hover .sg-play {
	transform: translate(-50%, -50%) scale(1.12);
	background: var(--sg-gold);
}

.sg-video-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 180px;
	color: #fff;
	background: #1c1c1c;
	font-size: 14px;
}

/* ---------- Responsive column counts ---------- */
@media (max-width: 900px) {
	.sg-wrap { --sg-cols: 2; }
}
@media (max-width: 520px) {
	.sg-wrap { --sg-cols: 1; }
}

/* On touch devices there's no hover: show colour by default so nothing looks broken. */
@media (hover: none) {
	.sg-cell img { filter: grayscale(0%); }
	.sg-caption { opacity: 1; transform: none; }
	.sg-cell::after { opacity: 1; }
}

/* Respect users who prefer less motion. */
@media (prefers-reduced-motion: reduce) {
	.sg-cell img,
	.sg-caption,
	.sg-play,
	.sg-cell::after { transition: none; }
	.sg-cell:hover img { transform: none; }
}

/* ---------- Cinematic lightbox ---------- */
.sg-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(10,10,10,.86);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 1;
}
.sg-lightbox[hidden] { display: none; }

.sg-lb-stage {
	max-width: 92vw;
	max-height: 88vh;
	display: flex;
	align-items: center;
	justify-content: center;
}
.sg-lb-media,
.sg-lb-stage video,
.sg-lb-stage img {
	max-width: 92vw;
	max-height: 88vh;
	width: auto;
	height: auto;
	border-radius: 6px;
	box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
/* Embedded YouTube/Vimeo keep a 16:9 frame */
.sg-lb-stage .sg-embed-frame {
	position: relative;
	width: min(92vw, 1280px);
	aspect-ratio: 16 / 9;
	max-height: 88vh;
}
.sg-lb-stage .sg-embed-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: 6px;
	box-shadow: 0 20px 60px rgba(0,0,0,.6);
}

.sg-lb-close,
.sg-lb-prev,
.sg-lb-next {
	position: absolute;
	background: rgba(255,255,255,.12);
	color: #fff;
	border: none;
	cursor: pointer;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color .18s ease, transform .18s ease;
}
.sg-lb-close:hover,
.sg-lb-prev:hover,
.sg-lb-next:hover {
	background: var(--sg-gold, #DEAB26);
	color: #111;
	transform: scale(1.06);
}
.sg-lb-close { top: 20px; right: 24px; width: 46px; height: 46px; font-size: 26px; }
.sg-lb-prev, .sg-lb-next { top: 50%; transform: translateY(-50%); width: 54px; height: 54px; font-size: 22px; }
.sg-lb-prev { left: 20px; }
.sg-lb-next { right: 20px; }
.sg-lb-prev:hover, .sg-lb-next:hover { transform: translateY(-50%) scale(1.06); }

@media (max-width: 600px) {
	.sg-lb-prev { left: 8px; }
	.sg-lb-next { right: 8px; }
	.sg-lb-close { top: 10px; right: 10px; }
}

.sg-empty { padding: 20px; color: #888; font-style: italic; }
