/* Pages laid out with the "Designed page" template: About, Contact, News and press, Tomorrow's Lifesavers. */
.nffat-designed {
	display: flex;
	flex-direction: column;
	gap: 48px;
}

.nffat-designed > * {
	box-sizing: border-box;
	width: 100%;
}

.nffat-designed__title {
	margin-block: 24px 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	font-size: clamp(42px, 5.4vw, 80px);
	line-height: 0.98;
	letter-spacing: -0.025em;
	text-wrap: balance;
	overflow-wrap: anywhere;
}

.nffat-designed__content {
	display: flex;
	flex-direction: column;
	gap: 96px;
	font-size: 18px;
	line-height: 1.65;
}

.nffat-designed__content > * {
	margin: 0;
}

.nffat-designed__content :is(h2, h3) {
	margin: 0 0 16px;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	line-height: 1.05;
	letter-spacing: -0.02em;
}

.nffat-designed__content h2 {
	font-size: clamp(32px, 3.4vw, 48px);
}

.nffat-designed__content h3 {
	font-size: 22px;
	letter-spacing: 0;
}

.nffat-designed__content p {
	margin: 0 0 16px;
}

.nffat-designed__content figure {
	margin: 0;
}

.nffat-designed__content img {
	display: block;
	max-width: 100%;
	height: auto;
}

.nffat-designed__content :is(.nffat-info-cards, .nffat-contact, .nffat-split, .nffat-statement) > * {
	margin: 0;
}

/* Text beside a photo */
.nffat-split {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: center;
	gap: clamp(32px, 5vw, 80px);
}

.nffat-split.is-image-first .nffat-split__media {
	order: -1;
}

.nffat-split__text {
	max-width: 620px;
}

.nffat-split__text > :last-child {
	margin-bottom: 0;
}

.nffat-split__image img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--nffat-radius-card);
}

/* Vision statement */
.nffat-statement {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
	align-items: center;
	gap: clamp(32px, 5vw, 72px);
	padding: clamp(32px, 5vw, 72px);
	position: relative;
	isolation: isolate;
	overflow: hidden;
	border-radius: var(--nffat-radius-panel);
	background: var(--wp--preset--color--teal);
	color: var(--wp--preset--color--white);
}

.nffat-statement::before {
	content: "";
	position: absolute;
	bottom: -18%;
	left: -8%;
	z-index: -1;
	width: min(62%, 860px);
	aspect-ratio: 720 / 768;
	background: rgb(255 255 255 / 0.06);
	-webkit-mask: url("../../shapes/tree.svg") center / contain no-repeat;
	mask: url("../../shapes/tree.svg") center / contain no-repeat;
	transform-origin: 50% 100%;
	pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
	.nffat-motion .nffat-statement:not(.is-in)::before {
		opacity: 0;
	}

	.nffat-statement.is-in::before {
		animation:
			nffat-tree-grow 1800ms var(--wp--custom--ease--out) 200ms both,
			nffat-tree-sway 9s ease-in-out 2s infinite alternate;
	}

	@supports (animation-timeline: view()) {
		.nffat-statement::before {
			translate: 0 0;
		}

		.nffat-statement.is-in::before {
			animation:
				nffat-tree-grow 1800ms var(--wp--custom--ease--out) 200ms both,
				nffat-tree-sway 9s ease-in-out 2s infinite alternate,
				nffat-tree-drift linear both;
			animation-timeline: auto, auto, view();
		}
	}
}

@keyframes nffat-tree-grow {
	from { opacity: 0; scale: 0.7; }
}

@keyframes nffat-tree-sway {
	from { rotate: -2deg; }
	to { rotate: 2deg; }
}

@keyframes nffat-tree-drift {
	from { translate: 0 60px; }
	to { translate: 0 -60px; }
}

.nffat-statement__text {
	margin: 0 !important;
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(24px, 2.4vw, 34px);
	line-height: 1.2;
	text-wrap: pretty;
}

.nffat-statement__image img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: var(--nffat-radius-card);
}

/* Team: polaroids, each tipped a little and held by a strip of tape in a brand colour. */
.nffat-team__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 40px 28px;
	margin: 0;
	padding: 16px 8px;
	list-style: none;
}

