/* Heuristic — menú móvil a medida.
   Vocabulario visual: filetes, corchetes de esquina, retícula. Sin píldoras ni radios grandes. */

.hnav {
	display: flex;
	align-items: center;
}

/* --- Disparador ---------------------------------------------------------- */

.hnav .hnav-toggle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	background: none;
	background-color: transparent;
	box-sizing: border-box;
	flex: 0 0 auto;
	border: 1px solid #e4e8e4;
	border-radius: 0;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.hnav .hnav-toggle:hover,
.hnav .hnav-toggle:focus,
.hnav .hnav-toggle:focus-visible,
.hnav .hnav-toggle:active {
	background: none;
	background-color: transparent;
	border-color: #137a3a;
}

.hnav .hnav-toggle:focus-visible {
	outline: 2px solid #137a3a;
	outline-offset: 2px;
}

.hnav .hnav-toggle-box {
	position: relative;
	width: 20px;
	height: 12px;
}

.hnav .hnav-toggle-box span {
	position: absolute;
	left: 0;
	width: 100%;
	height: 1.5px;
	background: #2b2b2b;
	transition: transform 0.24s ease, opacity 0.18s ease;
}

.hnav .hnav-toggle-box span:nth-child(1) { top: 0; }
.hnav .hnav-toggle-box span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hnav .hnav-toggle-box span:nth-child(3) { bottom: 0; }

/* --- Panel -------------------------------------------------------------- */

.hnav-panel {
	position: fixed;
	inset: 0;
	z-index: 9998;
	display: flex;
	flex-direction: column;
	background: #ffffff;
	opacity: 0;
	pointer-events: none;
	transform: translateY(-8px);
	/* Sin visibility: un ancestro con visibility:hidden impide enfocar a sus hijos
	   durante un tick. El estado cerrado se marca con el atributo inert desde JS. */
	transition: opacity 0.26s ease, transform 0.26s ease;
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* Sin soporte de inert, el panel cerrado debe salir del orden de tabulación. */
.hnav-panel.hnav-no-inert:not([data-open]) {
	visibility: hidden;
	transition: opacity 0.26s ease, transform 0.26s ease, visibility 0s linear 0.26s;
}

.hnav-panel[data-open] {
	opacity: 1;
	pointer-events: auto;
	transform: none;
}

/* Cabecera del panel: etiqueta mono + cerrar */
.hnav-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 22px 20px;
	border-bottom: 1px solid #e4e8e4;
}

.hnav-eyebrow {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: 'Akkurat Mono', ui-monospace, monospace;
	font-size: 9.5px;
	font-weight: 400;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #137a3a;
}

.hnav-eyebrow::before {
	content: '';
	width: 22px;
	height: 1px;
	background: rgba(19, 122, 58, 0.55);
}

.hnav .hnav-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: -11px -10px -11px 0;
	padding: 0;
	background: none;
	border: 0;
	color: #2b2b2b;
	cursor: pointer;
}

.hnav .hnav-close:hover,
.hnav .hnav-close:focus,
.hnav .hnav-close:focus-visible,
.hnav .hnav-close:active {
	background: none;
	background-color: transparent;
	color: #137a3a;
}

.hnav .hnav-close:focus-visible {
	outline: 2px solid #137a3a;
	outline-offset: 2px;
}

.hnav .hnav-close svg { width: 18px; height: 18px; }

/* Lista de enlaces: un filete por fila, sin bullets */
.hnav-panel .menu,
.hnav-panel ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hnav-panel li {
	border-bottom: 1px solid #e4e8e4;
}

.hnav-panel li a {
	display: flex;
	align-items: baseline;
	gap: 14px;
	padding: 22px 20px;
	font-family: 'Aeonik', sans-serif;
	font-size: 26px;
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: #2b2b2b;
	text-decoration: none;
}

/* Numeración discreta en mono, como marca de retícula */
.hnav-panel li {
	counter-increment: hnav;
}

.hnav-panel li a::before {
	content: counter(hnav, decimal-leading-zero);
	font-family: 'Akkurat Mono', ui-monospace, monospace;
	font-size: 10.5px;
	font-weight: 400;
	letter-spacing: 0.02em;
	color: #a8b0a8;
	transform: translateY(-4px);
}

.hnav-panel li a:active,
.hnav-panel li a:focus-visible {
	color: #137a3a;
	background: #f7f9f7;
	outline: none;
}

.hnav-panel li.current-menu-item > a {
	color: #137a3a;
}

.hnav-list {
	counter-reset: hnav;
}

/* Pie del panel: CTA + contacto */
.hnav-panel-foot {
	margin-top: auto;
	padding: 28px 20px 32px;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.hnav .hnav-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px 30px;
	background: #137a3a;
	color: #ffffff;
	font-family: 'Aeonik', sans-serif;
	font-size: 16px;
	font-weight: 500;
	text-decoration: none;
	border-radius: 0;
}

.hnav-meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-family: 'Aeonik', sans-serif;
	font-size: 15px;
	font-weight: 300;
	line-height: 24px;
	color: #5a605a;
}

.hnav-meta a {
	color: #2b2b2b;
	text-decoration: none;
	font-weight: 500;
}

.hnav-meta .hnav-label {
	font-family: 'Akkurat Mono', ui-monospace, monospace;
	font-size: 9.5px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #a8b0a8;
	margin-bottom: 4px;
}

/* Filete de separación sobre el bloque inferior */
.hnav-panel-foot {
	position: relative;
	border-top: 1px solid #e4e8e4;
}

/* Bloqueo de scroll del documento con el panel abierto */
html.hnav-locked,
html.hnav-locked body {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.hnav-panel,
	.hnav .hnav-toggle-box span {
		transition: none;
	}
}

/* El menú a medida solo existe por debajo del breakpoint móvil */
@media (min-width: 768px) {
	.hnav { display: none; }
}
