/* layout/header.css — split from theme.css */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	border-bottom: 1px solid var( --header-border );
	background: var( --header-bg );
	-webkit-backdrop-filter: blur( 20px ) saturate( 1.15 );
	backdrop-filter: blur( 20px ) saturate( 1.15 );
	transition:
		background-color 220ms ease,
		border-color 220ms ease,
		box-shadow 220ms ease;
}

/* Главная: шапка сливается с анимированным фоном hero */
body.home .site-header {
	border-bottom-color: transparent;
	background:
		linear-gradient(
			180deg,
			rgba( 255, 248, 230, 0.78 ) 0%,
			rgba( 255, 248, 230, 0.45 ) 55%,
			rgba( 255, 248, 230, 0.08 ) 100%
		);
	box-shadow: none;
}

body.home .site-header.is-scrolled {
	border-bottom-color: var( --header-border );
	background: var( --header-bg-solid );
	box-shadow: var( --shadow-soft );
}

@media ( prefers-color-scheme: dark ) {
	:root:not( [data-theme="light"] ) body.home .site-header {
		background:
			linear-gradient(
				180deg,
				rgba( 17, 20, 24, 0.85 ) 0%,
				rgba( 17, 20, 24, 0.52 ) 55%,
				rgba( 17, 20, 24, 0.1 ) 100%
			);
	}

	:root:not( [data-theme="light"] ) body.home .site-header.is-scrolled {
		background: var( --header-bg-solid );
	}
}

:root[data-theme="dark"] body.home .site-header {
	background:
		linear-gradient(
			180deg,
			rgba( 17, 20, 24, 0.85 ) 0%,
			rgba( 17, 20, 24, 0.52 ) 55%,
			rgba( 17, 20, 24, 0.1 ) 100%
		);
}

:root[data-theme="dark"] body.home .site-header.is-scrolled {
	background: var( --header-bg-solid );
}

:root[data-theme="light"] body.home .site-header {
	background:
		linear-gradient(
			180deg,
			rgba( 255, 248, 230, 0.78 ) 0%,
			rgba( 255, 248, 230, 0.45 ) 55%,
			rgba( 255, 248, 230, 0.08 ) 100%
		);
}

:root[data-theme="light"] body.home .site-header.is-scrolled {
	background: var( --header-bg-solid );
}

.nav-wrap {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-between;
	gap: 1.25rem;
	padding-block: 0.85rem;
}

.site-header .nav-wrap.is-layout-flow {
	display: flex;
}

.site-header .nav-wrap > .site-branding {
	margin-block-end: 0;
	margin-top: 0;
}

.site-header .nav-wrap > .primary-navigation,
.site-header .nav-wrap > .theme-toggle,
.site-header .nav-wrap > .site-header__actions,
.site-header .nav-wrap > .mobile-menu-toggle {
	margin-block: 0;
}

.site-header__actions {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	flex: 0 0 auto;
	align-self: center;
}

.site-header .site-branding {
	display: flex;
	align-items: center;
	flex: 0 1 auto;
	min-width: 0;
	gap: 0.7rem;
}

.site-header .site-header__brand {
	gap: 0.7rem;
}

.site-header .site-header__brand .reclaim-cabinet-logo {
	width: 2.15rem;
	height: 2.15rem;
	border-radius: 10px;
	transform: none;
}

.site-header .site-header__brand .reclaim-cabinet-name {
	margin: 0;
	padding: 0;
	font-family: var( --font-brand );
	font-size: 0.78rem;
	font-weight: 400;
	letter-spacing: 0.06em;
	line-height: 1.2;
	text-align: start;
	text-transform: none;
	text-wrap: balance;
}

.site-header .primary-navigation {
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	justify-content: center;
	min-width: 0;
	margin: 0;
}

