/*
 * Site header and footer, from the design exports (Oxygen 300/400/700, navy text, yellow accents). Loaded on every
 * page. Desktop is the base; the header turns into the phone menu at 1024px and the footer into two columns at 768px.
 * Colours and sizes use the --wwd- tokens of wwd/base.css; the few values the tokens do not hold are written out.
 */
.site-skip-link:focus {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 1000;
	width: auto;
	height: auto;
	padding: 12px 20px;
	clip-path: none;
	background: var(--wwd-navy);
	color: var(--wwd-white);
	font: 400 var(--wwd-fs-md) Oxygen, sans-serif;
}

/* ---------- Header ---------- */
.site-header {
	position: relative;
	z-index: 100;
	box-sizing: content-box;
	display: grid;
	grid-template-columns: 240px 1fr 380px;
	align-items: center;
	height: 104px;
	margin: 0;
	padding: 0 48px;
	border-bottom: 1px solid #eef2f4;
	background: var(--wwd-white);
	color: var(--wwd-navy);
	font-family: Oxygen, sans-serif;
}

.site-header.sticky {
	position: sticky;
	top: 0;
}

.site-header *,
.site-header *::before,
.site-header *::after {
	box-sizing: border-box;
}

.site-header a {
	color: var(--wwd-navy);
	text-decoration: none;
}

.site-header ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-header__logo {
	display: block;
	justify-self: start;
}

.site-header__logo img {
	display: block;
	width: auto;
	height: 64px;
	max-width: none;
}

/* On desktop the panel only groups; its children sit in the header grid. */
.site-header__panel {
	display: contents;
}

.site-header__actions,
.site-header__phone,
.site-nav__toggle {
	display: none;
}

.site-nav {
	grid-column: 2;
	grid-row: 1;
}

.site-nav__list {
	display: flex;
	justify-content: center;
	gap: 34px;
}

.site-nav__list > li {
	margin: 0;
	padding: 0;
}

.site-nav__list > li > a {
	display: inline-block;
	padding-bottom: 6px;
	border-bottom: 2px solid transparent;
	font: 300 17px Oxygen, sans-serif;
	color: var(--wwd-navy);
}

.site-nav__list > li.current-menu-item > a,
.site-nav__list > li.current-menu-ancestor > a,
.site-nav__list > li.current-page-ancestor > a {
	border-bottom-color: var(--wwd-yellow);
	font-weight: 400;
}

.site-nav__list > li > a:hover {
	color: var(--wwd-link-hover);
}


.site-nav .sub-menu {
	display: none;
}

/* Desktop: the sub-menu is a dropdown. It opens on hover and when a link inside has focus, so the keyboard works too. */
@media (min-width: 1025px) {
	.site-nav__list > li.menu-item-has-children {
		position: relative;
	}

	.site-nav__list > li.menu-item-has-children > a::after {
		content: "";
		display: inline-block;
		width: 6px;
		height: 6px;
		margin: 0 0 3px 8px;
		border: solid currentColor;
		border-width: 0 1.5px 1.5px 0;
		transform: rotate(45deg);
	}

	.site-nav .sub-menu {
		position: absolute;
		top: 100%;
		left: 50%;
		z-index: 80;
		display: block;
		visibility: hidden;
		opacity: 0;
		min-width: 240px;
		margin: 0;
		padding: 10px 0;
		list-style: none;
		background: var(--wwd-white);
		border: 1px solid #e3eaee;
		box-shadow: 0 10px 28px rgba(11, 74, 102, .12);
		transform: translate(-50%, 6px);
		transition: opacity .15s, transform .15s, visibility .15s;
	}

	/* A bridge over the gap between the link and the panel so the pointer can cross it. */
	.site-nav .sub-menu::before {
		content: "";
		position: absolute;
		inset: -14px 0 100%;
	}

	.site-nav__list > li:hover > .sub-menu,
	.site-nav__list > li:focus-within > .sub-menu {
		visibility: visible;
		opacity: 1;
		transform: translate(-50%, 0);
	}

	.site-nav .sub-menu a {
		display: block;
		padding: 9px 22px;
		font: 300 16px/1.3 Oxygen, sans-serif;
		color: var(--wwd-navy);
		white-space: nowrap;
	}

	.site-nav .sub-menu a:hover,
	.site-nav .sub-menu a:focus-visible {
		background: var(--wwd-light);
		color: var(--wwd-link-hover);
	}

	.site-nav .sub-menu .current-menu-item > a {
		font-weight: 700;
	}
}

.site-header__tools {
	display: flex;
	grid-column: 3;
	align-items: center;
	justify-content: flex-end;
	gap: var(--wwd-space-14);
}

