/* ==========================================================================
   Pulses page
   A compact editorial page: a short cream intro, then one compact row per
   pulse type in the site container. Each row puts photos and text side by
   side, swapping sides each row (text first on ivory rows, photos first on
   cream rows), and stays near 500px tall on desktop. One column on small
   screens, photos always above the text. Why Canadian pulses reuses the Why
   partner rows (why-partner.css); a quiet ivory closing line ends the page.
   ========================================================================== */

.ph-pulses-page {
	--ph-container: 70rem; /* about 1120px of content, narrower than the home page */
	--ph-sec-muted: rgb(var(--ph-deep-rgb) / 0.78);
	--ph-sec-line: rgb(var(--ph-deep-rgb) / 0.14);

	background: var(--ph-cream);
	color: var(--ph-deep);
}

/* Intro (cream)
   ========================================================================== */

.ph-pulses-intro {
	padding-top: calc(var(--ph-header-h) + var(--ph-space-l));
	padding-bottom: var(--ph-block-space);
	background: var(--ph-cream);
}

.ph-pulses-intro__inner {
	display: grid;
	gap: var(--ph-stack-space);
	justify-items: start;
}

.ph-pulses-intro__title {
	font-size: var(--ph-fs-h2);
	font-weight: var(--ph-fw-display);
	letter-spacing: -0.025em;
	line-height: 1.05;
}

.ph-pulses-intro__lead {
	max-width: 58ch;
	font-size: var(--ph-fs-lead);
	line-height: 1.6;
	color: var(--ph-sec-muted);
	text-wrap: balance;
}

/* Pulse rows
   ========================================================================== */

.ph-pulse {
	padding-block: var(--ph-block-space);
	background: var(--ph-ivory);
}

.ph-pulse--media-first {
	background: var(--ph-cream);
}

.ph-pulse__grid {
	display: grid;
	gap: var(--ph-space-m);
	align-items: center;
}

@media (min-width: 64rem) {
	/* Photos about 52%, text about 48%, so the photo carries the row while
	   the row stays near 500px tall at a 4:3 crop. */
	.ph-pulse__grid {
		grid-template-columns: minmax(0, 11fr) minmax(0, 10fr);
		column-gap: var(--ph-space-xl);
	}

	/* The photos come first in the markup (first on phones); on text-first
	   rows they move to the right column and the columns swap widths. */
	.ph-pulse--text-first .ph-pulse__grid {
		grid-template-columns: minmax(0, 10fr) minmax(0, 11fr);
	}

	.ph-pulse--text-first .ph-pulse__media {
		order: 2;
	}

	.ph-pulse .ph-pulse__media {
		max-width: none; /* fills the whole photo column, compositions too */
	}

	/* The text sits against the photo, never adrift in its column. */
	.ph-pulse--text-first .ph-pulse__text {
		justify-self: end;
	}
}

/* Photos: every composition is one 4:3 frame at the same size. One photo
   fills it; several photos share it as a lead photo with one or two
   smaller photos beside it. */
.ph-pulse__media {
	display: grid;
	gap: var(--ph-space-xs);
	grid-template-rows: minmax(0, 1fr);
	width: 100%;
	max-width: 36rem;
	aspect-ratio: 4 / 3;
	overflow: hidden; /* the 4:5 files never stretch the frame */
}

.ph-pulse__photo {
	margin: 0;
	overflow: hidden;
	min-height: 0;
	background: rgb(var(--ph-deep-rgb) / 0.06);
}

.ph-pulse__photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ph-pulse__media--2,
.ph-pulse__media--3 {
	grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}

.ph-pulse__media--3 {
	grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}

.ph-pulse__media--3 .ph-pulse__photo:first-child {
	grid-row: span 2;
}

/* Text: a comfortable measure, centred against the photos. */
.ph-pulse__text {
	display: grid;
	align-content: start;
	gap: var(--ph-stack-space);
	width: 100%;
	max-width: 30rem;
}

.ph-pulse__title {
	padding-bottom: var(--ph-space-xs);
	border-bottom: 1px solid var(--ph-sec-line);
	font-size: var(--ph-fs-h2);
	font-weight: var(--ph-fw-display);
	letter-spacing: -0.022em;
	line-height: 1.08;
}

.ph-pulse__desc {
	font-size: var(--ph-fs-text);
	line-height: 1.6;
	color: var(--ph-sec-muted);
}

.ph-pulse__varieties {
	margin: 0;
	padding: 0;
	list-style: none;
	border-bottom: 1px solid var(--ph-sec-line);
}

.ph-pulse__varieties li {
	padding-block: var(--ph-space-2xs);
	border-top: 1px solid var(--ph-sec-line);
	font-family: var(--ph-font-heading);
	font-size: var(--ph-fs-text);
	font-weight: var(--ph-fw-heading);
	line-height: 1.4;
}

/* Why Canadian pulses: the home page rows, on the page's tighter rhythm.
   ========================================================================== */

.ph-why--pulses {
	padding-block: var(--ph-space-l);
}

@media (min-width: 64rem) {
	.ph-why--pulses {
		padding-block: var(--ph-space-xl);
	}
}

/* Closing line (ivory, after the cream Why section)
   ========================================================================== */

.ph-pulses-close {
	padding-block: var(--ph-block-space);
	background: var(--ph-ivory);
}

.ph-pulses-close__inner {
	display: grid;
	gap: var(--ph-space-xs);
	justify-items: center;
	text-align: center;
}

.ph-pulses-close__text {
	max-width: 58ch;
	font-size: var(--ph-fs-lead);
	line-height: 1.6;
	color: var(--ph-sec-muted);
	text-wrap: balance;
}

.ph-pulses-close__link {
	font-family: var(--ph-font-heading);
	font-size: var(--ph-fs-h3);
	font-weight: var(--ph-fw-heading);
	letter-spacing: -0.01em;
	color: var(--ph-deep);
	text-decoration: underline;
	text-decoration-color: rgb(var(--ph-forest-rgb) / 0.5);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.3em;
	transition: text-decoration-color var(--ph-dur-base) var(--ph-ease-out);
}

.ph-pulses-close__link:hover,
.ph-pulses-close__link:focus-visible {
	text-decoration-color: var(--ph-forest);
}

/* Motion: photos settle from a slight scale as their row fades in
   (the fade itself comes from the shared reveal in motion.css).
   ========================================================================== */

.ph-motion .ph-pulse__media[data-reveal] img {
	scale: 1.03;
	transition: scale 1.2s var(--ph-ease-soft) var(--ph-delay, 0ms);
}

.ph-motion .ph-pulse__media.is-inview img {
	scale: 1;
}
