/**
 * Footer treatments theme.json cannot express:
 * outer white → #d1e1ef wash, 30px inner radius, inverse links,
 * 3-column pages on desktop, 2 equal columns below 1024px + LinkedIn
 * (Figma Footer 403:1864, [768] 796:90074, [375] 796:90150).
 */

/*
 * Short pages (Terms, 404): fill the viewport so the footer wash, not
 * empty body white, occupies leftover height. The navy card sits at the
 * bottom of that wash (AIR-4). Tall pages are unchanged.
 */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
}

.admin-bar .wp-site-blocks {
	min-height: calc(100vh - var(--wp-admin--admin-bar--height, 32px));
	min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 32px));
}

.editor-styles-wrapper.wp-site-blocks,
.editor-styles-wrapper .wp-site-blocks {
	display: block;
	min-height: 0;
}

.wp-site-blocks > footer.wp-block-template-part:has(.airnexis-footer) {
	display: flex;
	flex: 1 0 auto;
	flex-direction: column;
	margin-left: 0;
	margin-right: 0;
	max-width: none;
	padding: 0;
	overflow-x: clip;
}

.airnexis-footer.wp-block-group {
	box-sizing: border-box;
	display: flex;
	flex: 1 0 auto;
	flex-direction: column;
	width: 100%;
	max-width: 100%;
	background-color: var(--wp--preset--color--base);
	background-image: linear-gradient(
		to bottom,
		var(--wp--preset--color--base),
		#d1e1ef
	);
	padding-left: calc(var(--airnexis-layout-inset) + var(--wp--preset--spacing--xl));
	padding-right: calc(var(--airnexis-layout-inset) + var(--wp--preset--spacing--xl));
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--sm);
	line-height: 1.55;
}

/*
 * Template parts sit outside constrained/has-global-padding groups, so
 * alignfull negative margins would pull the 32px gutter off-canvas.
 */
.airnexis-footer.alignfull {
	margin-left: 0;
	margin-right: 0;
	width: 100%;
	max-width: 100%;
}

.airnexis-footer > .airnexis-footer__inner {
	border-radius: 30px;
	display: flex;
	flex-direction: column;
	flex: 0 0 auto;
	gap: var(--wp--preset--spacing--xl);
	margin-block-start: auto;
	overflow: hidden;
}

.airnexis-footer .airnexis-footer__top,
.block-editor-block-list__layout .wp-block.airnexis-footer__top {
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--lg);
	width: 100%;
	margin: 0;
}

.airnexis-footer__brand {
	flex: 1 1 auto;
	min-width: 0;
}

.airnexis-footer .airnexis-footer__cluster,
.block-editor-block-list__layout .wp-block.airnexis-footer__cluster {
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--lg);
	flex: 0 0 auto;
	margin: 0;
}

.airnexis-footer__logo {
	line-height: 0;
	margin: 0;
}

.airnexis-footer__logo,
.airnexis-footer__logo a {
	display: block;
	height: 68px;
	width: 311px;
	max-width: 100%;
}

.airnexis-footer__logo img {
	display: block;
	height: 68px;
	width: 311px;
	max-width: 100%;
}

.airnexis-footer__linkedin,
.block-editor-block-list__layout .wp-block.airnexis-footer__linkedin {
	flex-shrink: 0;
	margin: 0;
	line-height: 0;
	width: 32px;
	height: 32px;
}

.airnexis-footer__linkedin,
.airnexis-footer__linkedin a {
	display: block;
	width: 32px;
	height: 32px;
}

.airnexis-footer__linkedin img {
	display: block;
	width: 32px;
	height: 32px;
}

.airnexis-footer a {
	text-decoration: none;
}

.airnexis-footer .wp-block-navigation a,
.airnexis-footer .wp-block-navigation .wp-block-navigation-item__content {
	color: var(--wp--preset--color--contrast-3);
	padding: 0;
	text-decoration: none;
	white-space: nowrap;
}

.airnexis-footer .wp-block-navigation .current-menu-item > a,
.airnexis-footer .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content,
.airnexis-footer .wp-block-navigation .current-menu-item > .wp-block-home-link__content,
.airnexis-footer .wp-block-navigation .current_page_item > a {
	color: var(--wp--preset--color--base);
	font-weight: 700;
}

