/* School staff page (template "page-school-staff"). */
main.nffat-staff {
	margin-block-start: 0;
	padding-top: 0;
}

.nffat-staff .nffat-designed__content :is(h1, h2) {
	color: var(--wp--preset--color--teal-700);
}

/* Hero: edge to edge, text on the page gutter, photo against the right edge. */
.nffat-designed__content > .nffat-staff-hero {
	--staff-gutter: max(var(--wp--style--root--padding-left), calc((100vw - var(--nffat-page-max)) / 2 + var(--wp--style--root--padding-left)));
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 0;
	width: 100vw;
	max-width: none;
	margin-inline: calc(50% - 50vw);
	padding: 0;
	background: var(--wp--preset--color--teal-50);
}

.nffat-staff-hero__text {
	align-self: center;
	padding: clamp(48px, 7vw, 112px) clamp(32px, 5vw, 72px) clamp(48px, 7vw, 112px) var(--staff-gutter);
}

.nffat-staff-hero__text > * {
	max-width: 560px;
}

.nffat-staff .nffat-staff-hero h1 {
	margin-top: 0;
	margin-bottom: 20px;
	font-size: clamp(40px, 5vw, 64px);
	line-height: 1.05;
}

.nffat-staff-hero > .nffat-staff-hero__media {
	margin: 0;
}

.nffat-staff-hero__media {
	position: relative;
	min-height: 520px;
	overflow: hidden;
}

.nffat-staff .nffat-staff-hero__media figure {
	position: absolute;
	inset: 0;
	margin: 0;
}

.nffat-staff .nffat-staff-hero__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Three routes */
.nffat-staff-routes__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	margin-top: 32px;
}

.nffat-staff-route {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: clip;
	border-radius: var(--nffat-radius-card);
	background: var(--wp--preset--color--white);
	box-shadow: 0 1px 0 var(--wp--preset--color--line), 0 10px 30px rgb(4 41 39 / 0.08);
	transition: transform 200ms var(--nffat-motion-ease), box-shadow 200ms var(--nffat-motion-ease);
}

.nffat-staff .nffat-staff-route__photo {
	margin: 0;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.nffat-staff .nffat-staff-route__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: scale 400ms var(--nffat-motion-ease);
}

.nffat-staff-route__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 0 28px 28px;
}

/* The icon sits half over the photo, so the card reads as one piece. */
.nffat-staff .nffat-staff-route__icon {
	/* Above the photo, which is scaled on hover and would otherwise paint over it. */
	position: relative;
	z-index: 1;
	transition: rotate 300ms var(--nffat-motion-ease);
	width: 80px;
	margin: -40px 0 8px;
	border-radius: 50%;
	background: var(--wp--preset--color--white);
	box-shadow: 0 0 0 6px var(--wp--preset--color--white);
}

.nffat-staff-route h3 {
	margin: 0 0 8px;
	font-size: 26px;
}

.nffat-staff-route__body > .wp-block-buttons {
	margin-top: auto;
	padding-top: 16px;
}

@media (hover: hover) and (pointer: fine) {
	.nffat-staff-route:hover {
		transform: translateY(-4px);
		box-shadow: 0 1px 0 var(--wp--preset--color--line), 0 18px 40px rgb(4 41 39 / 0.14);
	}

	.nffat-staff-route:hover .nffat-staff-route__photo img {
		scale: 1.04;
	}

	.nffat-staff-route:hover .nffat-staff-route__icon {
		rotate: -4deg;
	}
}

/* Pupils too: a quiet link across to Tomorrows Lifesavers. */
.nffat-staff-pupils {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 28px;
	padding: clamp(24px, 4vw, 40px);
	border-radius: var(--nffat-radius-card);
	background: var(--wp--preset--color--mint);
}

.nffat-staff .nffat-staff-pupils__logo {
	width: 160px;
	margin: 0;
}

.nffat-staff-pupils h2 {
	margin: 0 0 6px;
	font-size: 28px;
}

.nffat-staff-pupils p {
	margin: 0;
}

@media (max-width: 899px) {
	.nffat-designed__content > .nffat-staff-hero,
	.nffat-staff-routes__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.nffat-staff-hero__text {
		padding: 40px var(--staff-gutter);
	}

	.nffat-staff-hero__media {
		min-height: 0;
		aspect-ratio: 4 / 3;
	}

	.nffat-staff-routes__grid {
		max-width: 520px;
	}

	.nffat-staff-pupils {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}
}

@media (max-width: 599px) {
	.nffat-staff .wp-block-button,
	.nffat-staff .wp-block-button__link {
		white-space: normal;
		text-align: left;
	}
}
