/**
 * Section: Site Header Style
 * Arquivo: sections/site-header/style.css
 * 
 * Desenvolvido por: Roger Alves
 * Data da Modificacao: 2026-05-28
 * Hora da Modificacao: 18:03
 *
 * Todos os direitos reservados.
 */

.site-header {
	background-color: var(--color-bg-light);
	box-shadow: var(--shadow-sm);
	position: sticky;
	top: 0;
	z-index: 1000;
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
	transition: var(--transition-smooth);
}

.header-container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 82px;
	gap: clamp(1rem, 2.4vw, 2.5rem);
}

.site-logo {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
}

.site-logo a {
	display: flex;
	align-items: center;
	gap: clamp(0.55rem, 0.8vw, 0.75rem);
}

.logo-image {
	width: clamp(48px, 4.5vw, 64px);
	height: clamp(48px, 4.5vw, 64px);
	object-fit: contain;
	object-position: left center;
	flex: 0 0 auto;
}

.logo-text {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	max-width: 310px;
	color: #9a9a9a;
	font-family: var(--font-heading);
	font-size: clamp(0.80rem, 0.92vw, 0.98rem);
	font-weight: 500;
	line-height: 1.18;
	letter-spacing: 0;
	transition: color var(--transition-fast);
}

.logo-text span {
	display: block;
	white-space: nowrap;
}

/* Menu Hamburguer (Mobile) */
.menu-toggle {
	display: none;
	flex-direction: column;
	justify-content: space-between;
	width: 26px;
	height: 18px;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0;
	z-index: 1001;
}

.hamburger-line {
	width: 100%;
	height: 2px;
	background-color: var(--color-primary);
	border-radius: var(--radius-sm);
	transition: var(--transition-smooth);
}

/* Navegacao Principal */
.main-navigation {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex: 1 1 auto;
	min-width: 0;
}

.nav-list {
	display: flex;
	list-style: none;
	gap: clamp(0.2rem, 0.45vw, 0.45rem);
	align-items: center;
	justify-content: flex-end;
	width: 100%;
}

.menu-item {
	position: relative;
}

.menu-item--header-actions {
	display: inline-flex;
	align-items: center;
	margin-left: 0.25rem;
}

.menu-item a {
	font-family: var(--font-body);
	font-weight: 500;
	font-size: clamp(0.84rem, 1vw, 0.95rem);
	line-height: 1.2;
	color: var(--color-text-secondary);
	padding: 0.5rem 0.25rem;
	white-space: nowrap;
	transition: var(--transition-fast);
}

.menu-item a:hover {
	color: var(--color-accent);
}

/* Destaque Ativo no Menu (como visto no PDF) */
.menu-item.current-menu-item a,
.nav-list.fallback-nav li.current-menu-item a {
	color: var(--color-text-on-dark);
	background-color: var(--color-accent);
	padding: 0.5rem 1rem;
	border-radius: var(--radius-sm);
}

.menu-item.current-menu-item a:hover {
	background-color: var(--color-accent-dark);
}

.header-actions {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	gap: 0.5rem;
}

.site-theme-switcher {
	display: inline-flex;
	align-items: center;
	gap: 0.15rem;
	padding: 0.18rem;
	border: 1px solid rgba(13, 35, 58, 0.14);
	border-radius: var(--radius-full);
	background: var(--color-bg-surface);
}

.site-theme-option,
.site-account-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: var(--radius-full);
	color: var(--color-text-secondary);
	transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.site-theme-option {
	border: 0;
	background: transparent;
	cursor: pointer;
	padding: 0;
}

