/*
 * Global header, Plugins mega menu and mobile menu.
 * Sources: Main.dc.html lines 38-56, Header.dc.html lines 24-98. Behaviour: architecture section 7.
 */

.sit-header {
	position: relative;
	z-index: 50;
	background: var(--sit-surface);
	border-bottom: 1px solid var(--sit-line);
}

.sit-header__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 32px;
	min-height: 72px;
}

/* Logo */
.sit-logo {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--sit-ink);
	text-decoration: none;
}

.sit-logo:hover {
	color: var(--sit-ink);
}

.sit-logo .sit-icon {
	flex: none;
}

.sit-logo__word,
.sit-mobile__word {
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 700;
	font-size: 19px;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: var(--sit-ink);
}

.sit-logo__labs {
	color: var(--sit-sapphire);
}

/* Main nav (.nav) */
.sit-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0 22px;
	flex: 1 1 auto;
}

.sit-nav__link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 10px 4px;
	color: var(--sit-ink);
	text-decoration: none;
	font-weight: 500;
	font-size: 15px;
	line-height: 1.6;
}

.sit-nav__link:hover,
.sit-nav__link.is-active,
.sit-nav__link[aria-expanded="true"] {
	color: var(--sit-sapphire);
}

.sit-nav__chevron {
	flex: none;
	transition: transform 150ms;
}

/* Open state: the chevron points up (architecture section 11). */
.sit-nav__link[aria-expanded="true"] .sit-nav__chevron {
	transform: rotate(180deg);
}

/* Actions */
.sit-header__actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.sit-header__account {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	color: var(--sit-ink);
	text-decoration: none;
	font-weight: 500;
	font-size: 15px;
}

.sit-header__account:hover,
.sit-header__account.is-active {
	color: var(--sit-sapphire);
}

/* Menu button: only shown at 960px and below, and only with JavaScript. */
.sit-header__toggle {
	display: none;
	width: 44px;
	height: 44px;
	flex: none;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: var(--sit-radius-btn);
	background: var(--sit-bg);
	color: var(--sit-ink);
	cursor: pointer;
}

/* Mega menu (Header.dc.html lines 39-74) */
.sit-mega {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
}

.sit-mega[hidden] {
	display: none;
}

.sit-mega__panel {
	display: flex;
	overflow: hidden;
	background: var(--sit-surface);
	border: 1px solid var(--sit-line);
	border-radius: var(--sit-radius-card);
	box-shadow: 0 18px 40px rgba(14, 23, 38, .14);
}

.sit-mega__groups {
	flex: 1;
	display: grid;
	gap: 28px;
	padding: 28px;
}

.sit-mega__groups--1 {
	grid-template-columns: repeat(1, minmax(0, 1fr));
}

.sit-mega__groups--2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sit-mega__groups--3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sit-mega__group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.sit-mega__label {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--sit-muted);
	padding: 0 12px 6px;
}

.sit-mega__label--side {
	padding: 0;
}

.sit-mega__item {
	display: flex;
	gap: 14px;
	padding: 14px 12px;
	border-radius: 12px;
	color: var(--sit-ink);
	text-decoration: none;
}

.sit-mega__item:hover,
.sit-mega__item:focus-visible {
	background: var(--sit-bg);
	color: var(--sit-ink);
}

.sit-mega__text {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.sit-mega__name {
	font-weight: 600;
	font-size: 15px;
	line-height: 1.4;
}

.sit-mega__summary {
	font-size: 13px;
	line-height: 1.5;
	color: var(--sit-muted);
}

.sit-mega__side {
	width: 300px;
	flex: none;
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 28px;
	background: var(--sit-bg);
	border-left: 1px solid var(--sit-line);
}

.sit-mega__all {
	font-weight: 600;
	font-size: 15px;
	text-decoration: none;
}

.sit-mega__side-link {
	font-size: 14px;
	color: var(--sit-ink);
	text-decoration: none;
}

.sit-mega__side-link:hover {
	color: var(--sit-sapphire);
}

.sit-mega__bundle {
	margin-top: auto;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px;
	background: var(--sit-surface);
	border: 1px solid var(--sit-line);
	border-radius: 12px;
}

.sit-mega__bundle-title {
	font-size: 14px;
	font-weight: 600;
}

.sit-mega__bundle-text {
	font-size: 13px;
	line-height: 1.5;
	color: var(--sit-muted);
}

/* Mobile menu (Header.dc.html lines 81-98). Without JS: a plain list under the bar at 960px and below. */
.sit-mobile {
	display: none;
	flex-direction: column;
	background: var(--sit-surface);
	border-bottom: 1px solid var(--sit-line);
}

.sit-mobile__top {
	display: none;
	height: 64px;
	flex: none;
	align-items: center;
	justify-content: space-between;
	padding: 0 16px;
	border-bottom: 1px solid var(--sit-line);
}

.sit-mobile__word {
	font-size: 18px;
}

.sit-mobile__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: var(--sit-radius-btn);
	background: var(--sit-bg);
	color: var(--sit-ink);
	cursor: pointer;
}

.sit-mobile__nav {
	display: flex;
	flex-direction: column;
	padding: 8px 16px;
	font-size: 17px;
	font-weight: 500;
}

.sit-mobile__label {
	padding: 12px 0 4px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--sit-muted);
}

.sit-mobile__label:first-child {
	padding-top: 14px;
}

.sit-mobile__product {
	padding: 12px 0 12px 12px;
	border-left: 2px solid var(--sit-accent);
	color: var(--sit-ink);
	text-decoration: none;
}

.sit-mobile__all {
	padding: 12px 0;
	border-bottom: 1px solid var(--sit-line-soft);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
}

.sit-mobile__link {
	padding: 13px 0;
	border-bottom: 1px solid var(--sit-line-soft);
	color: var(--sit-ink);
	text-decoration: none;
}

.sit-mobile__link:last-child {
	border-bottom: 0;
}

.sit-mobile__product:hover,
.sit-mobile__link:hover,
.sit-mobile__link.is-active {
	color: var(--sit-sapphire);
}

.sit-mobile__cta {
	margin-top: auto;
	padding: 16px;
}

@media (max-width: 960px) {
	.sit-header__bar {
		flex-wrap: nowrap;
		justify-content: space-between;
		min-height: 64px;
		padding: 0 16px;
	}

	.sit-nav,
	.sit-header__actions,
	.sit-mega {
		display: none;
	}

	.sit-mobile {
		display: flex;
	}

	/* With JavaScript: a full-height panel behind the menu button. */
	.sit-js .sit-header__toggle {
		display: flex;
	}

	.sit-js .sit-mobile {
		position: fixed;
		inset: 0;
		z-index: 100;
		height: 100vh;
		height: 100dvh;
		overflow-y: auto;
		overscroll-behavior: contain;
		border-bottom: 0;
	}

	/* Hidden until opened; a class rather than [hidden] so the deferred script cannot cause a flash. */
	.sit-js .sit-mobile:not(.is-open) {
		display: none;
	}

	.sit-js .sit-mobile__top {
		display: flex;
	}

	.sit-menu-open,
	.sit-menu-open body {
		overflow: hidden;
	}
}

/* The admin bar is fixed above the page when a user is logged in; keep the panel below it. */
@media (max-width: 960px) {
	.sit-js.sit-menu-open .admin-bar .sit-mobile {
		top: var(--wp-admin--admin-bar--height, 46px);
		height: calc(100dvh - var(--wp-admin--admin-bar--height, 46px));
	}
}
