/**
 * CSEP Healthing feed: the latest Healthing.ca articles as cards.
 *
 * Colours and fonts use the site's Automatic.css variables, with the dev site's
 * current values as fallbacks so the mock-up renders standalone.
 */
.csep-healthing {
	--csep-primary: var(--primary, #202945);
	--csep-secondary: var(--secondary, #306bfc);
	--csep-neutral: var(--neutral, #eef4ff);
	--csep-base: var(--base, #1f2937);
	--csep-muted: var(--text-dark-muted, #6b7280);
	--csep-white: var(--white, #fff);
	--csep-radius: 24px;
	--csep-heading-font: var(--heading-font-family, "Helvetica Neue", Helvetica, Arial, sans-serif);
	--csep-text-font: var(--text-font-family, Arial, Helvetica, sans-serif);

	/* Layout responds to the column the feed sits in, not the screen. */
	container: csep-healthing / inline-size;
	width: 100%;
	max-width: 1200px;
	margin-inline: auto;
	font-family: var(--csep-text-font);
	color: var(--csep-base);
	font-size: 15px;
	line-height: 1.45;
	text-align: left;
}

.csep-healthing *,
.csep-healthing *::before,
.csep-healthing *::after {
	box-sizing: border-box;
}

/* Always fill the column: Bricks containers can shrink elements to their content. */
.brxe-shortcode:has(> .csep-healthing) {
	width: 100%;
}

.csep-healthing .sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Articles past the first batch, and the button once they are all showing. */
.csep-healthing [hidden] {
	display: none !important;
}

/* ---------- Grid ---------- */

.csep-healthing__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}

.csep-healthing__item {
	display: flex;
	min-width: 0;
	margin: 0;
	padding: 0;
}

/* ---------- Card ---------- */

.csep-healthing__card {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	background: var(--csep-white);
	border-radius: var(--csep-radius);
	overflow: hidden;
	transition: box-shadow 0.2s, transform 0.2s;
}

.csep-healthing__card:hover {
	box-shadow: 0 14px 32px rgba(32, 41, 69, 0.14);
	transform: translateY(-3px);
}

.csep-healthing__media {
	position: relative;
	flex: none;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	/* Shows while the photo loads, or if it can't be reached. */
	background: var(--csep-primary);
}

.csep-healthing__media img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.csep-healthing__card:hover .csep-healthing__media img {
	transform: scale(1.04);
}

.csep-healthing__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
	padding: 24px 24px 26px;
}

.csep-healthing__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	margin: 0;
	font-size: 13px;
	line-height: 1.3;
	color: var(--csep-muted);
}

/* Language note on the French pages, where the articles are in English. */
.csep-healthing__lang {
	padding: 2px 9px;
	border-radius: 100px;
	background: var(--csep-neutral);
	color: var(--csep-primary);
	font-size: 12px;
	font-weight: 700;
}

.csep-healthing__title {
	margin: 0;
	font-family: var(--csep-heading-font);
	font-size: 19px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--csep-primary);
	text-wrap: pretty;
}

.csep-healthing__title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.15s;
}

/* The title link covers the whole card, so there is one link per article. */
.csep-healthing__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: var(--csep-radius);
}

.csep-healthing__card:hover .csep-healthing__title a {
	color: var(--csep-secondary);
}

.csep-healthing__title a:focus-visible {
	outline: none;
}

.csep-healthing__title a:focus-visible::after {
	outline: 3px solid var(--csep-secondary);
	outline-offset: -3px;
}

.csep-healthing__excerpt {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: var(--csep-muted);
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
}

.csep-healthing__more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: auto 0 0; /* pinned to the bottom so the links line up across a row */
	padding-top: 8px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--csep-secondary);
}

.csep-healthing__card:hover .csep-healthing__more span {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.csep-healthing__more svg {
	flex: none;
	width: 14px;
	height: 14px;
	transition: transform 0.2s;
}

.csep-healthing__card:hover .csep-healthing__more svg {
	transform: translate(2px, -2px);
}

/* ---------- See More ---------- */

.csep-healthing__foot {
	display: flex;
	justify-content: center;
	margin: 40px 0 0;
}

.csep-healthing__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font: inherit;
	font-size: 15px;
	line-height: 1.2;
	letter-spacing: 0.02em;
	color: var(--csep-white);
	background: var(--csep-secondary);
	border: 1px solid var(--csep-secondary);
	border-radius: var(--btn-radius, 100px);
	padding: 10.5px 27px;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s, border-color 0.15s;
}

.csep-healthing__btn:hover {
	background: var(--csep-primary);
	border-color: var(--csep-primary);
}

.csep-healthing__btn:focus-visible {
	outline: 2px solid var(--csep-secondary);
	outline-offset: 2px;
}

/* Articles the button has just added ease in. */
.csep-healthing__item.is-new {
	animation: csep-healthing-in 0.35s ease both;
}

@keyframes csep-healthing-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
}

/* ---------- Narrower columns ---------- */

/* Tablet-width column: one article per row, photo beside the text. */
@container csep-healthing (max-width: 899px) {
	.csep-healthing__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.csep-healthing__card {
		flex-direction: row;
		min-height: 190px;
	}

	.csep-healthing__media {
		flex: 0 0 38%;
		aspect-ratio: auto;
	}

	.csep-healthing__body {
		padding: 22px 24px 24px;
	}
}

/* Phone-width column: photo back on top. */
@container csep-healthing (max-width: 559px) {
	.csep-healthing__grid {
		--csep-radius: 16px;
	}

	.csep-healthing__card {
		flex-direction: column;
		min-height: 0;
	}

	.csep-healthing__media {
		flex: none;
		aspect-ratio: 16 / 9;
	}

	.csep-healthing__body {
		padding: 18px 18px 20px;
	}

	.csep-healthing__title {
		font-size: 18px;
	}

	.csep-healthing__foot {
		margin-top: 28px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.csep-healthing *,
	.csep-healthing *::before,
	.csep-healthing *::after {
		transition: none !important;
		animation: none !important;
	}

	.csep-healthing__card:hover,
	.csep-healthing__card:hover .csep-healthing__media img,
	.csep-healthing__card:hover .csep-healthing__more svg {
		transform: none;
	}
}