.site-header .primary-navigation .wp-block-navigation__container {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	justify-content: center;
	gap: 0.35rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-header .primary-navigation .wp-block-navigation-item {
	display: flex;
	align-items: stretch;
	margin: 0;
}

.site-header a,
.site-header a:hover,
.site-header a:focus-visible {
	color: var( --ink );
	text-decoration: none;
}

.site-header .primary-navigation .wp-block-navigation-item__content {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 2.4rem;
	padding: 0 0.9rem;
	border-bottom: 0;
	color: var( --ink );
	font-weight: 850;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none;
}

.site-header .primary-navigation .wp-block-navigation-item__content:hover,
.site-header .primary-navigation .wp-block-navigation-item__content:focus-visible,
.site-header .primary-navigation .wp-block-navigation-item__content[aria-current="page"] {
	border-bottom: 0;
	background: transparent;
	color: var( --ink );
}

.site-header .theme-toggle {
	align-self: center;
	margin: 0;
	line-height: 1;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.95rem;
	min-width: 0;
	color: var( --ink );
	font-family: var( --font-display );
	font-weight: 900;
	font-size: 1.34rem;
	letter-spacing: 0.08em;
	line-height: 1;
	text-transform: uppercase;
	text-decoration: none;
	transition: color 150ms ease, transform 150ms ease;
}

.site-header .brand,
.site-header .brand a {
	font-family: var( --font-brand );
	font-weight: 400;
	font-style: normal;
	letter-spacing: 0.04em;
	text-transform: none;
	color: var( --ink );
}

.site-header .brand:hover,
.site-header .brand a:hover,
.site-header .brand:focus-within {
	color: var( --ink );
}

.site-header h1.brand {
	display: inline-flex;
	align-items: center;
	margin: 0;
	line-height: 1;
}

.site-header .brand a {
	display: inline-flex;
	align-items: center;
	margin: 0;
	line-height: 1;
	padding-block: 0;
	text-decoration: none;
}

.site-branding__fallback-logo {
	display: grid;
	border-radius: 10px;
	flex: 0 0 auto;
	width: 2.65rem;
	height: 2.65rem;
	place-items: center;
	border: 2px solid var( --stroke-strong );
	background: var( --highlight-interactive );
	box-shadow:
		0.3rem 0.3rem 0 var( --coral ),
		0.56rem 0.56rem 0 var( --accent );
	color: var( --on-highlight );
	font-family: var( --font-display );
	font-size: 1.75rem;
	font-weight: 900;
	line-height: 1;
	text-decoration: none;
	text-shadow:
		0.06em 0.06em 0 var( --white ),
		0.12em 0.12em 0 var( --coral );
	transform: scale( 1.06 );
	transform-origin: center center;
	transition:
		background-color 150ms ease,
		box-shadow 150ms ease,
		color 150ms ease,
		text-shadow 150ms ease,
		transform 150ms ease;
}

.site-header .site-branding__fallback-logo {
	align-self: center;
	width: 2.1rem;
	height: 2.1rem;
	font-size: 1.35rem;
	box-shadow:
		0.22rem 0.22rem 0 var( --coral ),
		0.4rem 0.4rem 0 var( --accent );
	transform: none;
}

.site-header .site-branding__fallback-logo--mark img {
	width: 1.35rem;
	height: 1.35rem;
}

.site-header .site-branding .wp-block-site-logo {
	transform: none;
	align-self: center;
}

.site-header .site-branding .wp-block-site-logo img {
	display: block;
	height: auto;
	max-height: 2.1rem;
	width: auto;
}

.site-branding__fallback-logo--mark img {
	display: block;
	width: 1.72rem;
	height: 1.72rem;
	object-fit: contain;
}

.brand span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.brand:hover {
	color: var( --ink );
}

.site-branding:hover .site-branding__fallback-logo,
.site-branding:focus-within .site-branding__fallback-logo {
	box-shadow:
		0.32rem 0.32rem 0 var( --coral ),
		0.6rem 0.6rem 0 var( --accent );
	transform: scale( 1.06 );
}

@keyframes reclaim-logo-stamp-wiggle {
	0%,
	100% {
		transform: scale( 1.06 );
	}

	34% {
		transform: scale( 1.06 ) rotate( -5deg );
	}

	64% {
		transform: scale( 1.06 ) rotate( 3deg );
	}
}

@media ( prefers-reduced-motion: no-preference ) {
	.site-branding:hover .site-branding__fallback-logo,
	.site-branding:focus-within .site-branding__fallback-logo {
		animation: reclaim-logo-stamp-wiggle 360ms cubic-bezier( 0.34, 1.56, 0.64, 1 ) both;
	}
}

.nav-list {
	display: flex;
	align-items: center;
	gap: clamp( 0.45rem, 1.4vw, 1.1rem );
	margin: 0;
	padding: 0;
	list-style: none;
}

.nav-list a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.4rem;
	padding: 0 0 0.2rem;
	border-bottom: 3px solid transparent;
	color: var( --ink );
	font-weight: 850;
	line-height: 1.2;
	text-decoration: none;
	text-transform: none;
}

.nav-list a:hover,
.nav-list a[aria-current="page"],
.nav-list .current-menu-item > a,
.nav-list .current_page_item > a,
.nav-list .current_page_parent > a,
.nav-list .current-menu-ancestor > a {
	border-bottom-color: var( --coral );
	background: transparent;
	color: var( --ink );
}

.nav-list .external-link,
.footer-links .external-link {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	color: var( --accent-strong );
	text-decoration: underline;
	text-decoration-thickness: 0.08em;
}

.nav-list .external-link:hover,
.nav-list .external-link:focus-visible {
	border-bottom-color: var( --coral );
	background: transparent;
	color: var( --accent-strong );
}

.footer-links .external-link:hover {
	color: var( --accent-rose );
}

.nav-list .external-link::after,
.footer-links .external-link::after {
	content: "↗";
	font-size: 0.75em;
	line-height: 1;
}

.theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	gap: 0.45rem;
	box-sizing: border-box;
	min-height: 2.4rem;
	padding: 0.45rem 0.8rem;
	border: 2px solid var( --stroke-strong );
	border-radius: var( --radius-sm );
	background: var( --surface );
	box-shadow: 0.24rem 0.24rem 0 var( --shadow-ink );
	color: var( --ink );
	cursor: pointer;
	font: inherit;
	font-weight: 850;
	line-height: 1;
}

.theme-toggle:hover {
	transform: translate( 0.12rem, 0.12rem );
	background: var( --highlight-interactive );
	box-shadow: 0.12rem 0.12rem 0 var( --shadow-ink );
	color: var( --on-highlight );
}

.theme-toggle__icon {
	font-size: 1rem;
	line-height: 1;
}

.theme-toggle__text {
	white-space: nowrap;
}

@media ( max-width: 760px ) and ( min-width: 681px ) {
	.nav-wrap {
		display: grid;
		grid-template-columns: minmax( 0, 1fr ) auto;
		align-items: center;
		gap: 0.75rem 1.25rem;
	}

	.site-header .nav-wrap > .site-branding {
		grid-column: 1;
		grid-row: 1;
		max-width: 100%;
		margin-top: 0;
	}

	.primary-navigation {
		grid-column: 1 / -1;
		grid-row: 2;
	}

	.primary-navigation .wp-block-navigation__container {
		justify-content: center;
		row-gap: 0.25rem;
	}

	.site-header__actions,
	.theme-toggle {
		grid-column: 2;
		grid-row: 1;
		justify-self: end;
	}

	.site-header__actions {
		display: inline-flex;
	}
}

.mobile-menu-toggle,
.mobile-nav-backdrop {
	display: none;
}

body.mobile-nav-open {
	overflow: hidden;
}