.airnexis-footer a:hover,
.airnexis-footer a:focus,
.airnexis-footer .wp-block-navigation a:hover,
.airnexis-footer .wp-block-navigation a:focus,
.airnexis-footer .wp-block-navigation .wp-block-navigation-item__content:hover,
.airnexis-footer .wp-block-navigation .wp-block-navigation-item__content:focus {
	color: var(--wp--preset--color--base);
	text-decoration: none;
}

.airnexis-footer a:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-3);
	outline-offset: 2px;
}

.airnexis-footer .wp-block-navigation ul {
	gap: inherit;
	list-style: none;
	margin: 0;
	padding: 0;
}

.airnexis-footer .airnexis-footer__nav,
.airnexis-footer .airnexis-footer__legal {
	width: auto;
}

/*
 * Desktop pages: 3×114px columns, 24px gaps (Figma Pages 461 / items 114).
 * Legal uses the same tracks, packed from the right, so a single Privacy
 * item sits under About Us and a second item (if added) under Approach.
 */
.airnexis-footer .airnexis-footer__nav .wp-block-navigation__container,
.airnexis-footer .airnexis-footer__nav ul,
.airnexis-footer .airnexis-footer__nav .block-editor-block-list__layout {
	display: grid;
	grid-template-columns: repeat(3, 7.125rem);
	column-gap: var(--wp--preset--spacing--lg);
	row-gap: var(--wp--preset--spacing--lg);
	flex-direction: unset;
	flex-wrap: unset;
	align-items: start;
	justify-content: start;
}

.airnexis-footer .airnexis-footer__nav .wp-block-navigation-item {
	width: auto;
	margin: 0;
}

.airnexis-footer .airnexis-footer__legal .wp-block-navigation__container,
.airnexis-footer .airnexis-footer__legal ul,
.airnexis-footer .airnexis-footer__legal .block-editor-block-list__layout {
	display: grid;
	grid-template-columns: repeat(3, 7.125rem);
	column-gap: var(--wp--preset--spacing--lg);
	row-gap: var(--wp--preset--spacing--lg);
	flex-direction: unset;
	flex-wrap: unset;
	align-items: start;
	justify-content: end;
}

.airnexis-footer .airnexis-footer__legal .wp-block-navigation-item:last-child,
.airnexis-footer .airnexis-footer__legal .block-editor-block-list__layout > .wp-block:last-child {
	grid-column: 3;
}

.airnexis-footer .airnexis-footer__legal .wp-block-navigation-item:nth-last-child(2),
.airnexis-footer .airnexis-footer__legal .block-editor-block-list__layout > .wp-block:nth-last-child(2) {
	grid-column: 2;
}

.airnexis-footer .airnexis-footer__divider.wp-block-separator {
	background: var(--wp--custom--color--midnight--600);
	border: 0;
	color: var(--wp--custom--color--midnight--600);
	height: 1px;
	margin: 0;
	max-width: none;
	opacity: 1;
	width: 100%;
}

.airnexis-footer .airnexis-footer__bottom,
.block-editor-block-list__layout .wp-block.airnexis-footer__bottom {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--lg);
	width: 100%;
}

.airnexis-footer__bottom > p {
	flex: 1 1 auto;
	margin: 0;
	min-width: 0;
}

/* Match the LinkedIn column so legal aligns with the pages grid, not the icon. */
.airnexis-footer__legal,
.airnexis-footer .airnexis-footer__legal.is-content-justification-right {
	flex: 0 0 auto;
	margin-right: calc(2rem + var(--wp--preset--spacing--lg));
	justify-content: flex-start;
}

/*
 * Homepage [768px]: wordmark on its own row, 2 equal page columns
 * (Figma Pages 592 / items 291, gap sm / xl), LinkedIn pinned top-right.
 */
