/**
 * Header VES — estado A (expandido) y estado B (minificado)
 */

.site-header {
	position: relative;
	z-index: 100;
	width: 100%;
	padding: var(--grid-margin);
	padding-bottom: 20px;
	background: transparent;
	backdrop-filter: blur(105px);
	-webkit-backdrop-filter: blur(105px);
	border-bottom: 0.5px solid var(--color-offwhite);
	color: var(--color-offwhite);
	transition: background-color 0.25s ease;
}

.site-header:not(.is-header-ready),
.site-header:not(.is-header-ready) .site-header__logo img {
	transition: none !important;
}

/* -------------------------------------------------------------------------- */
/* Estado A — expandido (Home)                                                */
/* -------------------------------------------------------------------------- */

.site-header.is-expanded {
	height: 40vh;
	min-height: 200px;
}

body.home .site-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
}

.site-header__spacer {
	display: none;
	width: 100%;
	pointer-events: none;
}

body.home .site-header__spacer {
	display: block;
	height: 70px;
	min-height: 70px;
}

.site-header__inner {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.site-header__top {
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: start;
	gap: 1rem;
	flex: 1 1 auto;
	min-height: 0;
	position: relative;
}

.site-header__logo {
	display: block;
	flex-shrink: 0;
	line-height: 0;
	z-index: 2;
	justify-self: start;
	align-self: start;
	margin-top: 50px;
}

.site-header__logo img {
	width: auto;
	height: clamp(64px, 14vh, 120px);
	transition: height 0.25s ease;
}

.site-header__tagline {
	margin: 0;
	margin-top: 50px;
	font-family: var(--font-body);
	font-size: clamp(1rem, 1.25rem + 0.25vw, 1.8rem);
	font-weight: 200;
	line-height: 1.35;
	text-align: left;
	width: 80%;
	max-width: 80%;
	grid-column: 2;
	justify-self: start;
	align-self: start;
	padding: 0;
	text-wrap: balance;
}

/* Toggle: oculto en desktop; visible en móvil */
.site-header__toggle {
	display: none;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: none;
	background: transparent;
	color: var(--color-offwhite);
	cursor: pointer;
	z-index: 5;
	line-height: 0;
}

.site-header__toggle-icon {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	width: 22px;
	height: 14px;
}

.site-header__toggle-icon span {
	display: block;
	height: 2px;
	width: 100%;
	background-color: var(--color-offwhite);
	transition: transform 0.25s ease, opacity 0.25s ease;
}

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

.site-header.is-nav-open .site-header__toggle-icon span:nth-child(2) {
	opacity: 0;
}

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

.site-header__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	margin-top: auto;
	width: 100%;
	flex-shrink: 0;
}

.site-header.is-expanded .site-header__nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: center;
	gap: 1rem;
}

.site-header.is-expanded .site-header__menu {
	grid-column: 1;
	justify-self: start;
}

.site-header.is-expanded .site-header__cta {
	grid-column: 2;
	justify-self: start;
}

.site-header__menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-header__link {
	font-family: var(--font-body);
	font-size: clamp(0.8rem, 0.75rem + 0.25vw, 0.95rem);
	text-decoration: none;
	letter-spacing: 0.01em;
	color: inherit;
}

.site-header__link:hover {
	text-decoration: underline;
}

.site-header__link[aria-current="page"] {
	text-decoration: underline;
}

.site-header__cta {
	position: relative;
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	overflow: hidden;
	padding: 0.35rem 0.65rem;
	font-family: var(--font-body);
	font-size: clamp(0.8rem, 0.75rem + 0.25vw, 0.95rem);
	letter-spacing: 0.01em;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none;
	color: var(--color-offwhite);
	background-color: transparent;
	border: 0.5px solid var(--color-accent);
	text-transform: uppercase;
}

.site-header__cta:hover {
	text-decoration: none;
}

.site-header__cta .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.site-header__cta-sizer {
	display: inline-block;
	visibility: hidden;
	pointer-events: none;
}

.site-header__cta-marquee {
	position: absolute;
	inset: 0;
	overflow: hidden;
	display: flex;
	align-items: center;
}

.site-header__cta-track {
	display: flex;
	width: max-content;
	animation: ves-cta-marquee 14s linear infinite;
}

.site-header__cta-item {
	padding-right: 2em;
	flex-shrink: 0;
}