.site-theme-option svg,
.site-account-link svg {
	width: 1rem;
	height: 1rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.site-theme-option[aria-pressed="true"] {
	background: var(--color-primary);
	color: var(--color-text-on-dark);
}

.site-account-link {
	border: 1px solid rgba(13, 35, 58, 0.14);
	background: var(--color-bg-light);
}

.site-theme-option:hover,
.site-theme-option:focus-visible,
.site-account-link:hover,
.site-account-link:focus-visible {
	color: var(--color-accent);
	box-shadow: 0 0 0 3px rgba(112, 12, 20, 0.08);
	outline: none;
}

.site-theme-option[aria-pressed="true"]:hover,
.site-theme-option[aria-pressed="true"]:focus-visible {
	color: var(--color-text-on-dark);
}

html[data-gpm-theme="dark"] .site-header {
	background: rgba(16, 28, 43, 0.96);
	border-bottom-color: rgba(253, 186, 73, 0.16);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
}

html[data-gpm-theme="dark"] .hamburger-line {
	background-color: #fdba49;
}

html[data-gpm-theme="dark"] .logo-text {
	color: #ffffff;
}

html[data-gpm-theme="dark"] .menu-item a {
	color: #ffffff;
}

html[data-gpm-theme="dark"] .menu-item a:hover {
	color: #ffffff;
}

html[data-gpm-theme="dark"] .menu-item.current-menu-item a,
html[data-gpm-theme="dark"] .nav-list.fallback-nav li.current-menu-item a {
	background-color: #8a2124;
	color: #ffffff;
}

html[data-gpm-theme="dark"] .menu-item.current-menu-item a:hover {
	background-color: #6a1518;
}

html[data-gpm-theme="dark"] .site-theme-switcher {
	background: #101c2b;
	border-color: rgba(253, 186, 73, 0.22);
}

html[data-gpm-theme="dark"] .site-theme-option,
html[data-gpm-theme="dark"] .site-account-link {
	color: #ffffff;
}

html[data-gpm-theme="dark"] .site-theme-option[aria-pressed="true"] {
	background: #fdba49;
	color: #281800;
}

html[data-gpm-theme="dark"] .site-account-link {
	background: #14202f;
	border-color: rgba(253, 186, 73, 0.24);
}

html[data-gpm-theme="dark"] .site-theme-option:hover,
html[data-gpm-theme="dark"] .site-theme-option:focus-visible,
html[data-gpm-theme="dark"] .site-account-link:hover,
html[data-gpm-theme="dark"] .site-account-link:focus-visible {
	color: #ffffff;
	box-shadow: 0 0 0 3px rgba(253, 186, 73, 0.12);
}

html[data-gpm-theme="dark"] .site-theme-option[aria-pressed="true"]:hover,
html[data-gpm-theme="dark"] .site-theme-option[aria-pressed="true"]:focus-visible {
	color: #281800;
}

/* Regras Responsivas Mobile (Mobile-First approach) */
@media (max-width: 1024px) {
	.menu-toggle {
		display: flex;
		order: 3;
	}

	.header-actions {
		margin-left: auto;
	}

	.main-navigation {
		position: absolute;
		top: 82px;
		left: 0;
		right: 0;
		background-color: var(--color-bg-light);
		box-shadow: var(--shadow-md);
		border-top: 1px solid rgba(0, 0, 0, 0.05);
		padding: 2rem 1.5rem;
		max-height: 0;
		overflow: hidden;
		opacity: 0;
		visibility: hidden;
		transition: var(--transition-smooth);
		z-index: 999;
	}

	html[data-gpm-theme="dark"] .main-navigation {
		background-color: #101c2b;
		border-top-color: rgba(253, 186, 73, 0.16);
		box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
	}

	/* Quando o menu e ativado pelo script.js */
	.main-navigation.is-active {
		max-height: 450px;
		opacity: 1;
		visibility: visible;
	}

	.nav-list {
		flex-direction: column;
		gap: 1.25rem;
		width: 100%;
	}

	.menu-item--header-actions {
		margin-left: 0;
	}

	.menu-item--header-actions .header-actions {
		margin-left: 0;
	}

	.menu-item a {
		display: block;
		font-size: 1.1rem;
		padding: 0.5rem 0;
		white-space: normal;
	}

	.menu-item.current-menu-item a,
	.nav-list.fallback-nav li.current-menu-item a {
		display: inline-block;
	}

	/* Animacao do Botao Hamburguer */
	.menu-toggle.is-active .line-1 {
		transform: translateY(8px) rotate(45deg);
	}

	.menu-toggle.is-active .line-2 {
		opacity: 0;
	}

	.menu-toggle.is-active .line-3 {
		transform: translateY(-8px) rotate(-45deg);
	}
}

@media (max-width: 1180px) and (min-width: 1025px) {
	.logo-image {
		width: 50px;
		height: 50px;
	}

	.logo-text {
		font-size: 0.76rem;
	}

	.nav-list {
		gap: 0.55rem;
	}

	.menu-item a {
		font-size: 0.84rem;
	}

	.header-actions {
		gap: 0.35rem;
	}
}

@media (max-width: 520px) {
	.logo-image {
		width: 42px;
		height: 42px;
	}

	.logo-text {
		max-width: min(62vw, 230px);
		font-size: clamp(0.72rem, 3.2vw, 0.95rem);
	}

	.header-container {
		gap: 0.75rem;
	}

	.site-theme-switcher {
		gap: 0;
	}

	.site-theme-option,
	.site-account-link {
		width: 1.85rem;
		height: 1.85rem;
	}
}
