/*
 * Virtina child: site header.
 * Shared component, no page prefix. Desktop layout follows the Figma header frame (1728px wide).
 */

:root {
	--vch-header-active-color: #0080e2;
}

/* Skip link: hidden until it receives keyboard focus. */
.vch-skip-link {
	position: absolute;
	top: -100px;
	left: 16px;
	z-index: 100;
	padding: 10px 16px;
	border-radius: 8px;
	background: #000;
	color: #fff;
	font-family: 'Inter', sans-serif;
	font-size: 16px;
	text-decoration: none;
}

.vch-skip-link:focus {
	top: 16px;
}

.vch-header {
	position: sticky;
	top: 0;
	/* Above the page content and the chat widgets (up to z-index 2000000000).
	   The mobile sidebar sits inside this stacking context. */
	z-index: 2147483000;
	background: #fff;
	font-family: 'Inter', sans-serif;
	color: #000;
}

/* Sticky needs the page wrapper to stay a plain box. The parent theme sets
   overflow on #page, which makes it a scroll container. "clip" keeps the
   horizontal clipping without that side effect. */
#page.site {
	overflow-x: clip;
	overflow-y: visible;
}

/* Hide on scroll down, show again on scroll up (js/vch-header-scroll.js).
   Transform is only set while hidden, so the mobile sidebar keeps its fixed position when shown. */
.vch-header.is-hidden {
	transform: translateY(-100%);
}

@media (prefers-reduced-motion: no-preference) {
	.vch-header {
		transition: transform 0.3s ease, background-color 0.3s ease;
	}
}

/* White background once the page is scrolled, so content does not show through the header */
.vch-header.is-scrolled {
	background: #fff;
}

.vch-header__inner {
	display: flex;
	align-items: center;
	gap: 30px;
	height: 80px;
	padding-block: 0;
	box-sizing: border-box;
}

/* Logo: uses the site logo set in Appearance > Customize. */
.vch-header__logo {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	white-space: nowrap;
}

.vch-header__logo .custom-logo-link,
.vch-header__logo-text {
	display: block;
	line-height: 0;
	color: #000;
	text-decoration: none;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -0.48px;
}

.vch-header__logo .custom-logo {
	display: block;
	width: 137px;
	height: auto;
	max-height: 32px;
}

/* Nav pill */
.vch-header__nav {
	flex: 0 1 688px;
	display: flex;
	align-items: center;
	height: 46px;
	box-sizing: border-box;
	border-radius: 50px;
	background: rgba(255, 255, 255, 0.3);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.vch-header__links {
	display: flex;
	align-items: center;
	gap: 36px;
	margin: 0;
	padding: 0 31px;
	list-style: none;
}

.vch-header__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 16px;
	line-height: 1.2;
	letter-spacing: -0.48px;
	white-space: nowrap;
	color: #000;
	text-decoration: none;
}

.vch-header__link:hover {
	color: var(--vch-header-active-color);
}

.vch-header__link:focus-visible {
	text-decoration: underline;
	text-underline-offset: 4px;
}

/* Active page: the link for the current page, or the parent of the current page */
.vch-header__link--active {
	color: var(--vch-header-active-color);
}

.vch-header__chevron {
	display: block;
	width: 12px;
	height: auto;
}

/* Mobile sidebar arrow */
@media (max-width: 1279px) {
	.vch-header__chevron {
		width: 12px;
	}
}

/* Right-hand actions */
.vch-header__actions {
	display: flex;
	align-items: center;
	gap: 58px;
	margin-left: auto;
}

.vch-header__profile {
	display: flex;
	align-items: center;
	gap: 7px;
	color: #000;
	text-decoration: none;
}

/* Tighter gap below 1499px */
@media (max-width: 1499px) {
	.vch-header__actions {
		gap: 26px;
	}
}

/* Hide the profile link below 1399px */
@media (max-width: 1399px) {
	.vch-header__profile {
		display: none;
	}
}

.vch-header__avatar {
	display: block;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	object-fit: cover;
}

/* Profile photo with the calendar overlay. The wrapper sets the size; the photo fills it. */
.vch-header__avatar-wrap {
	position: relative;
	display: block;
	flex: 0 0 auto;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	overflow: hidden;
}

.vch-header__avatar-wrap .vch-header__avatar {
	width: 100%;
	height: 100%;
}

.vch-header__avatar-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--vch-color-overlay);
	color: var(--vch-color-on-overlay);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.vch-header__profile:hover .vch-header__avatar-overlay,
.vch-header__profile:focus-visible .vch-header__avatar-overlay,
.vch-header__sidebar-profile:hover .vch-header__avatar-overlay,
.vch-header__sidebar-profile:focus-visible .vch-header__avatar-overlay {
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.vch-header__avatar-overlay {
		transition: none;
	}
}

.vch-header__profile-text {
	display: flex;
	flex-direction: column;
	font-size: 16px;
	line-height: 1.2;
	letter-spacing: -0.48px;
}

.vch-header__profile-name {
	font-weight: 700;
}

.vch-header__profile-meta {
	font-size: 14px;
	letter-spacing: -0.42px;
}

.vch-header__profile:focus-visible,
.vch-header__toggle:focus-visible {
	outline: 2px solid #000;
	outline-offset: 3px;
}

/* Sidebar profile: top left of the mobile sidebar, level with the menu button */
.vch-header__sidebar-profile {
	display: none;
}