.nffat-team__card:nth-child(4n+1) { --tape: var(--wp--preset--color--teal); }
.nffat-team__card:nth-child(4n+2) { --tape: var(--wp--preset--color--magenta); }
.nffat-team__card:nth-child(4n+3) { --tape: var(--wp--preset--color--leaf); }
.nffat-team__card:nth-child(4n+4) { --tape: var(--wp--preset--color--teal-700); }

.nffat-team__link {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
	height: 100%;
	box-sizing: border-box;
	padding: 12px 12px 22px;
	border-radius: 6px;
	background: var(--wp--preset--color--white);
	box-shadow: 0 14px 30px -18px rgb(4 41 39 / 0.45);
	color: var(--wp--preset--color--ink);
	text-decoration: none;
	rotate: -2deg;
}

.nffat-team__card:nth-child(even) .nffat-team__link {
	rotate: 1.6deg;
}

.nffat-team__card:nth-child(3n) .nffat-team__link {
	rotate: -0.8deg;
}

.nffat-team__link::before {
	content: "";
	position: absolute;
	top: -12px;
	left: 50%;
	z-index: 1;
	width: 84px;
	height: 24px;
	translate: -50% 0;
	rotate: -3deg;
	background: color-mix(in srgb, var(--tape) 45%, transparent);
}

.nffat-team__photo {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	margin-bottom: 12px;
	border-radius: 2px;
	background: var(--wp--preset--color--teal-50);
}

.nffat-team__photo.is-empty {
	display: grid;
	place-items: center;
	background: var(--wp--preset--color--teal);
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(48px, 5vw, 72px);
	color: var(--wp--preset--color--white);
}

.nffat-team__name {
	font-family: var(--wp--preset--font-family--hand);
	font-size: 30px;
	line-height: 1.05;
	text-align: center;
}

.nffat-team__role {
	font-size: 14px;
	line-height: 1.4;
	text-align: center;
	color: var(--wp--preset--color--ink-muted);
}

.nffat-team__link:focus-visible {
	outline-offset: 6px;
}

/* Contact */
.nffat-contact {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
	align-items: start;
	gap: clamp(32px, 4vw, 56px);
}

.nffat-contact__form,
.nffat-contact__info {
	padding: clamp(24px, 3vw, 40px);
	border-radius: var(--nffat-radius-card);
	background: var(--wp--preset--color--white);
}

.nffat-contact__info {
	display: flex;
	flex-direction: column;
	gap: 28px;
	background: var(--wp--preset--color--teal-50);
}

.nffat-contact__info > h2,
.nffat-contact__info .wp-block-buttons,
.nffat-contact__item > :last-child {
	margin-bottom: 0;
}

.nffat-contact__item h3 {
	margin-bottom: 6px;
}

.nffat-contact__item p {
	margin-bottom: 6px;
}

.nffat-contact__small {
	font-size: 15px;
	color: var(--wp--preset--color--ink-muted);
}

.nffat-designed__content .nffat-contact__map {
	display: block;
	width: 100vw;
	max-width: none;
	height: clamp(380px, 60vh, 620px);
	margin-inline: calc(50% - 50vw);
	border: 0;
}

.nffat-contact-form__sent h2 {
	margin-bottom: 8px;
}

/* Press list */
.nffat-press {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: 900px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nffat-press > li {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 20px 24px;
	border-radius: var(--nffat-radius-inner);
	background: var(--wp--preset--color--white);
}

.nffat-press a {
	font-size: 19px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
	.nffat-press a:hover {
		text-decoration: underline;
	}
}

.nffat-press__meta {
	font-size: 15px;
	color: var(--wp--preset--color--ink-muted);
}

/* Tomorrow's Lifesavers */
.nffat-info-cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	align-items: start;
}

.nffat-info-card {
	padding: 28px;
	border-radius: var(--nffat-radius-card);
	background: var(--wp--preset--color--white);
}

.nffat-info-card__icon img {
	width: 48px;
	height: 48px;
	margin-bottom: 16px;
}

.nffat-info-card .nffat-info-card__title {
	font-size: 28px;
}

.nffat-info-card p {
	color: var(--wp--preset--color--ink-muted);
}

:is(.nffat-info-card__more, .nffat-ladder__step) > summary {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	min-height: 44px;
	font-weight: 700;
	color: var(--wp--preset--color--ink);
	cursor: pointer;
	list-style: none;
}

:is(.nffat-info-card__more, .nffat-ladder__step) > summary::-webkit-details-marker {
	display: none;
}

