/*
 * Header – Howe Green House's: a bar in --landing-header-bg with the logo on
 * the left and, on the right, the button above a row of uppercase links to
 * the page's sections. It stays at the top while the page scrolls, at one
 * height: it is in the page's flow, so shrinking it would shift the page
 * under a section the menu has just scrolled to.
 * Below 992px the links and button move into the panel the menu button
 * opens (#menu), which slides in from the right.
 */
.landingHeader {
	position: sticky;
	top: 0;
	z-index: 1000;
	padding: 12px 0;
	background: var(--landing-header-bg);
	color: var(--landing-header-text);

	@media (min-width: 992px) {
		padding: 15px 0;
	}
}

.landingHeader-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
}

.landingHeader-logo {
	display: block;
	flex: 0 1 auto;
	min-width: 0;
	color: inherit;
	text-decoration: none;

	img {
		display: block;
		width: auto;
		max-width: 100%;
		height: 50px;
		object-fit: contain;
		object-position: left center;

		@media (min-width: 992px) {
			height: 70px;
		}
	}

	&:hover,
	&:focus {
		color: inherit;
	}
}

.landingHeader-name {
	display: block;
	font: var(--text-h3);
	font-size: 20px;
	color: var(--landing-header-text);

	@media (min-width: 992px) {
		font: var(--text-h2);
		font-size: 28px;
	}
}

/* the button and the links – desktop only; the panel has them on a phone */
.landingHeader-side {
	display: none;

	@media (min-width: 992px) {
		display: flex;
		flex-direction: column;
		align-items: flex-end;
		gap: 14px;
	}
}

.landingHeader-cta.button,
.landingPanel-cta.button {
	--button-bg: transparent;
	--button-border: var(--landing-header-text);
	--button-label: var(--landing-header-text);
	--button-bg-hover: var(--landing-button-bg);
	--button-border-hover: var(--landing-button-bg);
	--button-label-hover: var(--landing-button-text);

	padding: 6px 22px;
	border-width: 1px;
	font-size: 14px;
	letter-spacing: 0.14em;
}

.landing-menu--main {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 6px 30px;
	margin: 0;
	padding: 0;
	list-style: none;

	a {
		display: block;
		color: var(--landing-header-text);
		font: var(--text-button);
		letter-spacing: 0.09em;
		text-transform: uppercase;
		text-decoration: none;
		transition: opacity 300ms;

		&:hover,
		&:focus {
			color: var(--landing-header-text);
			opacity: 0.75;
		}
	}
}

/* the menu button: three bars */
.landingHeader-toggle {
	position: relative;
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--landing-header-text);
	cursor: pointer;

	@media (min-width: 992px) {
		display: none;
	}

	.landingHeader-bars,
	.landingHeader-bars::before,
	.landingHeader-bars::after {
		position: absolute;
		left: 8px;
		width: 28px;
		height: 3px;
		background: currentColor;
	}

	.landingHeader-bars {
		top: 50%;
		margin-top: -1.5px;

		&::before,
		&::after {
			content: '';
			left: 0;
		}

		&::before {
			top: -9px;
		}

		&::after {
			top: 9px;
		}
	}
}

/* the phone menu panel */
.landingPanel {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 1100;
	width: min(320px, 85vw);
	padding: 70px 0 30px;
	overflow-y: auto;
	background: var(--landing-header-bg);
	color: var(--landing-header-text);
	box-shadow: -2px 0 12px rgba(0, 0, 0, 0.2);
	transform: translateX(100%);
	visibility: hidden;
	transition: transform 300ms ease, visibility 0s linear 300ms;

	&.is-open {
		transform: none;
		visibility: visible;
		transition: transform 300ms ease;
	}

	@media (min-width: 992px) {
		display: none;
	}

	.landing-menu--panel {
		margin: 0;
		padding: 0;
		list-style: none;

		a {
			display: block;
			padding: 12px 24px;
			color: var(--landing-header-text);
			font: var(--text-button);
			letter-spacing: 0.09em;
			text-transform: uppercase;
			text-decoration: none;

			&:hover,
			&:focus {
				background: color-mix(in srgb, var(--landing-header-text) 15%, transparent);
				color: var(--landing-header-text);
			}
		}
	}

	.landingPanel-cta {
		margin: 24px 24px 0;
	}
}

.landingPanel-close {
	position: absolute;
	top: 14px;
	left: 14px;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--landing-header-text);
	font-size: 40px;
	line-height: 1;
	cursor: pointer;
}