@media (max-width: 1279px) {
	.vch-header__sidebar-profile {
		position: absolute;
		top: 13px;
		left: 20px;
		display: flex;
		align-items: center;
		gap: 8px;
		color: #000;
		text-decoration: none;
	}

	.vch-header__sidebar-profile .vch-header__avatar-wrap {
		width: 46px;
		height: 46px;
	}

	.vch-header__sidebar-profile:focus-visible {
		outline: 2px solid #000;
		outline-offset: 3px;
	}
}

/* Call icon: shown next to the menu button below 574px */
.vch-header__call {
	display: none;
	flex: 0 0 38px;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	margin-left: 0;
	border-radius: 50%;
	background: #fff;
	color: #000;
	border: 1px solid #000;
	box-sizing: border-box;
}

.vch-header__call:focus-visible {
	outline: 2px solid #000;
	outline-offset: 3px;
}

@media (max-width: 574px) {
	.vch-header__call {
		display: flex;
		order: 2;
	}

	.vch-header__call + .vch-header__toggle {
		margin-left: 12px;
	}
}

/* Sidebar CTA: only shown inside the mobile sidebar */
.vch-header__mobile-cta {
	display: none;
}

/* Mobile toggle (hamburger), shown below the desktop breakpoint */
.vch-header__toggle {
	display: none;
	flex: 0 0 38px;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	margin-left: auto;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #000;
	cursor: pointer;
}

.vch-header__toggle-bars {
	position: relative;
	display: block;
	width: 18px;
	height: 14px;
}

.vch-header__toggle-bars span {
	position: absolute;
	left: 0;
	display: block;
	width: 100%;
	height: 2px;
	border-radius: 2px;
	background: #fff;
}

.vch-header__toggle-bars span:nth-child(1) {
	top: 0;
}

.vch-header__toggle-bars span:nth-child(2) {
	top: 6px;
}

.vch-header__toggle-bars span:nth-child(3) {
	top: 12px;
}

/* Open state: the bars become an X */
.vch-header__toggle[aria-expanded="true"] .vch-header__toggle-bars span:nth-child(1) {
	top: 6px;
	transform: rotate(45deg);
}

.vch-header__toggle[aria-expanded="true"] .vch-header__toggle-bars span:nth-child(2) {
	opacity: 0;
}

.vch-header__toggle[aria-expanded="true"] .vch-header__toggle-bars span:nth-child(3) {
	top: 6px;
	transform: rotate(-45deg);
}

@media (prefers-reduced-motion: no-preference) {
	.vch-header__toggle-bars span {
		transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
	}
}

/* Below 1280px: links move into a panel opened by the toggle */
@media (max-width: 1279px) {
	.vch-header__inner {
		height: 70px;
		padding-block: 13px;
		flex-wrap: wrap;
		gap: 0;
	}

	.vch-header__toggle {
		display: flex;
		position: relative;
		/* Above the chat widgets (up to z-index 2000000000) */
		z-index: 2147483641;
	}

	/* Sidebar: slides in from the right over the page. The box-shadow dims the rest of the page. */
	.vch-header__nav {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: 2147483640;
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		width: min(420px, 88vw);
		height: 100vh;
		height: 100dvh;
		margin: 0;
		padding: 96px 0 24px;
		box-sizing: border-box;
		overflow-y: auto;
		overscroll-behavior: contain;
		border-radius: 24px 0 0 24px;
		background: #fff;
		box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.4);
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
		transform: translateX(100%);
		visibility: hidden;
	}

	.vch-header__nav.is-open {
		transform: none;
		visibility: visible;
	}

	/* "Start a Project" pinned to the bottom of the sidebar */
	.vch-header__mobile-cta {
		display: flex;
		align-self: stretch;
		margin: auto 20px 0;
		flex: 0 0 auto;
	}

	.vch-header__nav {
		transition: transform 0.3s ease, visibility 0.3s;
	}

	@media (prefers-reduced-motion: reduce) {
		.vch-header__nav {
			transition: none;
		}
	}

	html.vch-menu-open {
		overflow: hidden;
	}

	.vch-header__links {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		width: 100%;
		padding: 8px 0;
	}

	.vch-header__link {
		display: flex;
		justify-content: space-between;
		padding: 14px 20px;
		font-size: 18px;
	}

	/* Thin divider above each item in the sidebar */
	.vch-header__nav {
		--vch-header-divider: #e6e6e6;
	}

	.vch-header__links > li {
		border-top: 1px solid var(--vch-header-divider);
	}

	.vch-header__actions {
		order: 1;
		gap: 16px;
		margin-left: auto;
	}

	.vch-header__toggle {
		order: 2;
		margin-left: 16px;
	}

	.vch-header__profile {
		display: none;
	}
}

/* Header CTAs keep the compact size: 46px tall with a 38px arrow, not the 54px primary size. */
.vch-header__actions .vch-button--primary,
.vch-header__mobile-cta {
	min-width: 183px;
	height: var(--vch-button-height);
	padding: 0 4px 0 21px;
	border: 0;
}

.vch-header__actions .vch-button--primary .vch-button__arrow,
.vch-header__mobile-cta .vch-button__arrow {
	--vch-arrow-size: 38px;
	--vch-arrow-glyph: 30px;
}

@media (max-width: 480px) {
	.vch-header__actions .vch-button {
		min-width: 0;
		padding: 0 6px 0 16px;
		gap: 10px;
	}
}

/* Hide the "Start a Project" button below 575px */
@media (max-width: 574px) {
	.vch-header__actions .vch-button {
		display: none;
	}
}