.site-search {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 170px;
	height: 46px;
	margin: 0;
	padding: 0 8px 0 20px;
	border-radius: 46px;
	background: var(--wwd-light);
}

.site-header input[type="search"].site-search__input,
.site-search input[type="search"] {
	width: 100px;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: transparent;
	color: var(--wwd-navy);
	font: 300 var(--wwd-fs-md) Oxygen, sans-serif;
	-webkit-appearance: none;
	appearance: none;
}

.site-search input[type="search"]::placeholder {
	color: #5b7482;
	opacity: 1;
}

.site-search input[type="search"]::-webkit-search-cancel-button {
	display: none;
}

.site-search__submit {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--wwd-navy);
	cursor: pointer;
}

.site-header .wwd-pill--yellow {
	color: var(--wwd-ink);
}

.site-header a:focus-visible,
.site-header button:focus-visible,
.site-header input:focus-visible,
.site-footer a:focus-visible {
	outline: 3px solid var(--wwd-accent);
	outline-offset: 2px;
}

@media (max-width: 1280px) {
	.site-header {
		grid-template-columns: auto 1fr auto;
		column-gap: 32px;
	}

}

/* ---------- Header: phone and tablet ---------- */
@media (max-width: 1024px) {
	.site-header {
		box-sizing: border-box;
		display: flex;
		align-items: center;
		justify-content: space-between;
		height: 64px;
		padding: 0 10px 0 20px;
	}

	.site-header__logo img {
		height: 40px;
	}

	.site-header__actions {
		display: flex;
		align-items: center;
		gap: 2px;
	}

	.site-header__button {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 0;
		background: transparent;
		color: var(--wwd-navy);
		cursor: pointer;
	}

	.site-header__icon-close,
	.site-header.is-open .site-header__icon-open {
		display: none;
	}

	.site-header.is-open .site-header__icon-close {
		display: block;
	}

	/* The panel sits under the header and covers the first screen; the page behind it does not scroll. */
	.site-header__panel {
		position: absolute;
		top: calc(100% + 1px);
		right: 0;
		left: 0;
		display: none;
		flex-direction: column;
		min-height: calc(100vh - 64px);
		max-height: calc(100vh - 64px);
		padding: 12px 20px 24px;
		overflow-y: auto;
		background: var(--wwd-white);
		box-shadow: 0 10px 30px rgba(11, 74, 102, .18);
	}

	.site-header.is-open .site-header__panel {
		display: flex;
	}

	html.site-menu-open {
		overflow: hidden;
	}

	.site-header__tools {
		display: contents;
	}

	.site-search {
		order: 0;
		flex-direction: row-reverse;
		justify-content: flex-end;
		gap: 10px;
		width: auto;
		height: 48px;
		margin: 0;
		padding: 0 18px;
		border-radius: 48px;
	}

	.site-search input[type="search"] {
		flex: 1;
		width: auto;
		min-width: 0;
	}

	.site-search__submit {
		width: 20px;
		height: 20px;
	}

	.site-nav {
		order: 1;
		margin-top: 10px;
	}

	.site-nav__list {
		display: block;
	}

	.site-nav__list > li {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
	}

	.site-nav__list > li > a {
		flex: 1;
		display: flex;
		align-items: center;
		justify-content: space-between;
		height: 54px;
		padding: 0;
		border-bottom: 1px solid #e3eaee;
		font: 400 20px Oxygen, sans-serif;
	}

	/* As in the design: the plain rows are 54px plus the border, the sub-menu rows 54px with it. */
	.site-nav__list > li:not(.menu-item-has-children) > a {
		box-sizing: content-box;
	}

	.site-nav__list > li.current-menu-item > a,
	.site-nav__list > li.current-menu-ancestor > a,
	.site-nav__list > li.current-page-ancestor > a {
		border-bottom-color: #e3eaee;
	}

	/* The chevron after plain links; items with a sub-menu get a toggle button instead. */
	.site-nav__list > li:not(.menu-item-has-children) > a::after,
	.site-nav__toggle::after {
		content: "";
		width: 20px;
		height: 20px;
		background: no-repeat center / 20px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230b4a66' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E");
	}

	.site-nav__toggle {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		width: 44px;
		height: 54px;
		margin: 0;
		padding: 0;
		border: 0;
		border-bottom: 1px solid #e3eaee;
		border-radius: 0;
		background: transparent;
		cursor: pointer;
	}

	.site-nav__toggle::after {
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230b4a66' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	}

	.site-nav__toggle[aria-expanded="true"]::after {
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230b4a66' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 15l6-6 6 6'/%3E%3C/svg%3E");
	}

	.site-nav__list > li.is-open > a {
		font-weight: 700;
	}

	.site-nav .sub-menu {
		display: none;
		flex: 0 0 100%;
		padding: 6px 0 10px 17px;
		border-bottom: 1px solid #e3eaee;
	}

	.site-nav li.is-open > .sub-menu {
		display: block;
	}

	.site-nav .sub-menu a {
		display: block;
		padding: 7px 0;
		font: 300 var(--wwd-fs-md) / 1.35 Oxygen, sans-serif;
	}

	.site-nav .sub-menu .current-menu-item > a {
		margin-left: -17px;
		padding-left: 14px;
		border-left: 3px solid var(--wwd-yellow);
		font-weight: 700;
	}

	.site-header__contact {
		order: 2;
		width: 100%;
		min-height: 52px;
		margin-top: 22px;
	}

	.site-header__phone {
		order: 3;
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		margin-top: 16px;
		font: 400 var(--wwd-fs-md) Oxygen, sans-serif;
	}

	/* Keep navigation available when scripting is disabled in the browser. */
	@media (scripting: none) {
		.site-header {
			flex-wrap: wrap;
			height: auto;
			min-height: 64px;
		}

		.site-header__actions,
		.site-nav__toggle {
			display: none;
		}

		.site-header__panel {
			position: static;
			display: flex;
			width: 100%;
			min-height: 0;
			max-height: none;
			box-shadow: none;
		}

		.site-nav .sub-menu {
			display: block;
		}
	}
}

/* ---------- Footer ---------- */
.site-footer {
	display: flex;
	flex-direction: column;
	gap: 40px;
	margin: 0;
	padding: 64px max(120px, calc((100% - 1200px) / 2)) 40px;
	background: var(--wwd-grey);
	color: var(--wwd-ink);
	font-family: Oxygen, sans-serif;
	font-weight: 300;
	line-height: normal;
}

.site-footer *,
.site-footer *::before,
.site-footer *::after {
	box-sizing: border-box;
}

.site-footer a {
	color: var(--wwd-navy);
	line-height: normal;
	text-decoration: none;
}

.site-footer a:hover {
	color: var(--wwd-link-hover);
}

.site-footer ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer__grid {
	display: grid;
	grid-template-columns: 1.3fr repeat(var(--site-footer-columns, 3), 1fr);
	gap: 40px;
}

.site-footer__brand {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.site-footer__brand img {
	align-self: flex-start;
	width: auto;
	height: 56px;
}

.site-footer__tagline,
.site-footer__address {
	margin: 0;
	color: var(--wwd-body);
	font-size: var(--wwd-fs-sm);
	line-height: 1.5;
}

/* A column is a menu whose top-level item is the heading and whose sub-menu holds the links. */
.site-footer__column,
.site-footer__policies {
	display: flex;
	flex-direction: column;
	gap: var(--wwd-space-10);
	font-size: var(--wwd-fs-md);
}

.site-footer__column > li,
.site-footer__column .sub-menu {
	display: flex;
	flex-direction: column;
	gap: var(--wwd-space-10);
	margin: 0;
	padding: 0;
}

.site-footer__column > li > a,
.site-footer__heading {
	color: var(--wwd-navy);
	font: 700 var(--wwd-fs-sm) Oxygen, sans-serif;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.site-footer__column > li > a[href="#"] {
	pointer-events: none;
}

.site-footer__column > li.hide-header > a {
	display: none;
}

.site-footer__column > li:not(.menu-item-has-children) > a,
.site-footer__policies .site-footer__column > li > a {
	font-weight: 300;
	letter-spacing: 0;
	text-transform: none;
}

.site-footer__policies .site-footer__column {
	gap: var(--wwd-space-10);
}

.site-footer__column .architen-btn {
	margin-top: var(--wwd-space-10);
}

.site-footer__address {
	padding-top: 22px;
	border-top: 1px solid var(--wwd-border);
}

.site-footer__address span + span::before {
	content: " · ";
}

@media (max-width: 1024px) {
	.site-footer {
		padding-right: 48px;
		padding-left: 48px;
	}
}

@media (max-width: 768px) {
	.site-footer {
		gap: 32px;
		padding: 44px 20px 40px;
	}

	.site-footer__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 32px 20px;
	}

	.site-footer__brand {
		grid-column: 1 / -1;
		gap: var(--wwd-space-14);
	}

	.site-footer__brand img {
		height: 48px;
	}

	.site-footer__tagline,
	.site-footer__address {
		font-size: var(--wwd-fs-xs);
		line-height: 1.5;
	}

	.site-footer__column,
	.site-footer__policies {
		font-size: var(--wwd-fs-sm);
	}

	.site-footer__address span {
		display: block;
	}

	.site-footer__address span + span::before {
		content: none;
	}
}
