.header {
	background-color: var(--white);
	/* NOTE: If you need to offset the scroll-to on anchors #foo, see `[id] {}` in reset.css */
	position: sticky;
	width: 100%;
	left: 0;
	top: 0;
	z-index: var(--z-header);
	transition: 0.3s background-color;
	box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);

	/* to accommodate the WordPress admin bar */
	.admin-bar & {
		top: 32px;
	}

	.container {
		display: grid;
		grid-template-columns: 40px 1fr 40px;
		grid-template-rows: auto auto auto;
		align-items: center;
		position: relative;
		padding: var(--spacing);
		transition: 0.3s padding;

		.js-scrolled & {
			padding: var(--spacing-div2);
		}

		@media (width > 768px) {
			display: flex;
		}
	}
}

.header__nav-toggle {
	@media (width > 768px) {
		display: none;
	}
}

.header__menu {
	max-height: 0;
	width: 100%;
	overflow: hidden;
	transition: 0.3s max-height;
	max-width: 500px;
	grid-column-start: 1;
	grid-column-end: 4;
	grid-row: 2;

	.js-body-nav-toggle & {
		max-height: 999px;
	}

	@media (width > 768px) {
		max-height: none;
		max-width: none;
		display: flex;
		align-items: center;
		overflow: visible;
	}
}

.header__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 300px;
	max-width: 100%;
	transition: 0.3s width;

	.js-scrolled & {
		width: 200px;
	}
}

.header__search {
	max-height: 0;
	width: 100%;
	overflow: hidden;
	background-color: var(--white);
	transition: 0.3s max-height;
	grid-column-start: 1;
	grid-column-end: 4;
	grid-row: 3;

	@media (width > 768px) {
		position: absolute;
		top: 100%;
		right: var(--spacing);
		width: auto;
	}

	.js-body-search-toggle & {
		max-height: 999px;
	}
}