@keyframes ves-cta-marquee {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(-50%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-header__cta-track {
		animation: none;
	}

	.site-header__cta-sizer {
		visibility: visible;
	}

	.site-header__cta-marquee {
		display: none;
	}
}

/* -------------------------------------------------------------------------- */
/* Estado B — minificado                                                      */
/* -------------------------------------------------------------------------- */

.site-header.is-minified {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: auto;
	min-height: 0;
	padding: 10px var(--grid-margin);
	background: var(--color-primary);
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	border-bottom: 0.5px solid var(--color-offwhite);
}

.site-header.is-minified .site-header__inner {
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	gap: 1.5rem;
	height: auto;
}

.site-header.is-minified .site-header__top {
	display: block;
	flex: 0 0 auto;
	min-height: 0;
}

.site-header.is-minified .site-header__logo {
	margin-top: 0;
}

.site-header.is-minified .site-header__logo img {
	height: 50px;
}

.site-header.is-minified .site-header__tagline {
	display: none;
}

/* Móvil-first: menú oculto; hamburger a la derecha */
.site-header.is-minified .site-header__toggle {
	display: inline-flex;
	order: 3;
	margin-left: auto;
	height: 22px;
	width: 22px;
	flex-shrink: 0;
}

.site-header.is-minified .site-header__nav {
	display: block;
	flex: 0 0 0;
	width: 0;
	height: 0;
	margin: 0;
	padding: 0;
	overflow: visible;
	position: static;
	background: transparent;
	border: none;
}

.site-header.is-minified .site-header__menu {
	display: none;
}

.site-header.is-minified .site-header__cta {
	display: none;
}

/* Desktop minificado: nav inline, sin hamburger */
@media (min-width: 769px) {
	.site-header.is-minified .site-header__toggle {
		display: none;
	}

	.site-header.is-minified .site-header__nav {
		display: flex;
		flex: 1 1 auto;
		width: auto;
		height: auto;
		align-items: center;
		justify-content: space-between;
		gap: 1.5rem;
		overflow: visible;
	}

	.site-header.is-minified .site-header__menu {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		gap: 0.25rem 1.25rem;
		position: static;
		background: transparent;
		border: none;
	}

	.site-header.is-minified .site-header__cta {
		display: inline-flex;
		margin-left: auto;
	}
}

body:not(.home) {
	padding-top: 70px;
}

/* -------------------------------------------------------------------------- */
/* Móvil ≤768px                                                               */
/* -------------------------------------------------------------------------- */

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

	/*
	 * Panel del menú: ancho completo bajo el stroke;
	 * el padding horizontal de cada ítem = margen del sitio.
	 */
	body.home .site-header__menu,
	.site-header.is-minified .site-header__menu {
		position: absolute;
		top: calc(100% + 0.5px);
		left: 50%;
		right: auto;
		width: 100vw;
		height: auto;
		margin: 0;
		padding: 0;
		transform: translateX(-50%);
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		list-style: none;
		z-index: 101;
		box-sizing: border-box;
	}

	body.home .site-header__item .site-header__link,
	.site-header.is-minified .site-header__item .site-header__link {
		display: block;
		padding: 0.9rem var(--grid-margin);
		width: 100%;
		box-sizing: border-box;
	}

	/* —— Home expandido —— */
	body.home .site-header,
	body.home .site-header.is-expanded {
		height: 30svh;
		min-height: 30svh;
		max-height: 30svh;
		padding: 0.75rem var(--grid-margin);
		box-sizing: border-box;
	}

	body.home .site-header__spacer {
		height: 30svh;
		min-height: 30svh;
	}

	body.home .site-header__inner {
		display: grid;
		grid-template-columns: auto 1fr;
		grid-template-rows: minmax(0, 1fr) auto;
		grid-template-areas:
			"top top"
			"toggle cta";
		align-content: stretch;
		align-items: center;
		column-gap: 20px;
		row-gap: 0.35rem;
		height: 100%;
		min-height: 0;
	}

	body.home .site-header__top {
		grid-area: top;
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: 1rem;
		flex: 1 1 auto;
		min-height: 0;
		overflow: hidden;
	}

	body.home .site-header__logo {
		margin-top: 0;
	}

	body.home .site-header__logo img {
		height: clamp(36px, 8svh, 56px);
	}

	body.home .site-header__tagline {
		display: block;
		margin: 0;
		width: 100%;
		max-width: 100%;
		font-size: clamp(17px, 4.5vw, 21px);
		line-height: 1.2;
		flex: 1 1 auto;
		min-height: 0;
	}

	body.home .site-header__toggle {
		grid-area: toggle;
		justify-self: start;
		height: 22px;
		width: 22px;
	}

	body.home .site-header__nav {
		grid-area: cta;
		display: flex;
		align-items: center;
		justify-content: flex-start;
		margin: 0;
		width: auto;
		position: static;
	}

	body.home .site-header__cta {
		justify-self: start;
		margin: 0;
		width: auto;
		max-width: 100%;
		height: 22px;
		padding: 0 0.5rem;
		font-size: 0.8rem;
		box-sizing: border-box;
	}

	body.home .site-header__menu {
		display: none;
		background: rgba(78, 20, 137, 0.96);
		backdrop-filter: blur(40px);
		-webkit-backdrop-filter: blur(40px);
		border-bottom: 0.5px solid var(--color-offwhite);
	}

	body.home .site-header.is-nav-open .site-header__menu {
		display: flex;
	}

	body.home .site-header__item {
		margin: 0;
		width: 100%;
	}

	body.home .site-header__item + .site-header__item {
		border-top: 0.5px solid var(--color-offwhite);
	}

	/* —— Minificado: logo | hamburger —— */
	.site-header.is-minified .site-header__inner {
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: center;
		justify-content: space-between;
		gap: 1rem;
	}

	.site-header.is-minified .site-header__toggle {
		display: inline-flex;
		order: 3;
		margin-left: auto;
	}

	.site-header.is-minified .site-header__nav {
		/* No genera caja de layout; el panel se ancla al header */
		position: static;
		flex: 0 0 0;
		width: 0;
		height: 0;
		margin: 0;
		padding: 0;
		border: none;
		background: transparent;
		overflow: visible;
	}

	.site-header.is-minified .site-header__cta {
		display: none;
	}

	.site-header.is-minified .site-header__menu {
		display: none;
		background: var(--color-primary);
		border-bottom: 0.5px solid var(--color-offwhite);
	}

	.site-header.is-minified.is-nav-open .site-header__menu {
		display: flex;
	}

	.site-header.is-minified .site-header__item {
		margin: 0;
		width: 100%;
	}

	.site-header.is-minified .site-header__item + .site-header__item {
		border-top: 0.5px solid var(--color-offwhite);
	}
}

/* Pantallas muy estrechas (p. ej. iPhone 12 mini) */
@media (max-width: 390px) {
	body.home .site-header__top {
		gap: 0.65rem;
	}

	body.home .site-header__logo img {
		height: clamp(32px, 7svh, 48px);
	}

	body.home .site-header__tagline {
		font-size: 17px;
		line-height: 1.2;
	}
}
