/**
 * Portfolio page only.
 *
 * Mirrors https://www.heritagebuildersnj.com/portfolio
 */

/* Dark grey bands left/right of the constrained hero, identical to financing */
.site-main--portfolio {
	padding: 52px 0 1rem;
	background: #fff;
	position: relative;
	isolation: isolate;
}

.site-main--portfolio::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 420px;
	background: #262626;
	z-index: 0;
}

@media (max-width: 768px) {
	.site-main--portfolio {
		padding-top: 0px;
	}
 
}

/* ── Hero ─────────────────────────────────────────────────────────── */

.portfolio-hero {
	position: relative;
	z-index: 2;
	max-width: 75rem;
	margin: 0 auto -6.25rem; /* protrude 100px into white below */
	padding: 0;
	min-height: 31.25rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

.portfolio-hero__media {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.portfolio-hero__video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 50%;
	display: block;
}

.portfolio-hero__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
}

.portfolio-hero__inner {
	position: relative;
	z-index: 1;
	text-align: center;
}

.portfolio-hero__title {
	margin: 0;
	font-family: var(--heritage-font-serif);
	font-size: clamp(2.75rem, 6vw, 4.5rem);
	font-weight: 400;
	line-height: 1.1;
	color: #fff;
	text-shadow: 0 0 18px rgba(0, 0, 0, 0.25);
}

/* Vertical connector line at the bottom of the hero, rendered on top of the video */
.portfolio-hero__line {
	display: block;
	width: 1px;
	height: 5rem;
	background: rgba(255, 255, 255, 0.6);
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	bottom: 0;
	z-index: 3;
}

/* ── Intro ────────────────────────────────────────────────────────── */

.portfolio-intro {
	padding: 14rem 0 2rem; /* extra top: clears hero protrusion + gives breathing room */
	background: #fff;
	text-align: center;
	position: relative;
	z-index: 1;
}

.portfolio-intro__eyebrow {
	margin: 0 0 0.5rem;
	font-family: var(--heritage-font);
	font-size: 1rem;
	font-weight: 400;
	letter-spacing: 0.2em;
	color: rgb(86, 86, 86);
}

.portfolio-intro__heading {
	margin: 0;
	font-family: var(--heritage-font-serif);
	font-size: clamp(2.5rem, 4.5vw, 3.75rem);
	font-weight: 400;
	line-height: 1.1;
	color: var(--heritage-text);
}

/* ── Project Cards ────────────────────────────────────────────────── */

.portfolio-cards {
	padding: 2rem 0 4rem;
	background: #fff;
}

.portfolio-cards__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	max-width: none;
	margin: 0;
	padding: 0 40px;
}

.portfolio-card {
	background: rgba(0, 0, 0, 0.05);
	border-radius: 20px;
	padding: 25px;
	display: flex;
	flex-direction: column;
}

.portfolio-card__image {
	aspect-ratio: 543 / 300;
	border-radius: 10px;
	background-size: cover;
	background-position: 50% 50%;
	background-repeat: no-repeat;
	margin-bottom: 1.25rem;
	flex-shrink: 0;
}

.portfolio-card__title {
	margin: 0 0 0.75rem;
	font-family: var(--heritage-font-serif);
	font-size: 1.875rem; /* 30px */
	font-weight: 400;
	line-height: 1.2;
	color: var(--heritage-text);
}

.portfolio-card__desc {
	margin: 0 0 1.25rem;
	font-family: var(--heritage-font);
	font-size: 0.9375rem;
	line-height: 1.55;
	color: var(--heritage-text);
	flex: 1;
}

.portfolio-card__btn {
	display: inline-block;
	align-self: flex-start;
	padding: 0.5rem 1.25rem;
	border: 2px solid rgb(204, 204, 204);
	border-radius: 0;
	background: transparent;
	color: var(--heritage-text);
	font-family: var(--heritage-font);
	font-size: 1rem;
	font-weight: 400;
	line-height: 1;
	text-decoration: none;
	transition: border-color 0.2s ease, color 0.2s ease;
}

.portfolio-card__btn:hover,
.portfolio-card__btn:focus {
	border-color: var(--heritage-blue);
	color: var(--heritage-blue);
	text-decoration: none;
}

/* ── Highlights / Gallery sections ───────────────────────────────── */

.portfolio-gallery-section {
	padding: 3rem 40px 4rem;
	background: #fff;
}

.portfolio-gallery-section--alt {
	background: #f5f5f5;
}

.portfolio-gallery-section__header {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 1.5rem;
	margin-bottom: 2rem;
	text-align: center;
}

.portfolio-gallery-section__title {
	margin: 0;
	font-family: var(--heritage-font-serif);
	font-size: clamp(2.5rem, 4.5vw, 3.75rem);
	font-weight: 400;
	line-height: 1.1;
	color: var(--heritage-text);
}

.portfolio-gallery-section__link {
	font-family: var(--heritage-font);
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	color: var(--heritage-blue);
	text-decoration: none;
}

.portfolio-gallery-section__link:hover {
	text-decoration: underline;
}

.portfolio-photo-grid {
	display: grid;
	grid-template-columns: repeat(4, 321px);
	gap: 8px;
	justify-content: center;
}

.portfolio-photo-grid__item {
	width: 100%;
	max-width: 321px;
	aspect-ratio: 321 / 270;
	background-size: cover;
	background-position: 50% 50%;
	background-repeat: no-repeat;
	display: block;
}

.portfolio-gallery-section__more {
	display: block;
	margin: 1rem auto 0;
	padding: 0;
	background: transparent;
	border: none;
	cursor: pointer;
	font-family: var(--heritage-font);
	font-size: 0.9375rem;
	color: rgb(12, 83, 132);
	text-decoration: underline;
	letter-spacing: 0.05em;
}

.portfolio-gallery-section__more:hover,
.portfolio-gallery-section__more:focus {
	color: rgb(14, 105, 161);
	text-decoration: underline;
}

.portfolio-photo-grid__item.is-hidden {
	display: none;
}

/* ── Before/After slider ───────────────────────────────────────────── */

.portfolio-baf {
	padding: 3rem 40px 4rem;
	background: #fff;
}

.baf {
	position: relative;
	max-width: 1200px;
	margin: 0 auto;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	user-select: none;
	cursor: ew-resize;
	background: #222;
}

.baf__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
}

.baf__before-wrap {
	position: absolute;
	inset: 0;
	clip-path: inset(0 50% 0 0);
}

.baf__handle {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 2px;
	background: #fff;
	transform: translateX(-1px);
	pointer-events: none;
}

.baf__handle-knob {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #fff;
	color: rgb(12, 83, 132);
	font-size: 20px;
	line-height: 44px;
	text-align: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.baf__label {
	position: absolute;
	top: 1rem;
	padding: 0.35rem 0.75rem;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-family: var(--heritage-font);
	font-size: 0.875rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	pointer-events: none;
}

.baf__label--before { left: 1rem; }
.baf__label--after  { right: 1rem; }

/* ── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 900px) {
	.portfolio-cards__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.portfolio-photo-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.portfolio-photo-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.portfolio-hero {
		margin-bottom: -3rem;
		min-height: 23rem;
	}

	.portfolio-hero__line {
		height: 4rem;
		bottom: -4rem;
	}

	.portfolio-intro {
		padding-top: 6rem;
	}

	.portfolio-cards__grid {
		grid-template-columns: 1fr;
	}

	.portfolio-gallery-section {
		padding: 3rem 16px 4rem;
	}

	.portfolio-gallery-section__header {
		flex-direction: column;
		gap: 0.5rem;
	}

	.portfolio-photo-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
