header.wp-block-template-part {
	max-width: none;
	background: var(--wp--preset--color--white);
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.nffat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	height: 80px;
	max-width: var(--nffat-page-max);
	margin-inline: auto;
	padding-inline: var(--wp--style--root--padding-left) var(--wp--style--root--padding-right);
}

.nffat-header > * {
	margin-block: 0;
}

.nffat-header__logo {
	flex-shrink: 0;
	margin: 0;
}

.nffat-header__logo {
	display: block;
	border-radius: 8px;
}

.nffat-header__logo svg {
	display: block;
	width: 140px;
	height: 48px;
}

.nffat-header__nav {
	flex: 1 1 auto;
	justify-content: center;
}

.nffat-header__nav .wp-block-navigation__container {
	gap: 32px;
}

.nffat-header__nav .wp-block-navigation-item__content {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--wp--preset--color--ink);
	padding: 6px 0;
	border-radius: 4px;
	transition: color 160ms var(--nffat-ease-out);
}

.nffat-header__nav .current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--magenta-600);
}

@media (hover: hover) and (pointer: fine) {
	.nffat-header__nav .wp-block-navigation-item__content:hover {
		color: var(--wp--preset--color--magenta-600);
	}
}

.nffat-header__actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.nffat-header__phone {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 18px;
	border-radius: var(--nffat-radius-pill);
	background: var(--wp--preset--color--teal-50);
	color: var(--wp--preset--color--teal-700);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 160ms var(--nffat-ease-out);
}

.nffat-header__phone .nffat-icon {
	font-size: 16px;
}

.nffat-header__book {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 6px 6px 6px 22px;
	border-radius: var(--nffat-radius-pill);
	background: var(--wp--preset--color--magenta-600);
	color: var(--wp--preset--color--white);
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 160ms var(--nffat-ease-out), transform 160ms var(--nffat-ease-out);
}

.nffat-header__book:active,
.nffat-header__phone:active {
	transform: scale(0.97);
}

.nffat-header__book-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--magenta-600);
}

.nffat-header__book-arrow .nffat-icon {
	font-size: 18px;
	transition: transform 200ms var(--nffat-ease-out);
}

@media (hover: hover) and (pointer: fine) {
	.nffat-header__phone:hover {
		background: var(--wp--preset--color--teal-100);
	}

	.nffat-header__book:hover {
		background: var(--wp--preset--color--magenta-700);
	}

	.nffat-header__book:hover .nffat-header__book-arrow .nffat-icon {
		transform: translate(2px, -2px);
	}
}

.nffat-header__nav .wp-block-navigation__responsive-container-open {
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--wp--preset--color--teal-50);
	color: var(--wp--preset--color--teal-700);
}

.nffat-header__nav .wp-block-navigation__responsive-container.is-menu-open {
	padding: 24px;
	font-family: var(--wp--preset--font-family--display);
}

.wp-block-navigation.nffat-header__nav:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--cream);
	color: var(--wp--preset--color--ink);
}

.nffat-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-container {
	gap: 4px;
	margin: 4px 0 8px;
	padding: 0 0 0 18px;
	border: 0;
	border-left: 2px solid var(--wp--preset--color--magenta-100);
}

.nffat-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 4px 0;
	font-size: clamp(22px, 6vw, 28px);
}

.nffat-header__nav .is-menu-open .wp-block-navigation__responsive-container-close {
	top: 20px;
	right: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--wp--preset--color--white);
}

.nffat-header__nav .is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: 72px;
}

.nffat-header__nav .wp-block-navigation__responsive-container.is-menu-open,
.nffat-header__nav .is-menu-open .wp-block-navigation__container {
	--navigation-layout-justification-setting: flex-start;
	--navigation-layout-justify: flex-start;
}

.nffat-header__nav .is-menu-open .wp-block-navigation__container {
	gap: 8px;
}

.nffat-header__nav .is-menu-open .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(36px, 9vw, 52px);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: -0.01em;
	padding: 4px 0;
}

