/**
 * Gutenberg site header — from Figma Full-width header navigation.
 * Mobile: slide-in drawer from the right (≤1100px).
 */

.legalion-gutenberg {
	--lg-color-text-secondary: #404040;
	--lg-color-brand: #633e8b;
	--lg-color-logo: #3f205f;
	--lg-color-white: #fff;
	--lg-color-border: #e5e5e5;
	--lg-color-surface: #fafafa;
	--lg-radius-md: 8px;
	--lg-radius-full: 9999px;
	--lg-header-max: 1300px;
	--lg-drawer-width: min(22.5rem, 88vw);
	scroll-behavior: smooth;
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	width: 100%;
	background: var(--lg-color-white);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	max-width: var(--lg-header-max);
	margin: 0 auto;
	padding: 16px 24px;
	box-sizing: border-box;
}

.site-header__brand {
	display: flex;
	align-items: center;
	gap: 32px;
	min-width: 0;
	flex: 1 1 auto;
}

.site-header__logo {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	line-height: 0;
	text-decoration: none;
}

.site-header__logo img {
	display: block;
	width: 122px;
	height: 28px;
}

.site-header__toggle {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin: 0;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--lg-color-border);
	border-radius: var(--lg-radius-md);
	background: var(--lg-color-white);
	color: var(--lg-color-text-secondary);
	font-family: "Objektiv Mk1 Trial", sans-serif;
	font-size: 14px;
	font-weight: 600;
	line-height: 20px;
	cursor: pointer;
	box-sizing: border-box;
}

.site-header__toggle:focus-visible {
	outline: 2px solid #a178d4;
	outline-offset: 2px;
}

.site-header__toggle-icon {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	width: 18px;
	height: 14px;
}

.site-header__toggle-bar {
	display: block;
	width: 100%;
	height: 2px;
	border-radius: 1px;
	background: currentColor;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-header.is-menu-open .site-header__toggle-bar:nth-child(1) {
	transform: translateY(6px) rotate(45deg);
}

.site-header.is-menu-open .site-header__toggle-bar:nth-child(2) {
	opacity: 0;
}

.site-header.is-menu-open .site-header__toggle-bar:nth-child(3) {
	transform: translateY(-6px) rotate(-45deg);
}

.site-header__panel-top {
	display: none;
}

.site-header__panel {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.site-header__actions {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-shrink: 0;
}

.site-header__nav {
	display: flex;
	align-items: center;
}

.site-header__menu {
	display: flex;
	align-items: center;
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

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

.site-header__menu a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px 6px;
	border-radius: var(--lg-radius-md);
	font-family: "Objektiv Mk1 Trial", sans-serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	color: var(--lg-color-text-secondary);
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.site-header__menu a:hover,
.site-header__menu a:focus-visible {
	color: var(--lg-color-brand);
	background: rgba(99, 62, 139, 0.06);
	outline: none;
}

.site-header__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 12px 18px;
	border-radius: var(--lg-radius-full);
	background: var(--lg-color-brand);
	color: var(--lg-color-white);
	font-family: "Objektiv Mk1 Trial", sans-serif;
	font-size: 16px;
	font-weight: 600;
	line-height: 24px;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.site-header__cta:hover,
.site-header__cta:focus-visible {
	background: #513370; /* brand-900 — Figma Primary hover (darker brand fill) */
	outline: none;
}

.site-header__cta-icon {
	display: block;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

.site-header__cta-icon img {
	display: block;
	width: 20px;
	height: 20px;
}

.site-header__backdrop {
	display: none;
}

body.site-header-menu-open {
	overflow: hidden;
}

@media (max-width: 1100px) {
	.site-header__toggle {
		display: inline-flex;
		flex-shrink: 0;
	}

	.site-header__panel-top {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 1rem;
		padding: 1rem 1.25rem;
		border-bottom: 1px solid var(--lg-color-border);
		box-sizing: border-box;
	}

	.site-header__panel-title {
		font-family: "Objektiv Mk1 Trial", sans-serif;
		font-size: 1rem;
		font-weight: 600;
		line-height: 1.5;
		color: var(--lg-color-logo);
	}

	.site-header__close {
		appearance: none;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 2.5rem;
		height: 2.5rem;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: var(--lg-radius-md);
		background: transparent;
		color: var(--lg-color-text-secondary);
		font-size: 1.75rem;
		line-height: 1;
		cursor: pointer;
	}

	.site-header__close:focus-visible {
		outline: 2px solid #a178d4;
		outline-offset: 2px;
	}

	.site-header__panel {
		position: fixed;
		top: 0;
		right: 0;
		z-index: 120;
		display: flex;
		flex-direction: column;
		align-items: stretch;
		width: var(--lg-drawer-width);
		height: 100vh;
		height: 100dvh;
		margin: 0;
		background: var(--lg-color-white);
		box-shadow: -8px 0 32px rgba(63, 32, 95, 0.12);
		transform: translateX(100%);
		transition: transform 0.25s ease;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.site-header.is-menu-open .site-header__panel {
		transform: translateX(0);
	}

	.site-header__actions {
		flex-direction: column;
		align-items: stretch;
		gap: 1.5rem;
		width: 100%;
		padding: 1.5rem 1.25rem 2rem;
		box-sizing: border-box;
	}

	.site-header__nav {
		width: 100%;
	}

	.site-header__menu {
		flex-direction: column;
		align-items: stretch;
		gap: 0.25rem;
		width: 100%;
	}

	.site-header__menu a {
		justify-content: flex-start;
		width: 100%;
		padding: 0.875rem 0.75rem;
		font-size: 1rem;
		line-height: 1.5;
		white-space: normal;
		box-sizing: border-box;
	}

	.site-header__cta {
		width: 100%;
	}

	.site-header__backdrop {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 110;
		background: rgba(63, 32, 95, 0.45);
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.25s ease;
	}

	.site-header.is-menu-open .site-header__backdrop {
		opacity: 1;
		pointer-events: auto;
	}

	.site-header__backdrop[hidden] {
		display: none;
	}
}

@media (max-width: 640px) {
	.site-header__inner {
		padding: 12px 16px;
	}

	.site-header__toggle-label {
		/* Keep icon-only on very small screens if space is tight — keep label for clarity. */
		display: inline;
	}
}
