/**
 * About Us page (page-templates/about.php).
 *
 * Rhythm: feature hero → story (bg: photo cover with the heading set over it,
 * pull-quote lead) → values (secondary band: one feature statement, then open
 * numbered entries) → photo mosaic (bg) → closing CTA panel. Any section may be
 * absent, so spacing rules below cover each possible neighbour.
 */

.about-section {
	padding-block: var(--nscb-space-section);
}

/* Two plain-background sections in a row share one gap. */
.about-story + .about-gallery {
	padding-top: 0;
}

/* The CTA has no top padding of its own; restore it after the hero or the band. */
.nscb-page-hero + .nscb-cta,
.about-values + .nscb-cta {
	padding-top: var(--nscb-space-section);
}

/* ---------- Our story ---------- */

.about-story__grid {
	display: grid;
	gap: var(--nscb-space-6);
}

.about-story__head .nscb-section-head {
	margin-bottom: 0;
}

.about-story__head .nscb-section-head__title {
	font-size: var(--nscb-text-4xl);
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.04em;
}

/* With a photo: a tall cover with the heading set over its lower edge. */
.about-story--image .about-story__head {
	display: grid;
	isolation: isolate;
}

.about-story--image .about-story__head > * {
	grid-area: 1 / 1;
}

.about-story--image .about-story__head .nscb-section-head {
	z-index: 1;
	align-self: end;
	padding: var(--nscb-space-5);
}

.about-story__media {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--nscb-edge);
	border-radius: var(--nscb-radius-xl);
	background-color: var(--nscb-color-surface);
	box-shadow: var(--nscb-shadow-card);
}

.about-story__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 40%, color-mix(in srgb, var(--nscb-color-bg) 88%, transparent) 100%);
}

.about-story__media img {
	width: 100%;
	height: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

.about-story__copy {
	max-width: 62ch;
	color: var(--nscb-color-text-secondary);
	font-size: var(--nscb-text-lg);
}

.about-story__copy p + p {
	margin-top: var(--nscb-space-5);
}

/* The opening paragraph reads as a pull-quote: larger, with a lit rule. */
.about-story__copy p:first-child {
	position: relative;
	margin-bottom: var(--nscb-space-6);
	padding-left: var(--nscb-space-5);
	color: var(--nscb-color-text);
	font-family: var(--nscb-font-heading);
	font-size: var(--nscb-text-xl);
	font-weight: 600;
	letter-spacing: -0.015em;
	line-height: var(--nscb-leading-snug);
}

.about-story__copy p:first-child::before {
	content: "";
	position: absolute;
	top: 0.2em;
	bottom: 0.2em;
	left: 0;
	width: 0.25rem;
	border-radius: var(--nscb-radius-pill);
	background: linear-gradient(180deg, var(--nscb-color-highlight), color-mix(in srgb, var(--nscb-color-highlight) 15%, transparent));
}

@media (min-width: 64rem) {
	.about-story__grid {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		gap: var(--nscb-space-8);
		align-items: start;
	}

	.about-story--bare .about-story__grid {
		display: block;
	}

	.about-story--bare .about-story__copy {
		margin-inline: auto;
	}

	.about-story__head {
		position: sticky;
		top: calc(var(--nscb-header-height) + var(--nscb-space-6));
	}

	.about-story--image .about-story__head .nscb-section-head {
		padding: var(--nscb-space-6);
	}

	.about-story__media {
		border-radius: var(--nscb-radius-2xl);
	}

	.about-story__copy {
		padding-top: var(--nscb-space-6);
	}

	.about-story__copy p:first-child {
		font-size: var(--nscb-text-2xl);
	}
}

/* ---------- Values ---------- */

.about-values {
	border-block: 1px solid var(--nscb-edge);
	background-color: var(--nscb-color-bg-secondary);
	background-image: radial-gradient(60% 50% at 0% 0%, color-mix(in srgb, var(--nscb-color-accent) 12%, transparent), transparent 70%);
}

.about-values__grid {
	display: grid;
}

/* One feature statement, then the rest as a grid of open entries. */
.about-values__list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
	gap: 0 var(--nscb-space-6);
	padding: 0;
	list-style: none;
}

.about-values__item {
	display: grid;
	align-content: start;
	gap: var(--nscb-space-3);
	padding-block: var(--nscb-space-5) var(--nscb-space-6);
	border-top: 1px solid var(--nscb-edge-strong);
}

.about-values__number {
	color: transparent;
	font-family: var(--nscb-font-heading);
	font-size: var(--nscb-text-3xl);
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.03em;
	line-height: 1;
	-webkit-text-stroke: 1px color-mix(in srgb, var(--nscb-color-text) 45%, transparent);
	transition: -webkit-text-stroke-color var(--nscb-duration-base) var(--nscb-ease-standard);
}