@media (max-width: 1199px) {
	.nffat-header__nav .wp-block-navigation__container {
		gap: 24px;
	}

	.nffat-header__phone {
		width: 48px;
		padding: 0;
	}

	.nffat-header__phone-number {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

/* Core collapses at 600px; this row needs to collapse earlier. */
@media (min-width: 600px) and (max-width: 1023px) {
	.nffat-header__nav .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.nffat-header__nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}

@media (max-width: 1023px) {
	.nffat-header__nav {
		order: 2;
		flex: 0 0 auto;
	}

	.nffat-header__logo {
		margin-right: auto;
	}

	.nffat-header__actions {
		order: 1;
	}

	.nffat-header {
		gap: 10px;
	}
}

@media (max-width: 599px) {
	.nffat-header {
		height: 68px;
	}

	.nffat-header__logo svg {
		width: 105px;
		height: 36px;
	}

	.nffat-header__actions {
		gap: 6px;
	}

	.nffat-header__phone,
	.nffat-header__nav .wp-block-navigation__responsive-container-open {
		width: 44px;
		height: 44px;
		min-height: 44px;
	}

	.nffat-header__book {
		padding: 2px;
		gap: 0;
	}

	.nffat-header__book-label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.nffat-header__book-arrow {
		background: transparent;
		color: var(--wp--preset--color--white);
	}
}

@media (max-width: 359px) {
	.nffat-header {
		gap: 4px;
		padding-left: 16px;
	}

	.nffat-header__logo svg {
		width: 88px;
		height: 30px;
	}

	.nffat-header__actions {
		gap: 4px;
	}
}

/* Pages that open with a full-bleed photo hero: the header floats, transparent, over it. */
body.has-photo-hero header.wp-block-template-part {
	position: absolute;
	top: var(--wp-admin--admin-bar--height, 0px);
	left: 0;
	right: 0;
	z-index: 20;
	background: transparent;
	border-bottom: 0;
}

body.has-photo-hero .nffat-header {
	background: transparent;
}

body.has-photo-hero .nffat-header__logo {
	--nffat-logo-leaf: var(--wp--preset--color--white);
	--nffat-logo-trunk: var(--wp--preset--color--white);
}

body.has-photo-hero .nffat-header__nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > li > .wp-block-navigation-item__content,
body.has-photo-hero .nffat-header__nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > li > .wp-block-navigation__submenu-icon {
	color: var(--wp--preset--color--white);
}

body.has-photo-hero .nffat-header__nav .wp-block-navigation__responsive-container-open,
body.has-photo-hero .nffat-header__phone {
	background: rgb(255 255 255 / 0.16);
	color: var(--wp--preset--color--white);
}

@media (hover: hover) and (pointer: fine) {
	body.has-photo-hero .nffat-header__nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > li > .wp-block-navigation-item__content:hover {
		color: var(--wp--preset--color--magenta-100);
	}

	body.has-photo-hero .nffat-header__phone:hover {
		background: rgb(255 255 255 / 0.26);
	}
}

body.has-photo-hero :where(.nffat-header) :focus-visible {
	outline-color: var(--wp--preset--color--white);
}

@media (min-width: 1024px) {
	.nffat-header .wp-block-navigation .has-child > .wp-block-navigation__submenu-container {
		left: 50%;
		min-width: 240px;
		background: var(--wp--preset--color--white);
	}

	.nffat-header .wp-block-navigation .has-child > .wp-block-navigation__submenu-container.wp-block-navigation__submenu-container {
		width: max-content;
		min-width: 340px;
		padding: 10px;
		border-radius: 28px;
		box-shadow: 0 2px 0 rgb(4 41 39 / 0.04), 0 28px 60px -18px rgb(238 61 150 / 0.35), 0 18px 40px -20px rgb(4 41 39 / 0.3);
	}

	.nffat-header .wp-block-navigation .has-child .wp-block-navigation__submenu-container > li > .wp-block-navigation-item__content {
		display: grid;
		grid-template-columns: 48px minmax(0, 1fr) 16px;
		grid-template-areas: "icon label arrow" "icon desc arrow";
		justify-content: start;
		align-items: center;
		column-gap: 14px;
		row-gap: 2px;
		padding: 12px 16px 12px 12px;
		border-radius: 20px;
		white-space: nowrap;
		transition: background-color 220ms var(--nffat-ease-out);
	}

	.nffat-header .wp-block-navigation__submenu-container > li > .wp-block-navigation-item__content::before {
		content: "";
		grid-area: icon;
		width: 48px;
		height: 48px;
		border-radius: 16px;
		background: var(--nav-item-tile, var(--wp--preset--color--magenta-50));
		transition: rotate 320ms var(--wp--custom--ease--back), scale 320ms var(--wp--custom--ease--back);
	}

	.nffat-header .wp-block-navigation__submenu-container .wp-block-navigation-item__label {
		grid-area: label;
		font-size: 16px;
		font-weight: 700;
	}

	.nffat-header .wp-block-navigation__submenu-container .wp-block-navigation-item__description {
		grid-area: desc;
		display: block;
		font-size: 13px;
		font-weight: 500;
		color: var(--wp--preset--color--ink-muted);
	}

	.nffat-header .wp-block-navigation__submenu-container > li > .wp-block-navigation-item__content::after {
		grid-area: arrow;
	}

	.nffat-header .wp-block-navigation__submenu-container > li {
		position: relative;
	}

	.nffat-header .wp-block-navigation__submenu-container > li::before {
		content: "";
		position: absolute;
		top: 12px;
		left: 12px;
		z-index: 2;
		width: 48px;
		height: 48px;
		background: var(--nav-item-ink, var(--wp--preset--color--magenta-600));
		-webkit-mask: var(--nav-item-icon) center / 24px no-repeat;
		mask: var(--nav-item-icon) center / 24px no-repeat;
		pointer-events: none;
		transition: rotate 320ms var(--wp--custom--ease--back), scale 320ms var(--wp--custom--ease--back);
	}

	.nffat-header .nffat-nav-item--pupils {
		--nav-item-icon: url("../../icons/backpack.svg");
	}

	.nffat-header .nffat-nav-item--staff {
		--nav-item-icon: url("../../icons/users-three.svg");
		--nav-item-tile: var(--wp--preset--color--teal-50);
		--nav-item-ink: var(--wp--preset--color--teal);
	}

	.nffat-header .wp-block-navigation__submenu-container > .current-menu-item > .wp-block-navigation-item__content {
		background: var(--wp--preset--color--cream);
	}

	.nffat-header .wp-block-navigation-submenu__toggle {
		padding-right: 0;
		cursor: pointer;
	}

	.nffat-header .wp-block-navigation__submenu-icon {
		transition: rotate 240ms var(--nffat-ease-out);
	}

	.nffat-header .has-child:is(:hover, :focus-within) > .wp-block-navigation__submenu-icon,
	.nffat-header .wp-block-navigation-submenu__toggle[aria-expanded="true"] + .wp-block-navigation__submenu-icon {
		rotate: 180deg;
	}
}

/* Core only opens click-mode submenus on click; desktop pointers should also open on hover. */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
	.nffat-header .wp-block-navigation__submenu-container > li > .wp-block-navigation-item__content:hover {
		background: var(--wp--preset--color--cream);
	}

	.nffat-header .wp-block-navigation__submenu-container > li:hover::before,
	.nffat-header .wp-block-navigation__submenu-container > li:hover > .wp-block-navigation-item__content::before {
		rotate: -8deg;
		scale: 1.08;
	}

	.nffat-header .open-on-click:hover > .wp-block-navigation__submenu-container {
		visibility: visible;
		opacity: 1;
		width: auto;
		height: auto;
		min-width: 240px;
		overflow: visible;
	}
}