@media (max-width: 63.999rem) {
	.airnexis-footer__inner {
		gap: var(--wp--preset--spacing--2-xl);
	}

	.airnexis-footer .airnexis-footer__top,
	.block-editor-block-list__layout .wp-block.airnexis-footer__top {
		flex-direction: column;
		align-items: stretch;
		gap: var(--wp--preset--spacing--2-xl);
	}

	.airnexis-footer .airnexis-footer__cluster,
	.block-editor-block-list__layout .wp-block.airnexis-footer__cluster {
		position: relative;
		display: block;
		width: 100%;
	}

	.airnexis-footer .airnexis-footer__nav,
	.block-editor-block-list__layout .wp-block.airnexis-footer__nav {
		width: 100%;
		max-width: 100%;
		align-self: stretch;
	}

	.airnexis-footer .airnexis-footer__nav .wp-block-navigation__container,
	.airnexis-footer .airnexis-footer__nav ul,
	.airnexis-footer .airnexis-footer__nav .block-editor-block-list__layout {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-auto-flow: row;
		width: 100%;
		column-gap: var(--wp--preset--spacing--sm);
		row-gap: var(--wp--preset--spacing--xl);
	}

	.airnexis-footer__linkedin,
	.block-editor-block-list__layout .wp-block.airnexis-footer__linkedin {
		position: absolute;
		top: 0;
		right: 0;
	}

	.airnexis-footer .airnexis-footer__bottom,
	.block-editor-block-list__layout .wp-block.airnexis-footer__bottom {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--wp--preset--spacing--xl);
	}

	.airnexis-footer__legal,
	.airnexis-footer .airnexis-footer__legal.is-content-justification-right {
		margin-right: 0;
		width: 100%;
	}

	.airnexis-footer .airnexis-footer__legal .wp-block-navigation__container,
	.airnexis-footer .airnexis-footer__legal ul,
	.airnexis-footer .airnexis-footer__legal .block-editor-block-list__layout {
		display: flex;
		flex-wrap: wrap;
		justify-content: flex-end;
		grid-template-columns: none;
		gap: var(--wp--preset--spacing--xl);
	}

	.airnexis-footer .airnexis-footer__legal .wp-block-navigation-item:last-child,
	.airnexis-footer .airnexis-footer__legal .block-editor-block-list__layout > .wp-block:last-child,
	.airnexis-footer .airnexis-footer__legal .wp-block-navigation-item:nth-last-child(2),
	.airnexis-footer .airnexis-footer__legal .block-editor-block-list__layout > .wp-block:nth-last-child(2) {
		grid-column: auto;
	}
}

/*
 * Homepage [375px]: 201×44 wordmark, 2-col pages spanning the card
 * (Figma Pages 239 / items 115.5), LinkedIn under the nav, legal on the
 * same tracks packed right (Privacy under Approach).
 */
@media (max-width: 47.999rem) {
	.airnexis-footer__inner {
		gap: var(--wp--preset--spacing--3-xl);
	}

	.airnexis-footer .airnexis-footer__top,
	.block-editor-block-list__layout .wp-block.airnexis-footer__top {
		gap: var(--wp--preset--spacing--3-xl);
	}

	.airnexis-footer .airnexis-footer__cluster,
	.block-editor-block-list__layout .wp-block.airnexis-footer__cluster {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: var(--wp--preset--spacing--3-xl);
		position: static;
	}

	.airnexis-footer__linkedin,
	.block-editor-block-list__layout .wp-block.airnexis-footer__linkedin {
		position: static;
	}

	.airnexis-footer__logo,
	.airnexis-footer__logo a,
	.airnexis-footer__logo img {
		height: 44px;
		width: 201px;
	}

	.airnexis-footer .airnexis-footer__bottom,
	.block-editor-block-list__layout .wp-block.airnexis-footer__bottom {
		gap: var(--wp--preset--spacing--2-xl);
	}

	.airnexis-footer .airnexis-footer__legal .wp-block-navigation__container,
	.airnexis-footer .airnexis-footer__legal ul,
	.airnexis-footer .airnexis-footer__legal .block-editor-block-list__layout {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-auto-flow: row;
		justify-content: end;
		width: 100%;
		column-gap: var(--wp--preset--spacing--sm);
		row-gap: var(--wp--preset--spacing--xl);
	}

	.airnexis-footer .airnexis-footer__legal .wp-block-navigation-item:last-child,
	.airnexis-footer .airnexis-footer__legal .block-editor-block-list__layout > .wp-block:last-child {
		grid-column: 2;
	}

	.airnexis-footer .airnexis-footer__legal .wp-block-navigation-item:nth-last-child(2),
	.airnexis-footer .airnexis-footer__legal .block-editor-block-list__layout > .wp-block:nth-last-child(2) {
		grid-column: 1;
	}
}
