/* Feature cards section (sections/feature-cards.php). Figma: Home 64:70 "Our facilities". */
.pe-feature-cards {
	/* 57px between the 400px cards at 1440. */
	--pe-fc-gap: clamp(1.25rem, 3.96vw, 3.5625rem);
	/* The round icon on the photo/panel join: 98px at 1440. */
	--pe-fc-icon: clamp(4.5rem, 6.81vw, 6.125rem);

	/* 40px above the heading and below the cards at 1440. */
	padding-block: clamp(2rem, 2.75vw, 2.5rem);
}

.pe-feature-cards__header {
	margin-bottom: clamp(2rem, 3.6vw, 3.25rem); /* 52px */
	text-align: center;
}

.pe-feature-cards__heading {
	margin: 0;
	font-size: clamp(2.25rem, 4.861vw, 4.375rem); /* 70px */
	line-height: 1.14;
}

.pe-feature-cards__intro {
	margin: 0;
	font-size: clamp(1.125rem, 2.144vw, 1.929rem); /* 30.9px: a touch above the lead token */
	line-height: 1.4;
}

/* Three 400px cards are 1314px wide, 44px more than the 1270px column, so the row
   reaches a little into the side gutters (never more than half of them). */
.pe-feature-cards__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--pe-fc-gap);
	margin: 0;
	margin-inline: max(calc(var(--pe-gutter) * -0.5), min(0px, calc((100% - 82.125rem) / 2)));
	padding: 0;
	list-style: none;
}

.pe-feature-cards__item {
	display: flex;
	flex: 0 1 calc((100% - var(--pe-fc-gap) * 2) / 3);
	min-width: 0;
}

.pe-feature-cards__card {
	display: flex;
	flex-direction: column;
	width: 100%;
	color: inherit;
	text-decoration: none;
}

.pe-feature-cards__photo {
	flex-shrink: 0;
}

/* Cream panel under the photo: 276px tall at 1440, 50px bottom corners. */
.pe-feature-cards__body {
	position: relative;
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	padding: calc(var(--pe-fc-icon) / 2 + 0.5625rem) 0.5rem 1rem;
	border: 1.5px solid var(--pe-beige);
	border-radius: 0 0 var(--pe-radius-card-lg) var(--pe-radius-card-lg);
	background: var(--pe-cream);
	text-align: center;
}

/* Centred on the join between photo and panel (the outer edge of the panel border). */
.pe-feature-cards__icon {
	position: absolute;
	top: -1.5px;
	left: 50%;
	width: var(--pe-fc-icon);
	transform: translate(-50%, -50%);
}

.pe-feature-cards__title {
	margin: 0;
	font-size: var(--pe-text-h3);
	line-height: 1.2;
}

.pe-feature-cards__text {
	margin: 0.908rem 0 0;
	font-size: var(--pe-text-body);
	line-height: 1.27; /* 29px */
}

/* Pinned to the bottom so the arrows line up when the texts differ in length. */
.pe-feature-cards__arrow {
	display: block;
	margin-top: auto;
	padding-top: 0.908rem;
	font-size: clamp(2rem, 2.9vw, 2.61rem); /* 41.8px: a 42px-tall row, as in Figma */
	line-height: 1;
	transition: transform 0.2s ease;
}

/* The arrow (pe_arrow()) is 29 × 10 at 1440, centred in the 42px row. */
.pe-feature-cards__arrow .pe-arrow {
	display: block;
	width: 0.694em;
	height: 1em;
}

.pe-feature-cards__card--link {
	transition: transform 0.2s ease;
}

.pe-feature-cards__card--link:hover {
	transform: translateY(-0.375rem);
}

.pe-feature-cards__card--link:hover .pe-feature-cards__arrow {
	transform: translateX(0.375rem);
}

@media (prefers-reduced-motion: reduce) {
	.pe-feature-cards__card--link,
	.pe-feature-cards__arrow {
		transition: none;
	}

	.pe-feature-cards__card--link:hover,
	.pe-feature-cards__card--link:hover .pe-feature-cards__arrow {
		transform: none;
	}
}

/* 900–1023: still three, narrower cards. The line breaks typed in the text no longer
   fit, so let the lines flow and even them out instead. */
@media (min-width: 900px) and (max-width: 1023px) {
	.pe-feature-cards__text {
		text-wrap: balance;
	}

	.pe-feature-cards__text br {
		display: none;
	}
}

/* Below 900: two cards per row, the third centred under them. */
@media (max-width: 899px) {
	.pe-feature-cards__item {
		flex-basis: calc((100% - var(--pe-fc-gap)) / 2);
	}
}

/* Phones: one card per row, never wider than the 400px design. */
@media (max-width: 767px) {
	.pe-feature-cards {
		--pe-fc-gap: 2.5rem;
		--pe-fc-icon: 5.5rem;
	}

	.pe-feature-cards__list {
		margin-inline: 0;
	}

	.pe-feature-cards__item {
		flex-basis: 100%;
		max-width: 25rem;
	}
}