.about-values__item:hover .about-values__number {
	-webkit-text-stroke-color: var(--nscb-color-highlight);
}

.about-values__item:first-child {
	grid-column: 1 / -1;
	gap: var(--nscb-space-4);
	margin-bottom: var(--nscb-space-5);
	padding: var(--nscb-space-6) var(--nscb-space-5);
	border: 1px solid color-mix(in srgb, var(--nscb-color-highlight) 30%, var(--nscb-edge));
	border-radius: var(--nscb-radius-xl);
	background-color: var(--nscb-color-bg);
	background-image: radial-gradient(70% 90% at 100% 0%, color-mix(in srgb, var(--nscb-color-highlight) 12%, transparent), transparent 70%);
	box-shadow: var(--nscb-edge-light), var(--nscb-shadow-card);
}

.about-values__item:first-child .about-values__number {
	color: var(--nscb-color-highlight);
	font-size: var(--nscb-text-4xl);
	-webkit-text-stroke: 0;
}

.about-values__item:first-child .about-values__title {
	font-size: var(--nscb-text-2xl);
}

.about-values__title {
	font-size: var(--nscb-text-xl);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: var(--nscb-leading-snug);
}

.about-values__body {
	color: var(--nscb-color-text-secondary);
}

.about-values__title + .about-values__body {
	margin-top: var(--nscb-space-2);
}

@media (min-width: 48rem) {
	.about-values__item:first-child {
		grid-template-columns: auto minmax(0, 1fr);
		align-items: start;
		column-gap: var(--nscb-space-6);
		padding: var(--nscb-space-7);
	}
}

@media (min-width: 64rem) {
	.about-values__grid {
		grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
		gap: var(--nscb-space-8);
		align-items: start;
	}

	.about-values--bare .about-values__grid {
		display: block;
	}

	.about-values__head {
		position: sticky;
		top: calc(var(--nscb-header-height) + var(--nscb-space-6));
	}

	.about-values__item:first-child {
		border-radius: var(--nscb-radius-2xl);
	}
}

@media (forced-colors: active) {
	.about-values__number {
		color: CanvasText;
		-webkit-text-stroke: 0;
	}
}

/* ---------- Photo mosaic ---------- */

.about-gallery__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-auto-rows: clamp(9rem, 40vw, 15rem);
	gap: var(--nscb-space-3);
	padding: 0;
	list-style: none;
}

/* Mobile: a wide lead photo, then pairs; an unpaired last photo goes full width. */
.about-gallery__item:first-child,
.about-gallery__item:last-child:nth-child(even) {
	grid-column: 1 / -1;
}

.about-gallery__grid[data-count="1"] {
	grid-auto-rows: clamp(14rem, 56vw, 34rem);
}

.about-gallery__figure {
	position: relative;
	height: 100%;
	overflow: hidden;
	border: 1px solid var(--nscb-edge);
	border-radius: var(--nscb-radius-lg);
	background-color: var(--nscb-color-surface);
}

.about-gallery__figure img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--nscb-duration-cinematic) var(--nscb-ease-out);
}

.about-gallery__item:hover .about-gallery__figure img {
	transform: scale(1.04);
}

.about-gallery__caption {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	padding: var(--nscb-space-6) var(--nscb-space-4) var(--nscb-space-3);
	background: var(--nscb-overlay-gradient);
	color: var(--nscb-color-text);
	font-size: var(--nscb-text-sm);
}

@media (min-width: 64rem) {
	.about-gallery__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		grid-auto-rows: clamp(12rem, 17vw, 17rem);
		gap: var(--nscb-space-4);
	}

	.about-gallery__item:last-child:nth-child(even) {
		grid-column: auto;
	}

	/* Lead photo spans two columns and two rows; the next two stack beside it. */
	.about-gallery__item:first-child {
		grid-column: span 2;
		grid-row: span 2;
	}

	.about-gallery__grid[data-count="1"] .about-gallery__item:first-child {
		grid-column: 1 / -1;
	}

	.about-gallery__grid[data-count="2"] .about-gallery__item:nth-child(2) {
		grid-row: span 2;
	}

	/* Later rows of three: stretch a lone or paired last photo to close the row. */
	.about-gallery__item:nth-child(n+4):last-child:nth-child(3n+1) {
		grid-column: 1 / -1;
	}

	.about-gallery__item:nth-child(n+4):last-child:nth-child(3n+2) {
		grid-column: span 2;
	}
}

@media (prefers-reduced-motion: reduce) {
	.about-gallery__figure img {
		transition: none;
	}
}
