/* Smile gallery page only. Linked from /smile-gallery/index.html. */

/* Hero: reuses the home hero (.hero-section in style-new.css) */
.sg-hero {
	min-height: min(760px, 86vh);
}

.sg-hero .hero-title {
	text-wrap: balance;
}

.sg-hero .hero-title em {
	font-style: italic;
}

/* Section intro */
.smile-gallery-section {
	background: #fff;
	padding-top: 96px;
	padding-bottom: 104px;
}

.smile-gallery-section .base-container {
	align-items: stretch;
}

.sg-intro,
.sg-reviews-head {
	max-width: 760px;
	margin: 0 auto 56px;
	text-align: center;
}

.sg-title {
	margin: 0 0 18px;
	color: #0e0e0e;
	font-family: var(--font-heading, "Merchant", sans-serif);
	font-size: 48px;
	font-weight: 400;
	line-height: 1.1;
}

.sg-title::after {
	content: "";
	display: block;
	width: 56px;
	height: 2px;
	margin: 20px auto 0;
	background: #caaf58;
}

.sg-lead {
	margin: 0;
	color: #5e646d;
	font-size: 18px;
	line-height: 1.6;
}

.sg-reviews-head {
	padding: 88px 20px 0;
	margin-bottom: 8px;
}

/* Mosaic: each row is two equal halves. A half is either one big square
   (a before-over-after photo) or a 2x2 block of small squares (two cases,
   before | after). Both halves come out the same height. */
.sg-mosaic {
	display: flex;
	flex-direction: column;
	gap: 30px;
}

.sg-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 30px;
}

.sg-quad {
	display: grid;
	grid-template-rows: 1fr 1fr;
	gap: 30px;
}

.sg-open.sg-pair {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 30px;
}

.sg-open {
	display: block;
	color: inherit;
	text-decoration: none;
	cursor: zoom-in;
}

.sg-big,
.sg-sq {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	border-radius: 20px;
	background: #f4f1ea;
}

.sg-big img,
.sg-sq img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.sg-open:hover img {
	transform: scale(1.03);
}

/* The before-over-after photos have a thin white border baked in: zoom past it */
.sg-big img {
	transform: scale(1.04);
}

.sg-open.sg-big:hover img {
	transform: scale(1.07);
}

.sg-open:focus-visible {
	outline: 2px solid #caaf58;
	outline-offset: 4px;
	border-radius: 20px;
}

/* Small Before / After labels */
.sg-tag {
	position: absolute;
	left: 12px;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(14, 14, 14, 0.55);
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.04em;
	line-height: 1.4;
	text-transform: uppercase;
	pointer-events: none;
}

.sg-sq .sg-tag {
	bottom: 12px;
}

.sg-big .sg-tag--before {
	top: 12px;
}

.sg-big .sg-tag--after {
	top: calc(50% + 12px);
}

/* Three-photo case: after is the bottom third */
.sg-big--triple .sg-tag--after {
	top: calc(66.7% + 12px);
}

/* Statement card between the two mosaics */
.sg-statement {
	margin: 72px 0;
	padding: 56px 48px;
	border: 1px solid #d9d4c7;
	border-radius: 20px;
	text-align: center;
}

.sg-statement p {
	max-width: 900px;
	margin: 0 auto;
	color: #0e0e0e;
	font-family: var(--font-heading, "Merchant", sans-serif);
	font-size: 30px;
	line-height: 1.35;
}

/* Lightbox (built by JS) */
.sg-lb {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 56px 24px 24px;
	background: rgba(14, 14, 14, 0.92);
}

.sg-lb[hidden] {
	display: none;
}

.sg-lb-body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-width: 100%;
	max-height: 100%;
}

.sg-lb-body img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	min-height: 0;
	object-fit: contain;
	border-radius: 8px;
}

.sg-lb-body.is-single img {
	max-height: calc(100vh - 96px);
}

.sg-lb-body.is-pair img {
	max-height: calc((100vh - 102px) / 2);
}

.sg-lb-close {
	position: absolute;
	top: 8px;
	right: 12px;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.sg-lb-close:focus-visible {
	outline-color: #fff;
}

@media (prefers-reduced-motion: no-preference) {
	.sg-lb:not([hidden]) {
		animation: sg-fade 0.18s ease-out;
	}
	@keyframes sg-fade {
		from { opacity: 0; }
		to { opacity: 1; }
	}
}

@media (prefers-reduced-motion: reduce) {
	.sg-big img,
	.sg-sq img {
		transition: none;
	}
	.sg-open:hover img {
		transform: none;
	}
	.sg-big img,
	.sg-open.sg-big:hover img {
		transform: scale(1.04);
	}
}

/* Tablet */
@media (max-width: 991px) {
	.sg-mosaic,
	.sg-row,
	.sg-quad,
	.sg-pair {
		gap: 16px;
	}
	.sg-statement {
		margin: 48px 0;
		padding: 40px 28px;
	}
	.sg-statement p {
		font-size: 24px;
	}
}

/* Phone: halves stack, small squares stay two across */
@media (max-width: 767px) {
	.sg-hero .hero-title {
		font-size: 42px;
	}
	.smile-gallery-section {
		padding-top: 56px;
		padding-bottom: 64px;
	}
	.sg-intro,
	.sg-reviews-head {
		margin-bottom: 36px;
	}
	.sg-reviews-head {
		padding-top: 56px;
	}
	.sg-title {
		font-size: 34px;
	}
	.sg-lead {
		font-size: 16px;
	}
	.sg-mosaic,
	.sg-row,
	.sg-quad,
	.sg-pair {
		gap: 12px;
	}
	.sg-row {
		grid-template-columns: 1fr;
	}
	.sg-big,
	.sg-sq,
	.sg-open:focus-visible {
		border-radius: 16px;
	}
	.sg-tag {
		left: 8px;
		padding: 3px 8px;
		font-size: 11px;
	}
	.sg-sq .sg-tag {
		bottom: 8px;
	}
	.sg-big .sg-tag--before {
		top: 8px;
	}
	.sg-big .sg-tag--after {
		top: calc(50% + 8px);
	}
	.sg-big--triple .sg-tag--after {
		top: calc(66.7% + 8px);
	}
	.sg-statement {
		margin: 36px 0;
		padding: 32px 20px;
	}
	.sg-statement p {
		font-size: 21px;
	}
}
