:root {
	--nffat-radius-pill: var(--wp--custom--radius--pill);
	--nffat-radius-card: var(--wp--custom--radius--card);
	--nffat-radius-panel: var(--wp--custom--radius--panel);
	--nffat-radius-inner: var(--wp--custom--radius--inner);
	--nffat-ease-out: var(--wp--custom--ease--out);
	--nffat-page-max: 1440px;
}

/* Full-bleed pieces use 100vw, which includes the scrollbar; clip the sliver it would add. */
body {
	overflow-x: clip;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

.wp-site-blocks > :where(:not(main)),
.wp-site-blocks > main > :where(:not(.alignfull)) {
	max-width: var(--nffat-page-max);
	margin-inline: auto;
}

:where(.wp-site-blocks) :focus-visible {
	outline: 3px solid var(--wp--preset--color--magenta-600);
	outline-offset: 3px;
}

.nffat-icon {
	width: 1em;
	height: 1em;
	flex-shrink: 0;
	display: block;
}

.nffat-shape {
	display: block;
	pointer-events: none;
}

/* Buttons: one primitive, colour set by modifier. */
.nffat-btn {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border-radius: var(--nffat-radius-pill);
	padding: 14px 22px;
	font-family: var(--wp--preset--font-family--body);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	border: 2px solid transparent;
	transition: transform 160ms var(--nffat-ease-out), background-color 160ms var(--nffat-ease-out), color 160ms var(--nffat-ease-out);
}

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

.nffat-btn:active {
	transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
	.nffat-btn:hover .nffat-icon {
		transform: translateX(3px);
	}
}

.nffat-btn--lg {
	padding: 16px 24px;
	font-size: 16px;
}

/* core/button puts our classes on its wrapper div; move the padding onto the link so the whole pill is clickable. */
.wp-block-button.nffat-btn {
	padding: 0;
}

.wp-block-button.nffat-btn > .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 22px;
	background: none;
	color: inherit;
	font: inherit;
	border-radius: inherit;
}

.wp-block-button.nffat-btn--lg > .wp-block-button__link {
	padding: 16px 24px;
}

.nffat-btn--arrow > .wp-block-button__link::after {
	content: "";
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	background: currentColor;
	mask: url("../icons/arrow-right.svg") center / contain no-repeat;
	transition: transform 200ms var(--nffat-ease-out);
}

@media (hover: hover) and (pointer: fine) {
	.nffat-btn--arrow:hover > .wp-block-button__link::after {
		transform: translateX(3px);
	}
}

.nffat-btn--ink {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--white);
}

.nffat-btn--magenta {
	background: var(--wp--preset--color--magenta-600);
	color: var(--wp--preset--color--white);
}

.nffat-btn--white {
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
}

.nffat-btn--outline {
	border-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--ink);
}

.nffat-btn--outline-light {
	border-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--white);
}

@media (hover: hover) and (pointer: fine) {
	.nffat-btn--ink:hover { background: #2a3136; }
	.nffat-btn--magenta:hover { background: var(--wp--preset--color--magenta-700); }
	.nffat-btn--outline:hover { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--white); }
	.nffat-btn--outline-light:hover { background: var(--wp--preset--color--white); color: var(--wp--preset--color--teal); }
}

/* Round icon-only button (arrow circles on tiles and CTAs). */
.nffat-round {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	flex-shrink: 0;
	transition: transform 160ms var(--nffat-ease-out);
}

.nffat-round .nffat-icon {
	font-size: 20px;
}

.nffat-round:active {
	transform: scale(0.94);
}

/* Section heading row: big title left, action right. */
.nffat-section-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
}

.nffat-section-title {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	font-size: var(--wp--preset--font-size--3-xl);
	letter-spacing: -0.02em;
	line-height: 1;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}

/* Links inside running text: an underline that sweeps out and back in, over a highlighter wash. */
main :where(p, li, dd) > a:not([class]) {
	color: var(--nffat-link-color, var(--wp--preset--color--magenta-700));
	text-decoration: none;
	background:
		linear-gradient(currentColor, currentColor) 0 100% / 100% 1.5px no-repeat,
		linear-gradient(var(--nffat-link-highlight, var(--wp--preset--color--magenta-100)), var(--nffat-link-highlight, var(--wp--preset--color--magenta-100))) 0 100% / 100% 0 no-repeat;
	border-radius: 2px;
	transition: background-size 260ms var(--nffat-ease-out), color 200ms var(--nffat-ease-out);
}

@media (hover: hover) and (pointer: fine) {
	main :where(p, li, dd) > a:not([class]):hover {
		color: var(--nffat-link-color, var(--wp--preset--color--magenta-700));
		background-size: 100% 1.5px, 100% 45%;
		animation: nffat-link-sweep 520ms var(--nffat-ease-out);
	}
}

@keyframes nffat-link-sweep {
	0% { background-position: 100% 100%, 0 100%; background-size: 100% 1.5px, 100% 45%; }
	45% { background-position: 100% 100%, 0 100%; background-size: 0 1.5px, 100% 45%; }
	46% { background-position: 0 100%, 0 100%; background-size: 0 1.5px, 100% 45%; }
	100% { background-position: 0 100%, 0 100%; background-size: 100% 1.5px, 100% 45%; }
}

@media (prefers-reduced-motion: reduce) {
	main :where(p, li, dd) > a:not([class]):hover {
		animation: none;
	}
}