:is(.nffat-info-card__more, .nffat-ladder__step) > summary::after {
	content: "";
	flex: none;
	width: 10px;
	height: 10px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-3px) rotate(45deg);
	transition: transform 200ms var(--nffat-ease-out);
}

:is(.nffat-info-card__more, .nffat-ladder__step)[open] > summary::after {
	transform: translateY(2px) rotate(-135deg);
}

.nffat-info-card__more > summary {
	justify-content: flex-start;
	color: var(--wp--preset--color--magenta-700);
}

.nffat-info-card__more > :not(summary) {
	font-size: 16px;
}

.nffat-ladder__step {
	margin-bottom: 10px;
	padding: 0 22px;
	border-radius: var(--nffat-radius-inner);
	background: var(--wp--preset--color--white);
}

.nffat-ladder__step > summary {
	padding-block: 16px;
	line-height: 1.35;
}

.nffat-ladder__step > :not(summary) {
	font-size: 16px;
	color: var(--wp--preset--color--ink-muted);
}

.nffat-ladder__step > :last-child {
	padding-bottom: 18px;
}

.nffat-ladder .wp-block-buttons {
	margin-top: 24px;
}

.nffat-ladder {
	align-items: stretch;
}

/* The photo grows and shrinks with the accordion beside it. */
.nffat-ladder .nffat-split__media {
	position: relative;
	min-height: 320px;
}

.nffat-ladder .nffat-split__image {
	position: absolute;
	inset: 0;
	margin: 0;
}

.nffat-ladder .nffat-split__image img {
	height: 100%;
	aspect-ratio: auto;
}

.nffat-ladder__step {
	transition: background-color 240ms var(--nffat-ease-out), box-shadow 240ms var(--nffat-ease-out);
}

.nffat-ladder__step[open] {
	box-shadow: inset 4px 0 0 var(--wp--preset--color--magenta), 0 10px 24px rgb(4 41 39 / 0.08);
}

.nffat-ladder__step > summary {
	transition: color 200ms var(--nffat-ease-out);
}

.nffat-ladder__step[open] > summary {
	color: var(--wp--preset--color--magenta-700);
}

/* Browsers that can animate to auto height slide the answer open; others open it instantly. */
@supports (interpolate-size: allow-keywords) {
	:is(.nffat-info-card__more, .nffat-ladder__step) {
		interpolate-size: allow-keywords;
	}

	:is(.nffat-info-card__more, .nffat-ladder__step)::details-content {
		block-size: 0;
		overflow: hidden;
		opacity: 0;
		transition: block-size 420ms var(--wp--custom--ease--out), opacity 300ms var(--wp--custom--ease--out), content-visibility 420ms allow-discrete;
	}

	:is(.nffat-info-card__more, .nffat-ladder__step)[open]::details-content {
		block-size: auto;
		opacity: 1;
	}
}

@media (hover: hover) and (pointer: fine) {
	.nffat-ladder__step:not([open]):hover {
		background: var(--wp--preset--color--magenta-50);
	}

	:is(.nffat-info-card__more, .nffat-ladder__step):not([open]) > summary:hover::after {
		transform: translateY(0) rotate(45deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	:is(.nffat-info-card__more, .nffat-ladder__step)::details-content,
	.nffat-ladder__step,
	.nffat-ladder__step > summary {
		transition: none;
	}
}

.nffat-designed .wp-block-embed {
	max-width: 1040px;
	margin-inline: auto;
}

.nffat-designed .wp-block-embed iframe {
	border-radius: var(--nffat-radius-card);
}

.nffat-gallery.wp-block-gallery {
	gap: 16px;
}

.nffat-gallery.wp-block-gallery img {
	border-radius: var(--nffat-radius-inner);
}

@media (max-width: 1099px) {
	.nffat-team__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.nffat-info-cards,
	.nffat-contact {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 899px) {
	.nffat-split,
	.nffat-statement {
		grid-template-columns: minmax(0, 1fr);
	}

	.nffat-split .nffat-split__media {
		order: -1;
	}
}

@media (max-width: 699px) {
	.nffat-designed__content {
		gap: 64px;
		font-size: 17px;
	}

	.nffat-team__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 32px 16px;
	}

	.nffat-team__name {
		font-size: 24px;
	}

	.nffat-info-card,
	.nffat-press > li {
		padding: 20px;
	}
}
