/**
 * nav-menu.css
 * -----------------------------------------------------------------------
 * Estilo DIRETO (CSS puro) do gatilho de menu (3 risquinhos assimétricos)
 * e do painel overlay que ele abre. Mesma lógica de custom-gutenberg.css /
 * hero-slider.css: posicionamento fixo/transformações não valem a pena
 * como utilitário Tailwind, então ficam aqui.
 *
 * Interação (ver assets/js/navigation.js):
 *   - Desktop (mouse com hover real): abre no hover, fecha ao tirar o mouse.
 *   - Mobile/touch: abre e fecha no clique.
 * ----------------------------------------------------------------------- */

/* -----------------------------------------------------------------------
 * Gatilho: 3 risquinhos (topo maior, meio menor, base média) + "Menu"
 * --------------------------------------------------------------------- */

.nav-toggle {
	position: relative;
	z-index: 110;
	display: inline-flex;
	align-items: center;
	gap: 0.875rem;
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	color: inherit;
	font-family: var(--dc-font-body);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.nav-toggle__bars {
	position: relative;
	width: 32px;
	height: 18px;
	flex: none;
}

.nav-toggle__bar {
	position: absolute;
	left: 0;
	height: 2px;
	border-radius: 2px;
	background-color: currentColor;
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), width 0.35s ease, top 0.35s ease, opacity 0.25s ease, background-color 0.3s ease;
}

.nav-toggle__bar--top {
	top: 0;
	width: 100%;
}

.nav-toggle__bar--middle {
	top: 8px;
	width: 44%;
}

.nav-toggle__bar--bottom {
	top: 16px;
	width: 74%;
}

/* Aberto → os 3 risquinhos viram um X. */
.nav-toggle[aria-expanded='true'] .nav-toggle__bar--top {
	top: 8px;
	width: 100%;
	transform: rotate(45deg);
}

.nav-toggle[aria-expanded='true'] .nav-toggle__bar--middle {
	width: 0;
	opacity: 0;
}

.nav-toggle[aria-expanded='true'] .nav-toggle__bar--bottom {
	top: 8px;
	width: 100%;
	transform: rotate(-45deg);
}

/* Com o painel vinho (cor sólida e conhecida) aberto atrás dele, cor
 * fixa clara — não depende mais da detecção de seção enquanto aberto. */
.nav-toggle[aria-expanded='true'] {
	color: var(--dc-color-cream);
}

.nav-toggle__label {
	line-height: 1;
	transition: color 0.3s ease;
}

/* -----------------------------------------------------------------------
 * Painel overlay
 * --------------------------------------------------------------------- */

.nav-overlay {
	position: fixed;
	inset: 0 auto 0 0;
	width: 40vw;
	height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 1.5rem;
	padding: 8rem 4rem 4rem 7rem;
	background-color: rgba(166, 40, 60, 0.96);
	transform: translateX(-100%);
	transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
	z-index: 90;
	overflow-y: auto;
}

.nav-overlay.is-open {
	transform: translateX(0);
}

.nav-overlay__list {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.nav-overlay__list a {
	font-family: var(--dc-font-heading);
	font-size: 2.1rem;
	line-height: 1.2;
	color: var(--dc-color-cream);
	text-decoration: none;
	transition: color 0.3s ease;
}

.nav-overlay__list a:hover {
	color: var(--dc-color-accent);
}

@media (max-width: 782px) {
	.nav-overlay {
		/* O culpado do "espaço grande em cima" não era o padding: é o
		 * justify-content:center da regra base, que centraliza a lista
		 * verticalmente nos 100vh inteiros — com só 7 itens, sobra bastante
		 * vazio acima dela. Começando do topo em vez de centralizar. */
		width: 100vw;
		justify-content: flex-start;
		padding: 6rem 1.75rem 1.75rem 1.75rem;
	}

	.nav-overlay__list a {
		font-size: 1.65rem;
	}
}

/* -----------------------------------------------------------------------
 * Redes sociais do header.
 * --------------------------------------------------------------------- */

.header-social .social-links__link {
	transition: color 0.3s ease, border-color 0.3s ease;
}

.header-social .social-links__link:hover {
	color: var(--dc-color-accent);
}

/* O header é um grid de 2 colunas (1fr cada) pro menu/hamburguer e pros
 * ícones sociais — no mobile, com 3+ redes sociais configuradas, os
 * ícones no tamanho/gap padrão (40px + 0.75rem) podiam não caber na
 * metade da tela disponível. Reduz tamanho/gap e permite quebrar linha
 * como último recurso, sem nunca estourar a largura da coluna. */
@media (max-width: 480px) {
	.header-social .social-links {
		flex-wrap: wrap;
		justify-content: flex-end;
		gap: 0.375rem;
	}

	.header-social .social-links__link {
		width: 2rem;
		height: 2rem;
	}

	.header-social .social-links__link svg {
		width: 14px;
		height: 14px;
	}
}

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