/*
  header.css: estilos específicos do header
  - Layout desktop e mobile
  - Menu hamburger
  - Menu lateral (sidebar) para mobile
*/

/* Header base */
.header {
	background: linear-gradient(135deg,
		var(--color-blue-700) 0%,
		var(--color-primary) 50%,
		var(--color-blue-800) 100%
	);
	background-size: 200% 200%;
	animation: headerGradient 16s ease infinite;
	color: var(--color-white);
	position: sticky;
	top: 0;
	z-index: 100;
	overflow: visible;
	transition: box-shadow .35s ease, padding .35s ease, backdrop-filter .35s ease;
}
.header::before {
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: 0;
	height: 2px;
	background: linear-gradient(90deg, transparent, var(--color-blue-500), transparent);
	opacity: .6;
	pointer-events: none;
}
.header.is-scrolled {
	box-shadow: 0 10px 30px rgba(9, 33, 91, 0.35);
}
.header.is-scrolled .header__wrap {
	padding: 22px 0;
}

@keyframes headerGradient {
	0%, 100% { background-position: 0% 50%; }
	50% { background-position: 100% 50%; }
}

.header__wrap {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 24px;
	align-items: center;
	padding: 40px 0;
	min-height: var(--header-min-h);
	transition: padding .35s ease;
}

/* Logo */
.header__logo {
	position: relative;
	z-index: 105;
	display: block;
	width: var(--logo-width);
	height: 0;
	overflow: visible;
}

.header__logo img {
	position: absolute;
	left: 0;
	top: calc(-1 * var(--logo-overlap-top));
	height: var(--logo-size);
	width: auto;
	display: block;
	filter: drop-shadow(0 4px 10px rgba(0,0,0,.25));
	transition: transform .4s cubic-bezier(.34, 1.56, .64, 1), filter .4s ease;
}
.header__logo:hover img {
	transform: scale(1.04) translateY(-3px);
	filter: drop-shadow(0 8px 16px rgba(88, 201, 253, .45));
}

/* Menu Desktop */
.header__nav {
	justify-self: center;
}

.header__nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: nowrap;
	gap: clamp(14px, 2.6vw, 44px);
	justify-content: center;
	align-items: center;
}

.header__nav li { flex: 0 0 auto; }

.header__nav a {
	color: var(--color-white);
	text-decoration: none;
	font-size: clamp(13px, 1.05vw, 16px);
	font-weight: 600;
	letter-spacing: .2px;
	padding: 10px 4px;
	line-height: 1;
	position: relative;
	white-space: nowrap;
	transition: color .25s ease, transform .25s ease;
}
.header__nav a::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 2px;
	width: 0;
	height: 2px;
	background: linear-gradient(90deg, var(--color-blue-500), var(--color-white));
	border-radius: 2px;
	transform: translateX(-50%);
	transition: width .35s ease;
}
.header__nav a:hover {
	color: var(--color-blue-500);
	transform: translateY(-2px);
}
.header__nav a:hover::after {
	width: 100%;
}

/* Botão Hamburger (oculto no desktop) */
.header__hamburger {
	display: none;
	flex-direction: column;
	justify-content: space-around;
	width: 28px;
	height: 24px;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0;
	z-index: 105;
	position: relative;
}

.header__hamburger span {
	width: 100%;
	height: 3px;
	background: var(--color-white);
	border-radius: 2px;
	transition: all .3s ease;
	transform-origin: center;
}

/* Animação do hamburger quando menu aberto */
.header__hamburger.active span:nth-child(1) {
	transform: rotate(45deg) translateY(10px);
}

.header__hamburger.active span:nth-child(2) {
	opacity: 0;
}

.header__hamburger.active span:nth-child(3) {
	transform: rotate(-45deg) translateY(-10px);
}

/* Menu Mobile (sidebar) */
.header__nav--mobile {
	position: fixed;
	top: 0;
	right: -100%;
	width: 280px;
	height: 100vh;
	background: var(--color-blue-800);
	box-shadow: -4px 0 20px rgba(0,0,0,.3);
	z-index: 104;
	padding: 80px 20px 20px;
	overflow-y: auto;
	transition: right .3s ease;
}

.header__nav--mobile.active {
	right: 0;
}

.header__nav--mobile ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.header__nav--mobile li {
	border-bottom: 1px solid rgba(255,255,255,.1);
}

.header__nav--mobile a {
	color: var(--color-white);
	text-decoration: none;
	font-size: 16px;
	font-weight: 600;
	display: block;
	padding: 16px 12px;
	transition: background .2s, padding-left .2s;
}

.header__nav--mobile a:hover {
	background: rgba(255,255,255,.08);
	padding-left: 20px;
}

/* Overlay para fechar o menu */
.header__overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(0,0,0,.5);
	z-index: 103;
	opacity: 0;
	pointer-events: none;
	transition: opacity .3s ease;
}

.header__overlay.active {
	opacity: 1;
	pointer-events: all;
}

/* Responsivo: Mobile */
@media (max-width: 900px) {
	.header__wrap {
		grid-template-columns: auto 1fr auto;
		padding: 30px 0;
		gap: 16px;
	}

	/* Esconder menu desktop */
	.header__nav {
		display: none;
	}

	/* Mostrar hamburger */
	.header__hamburger {
		display: flex;
		justify-self: end;
		margin-right: 0;
	}

	/* Ajustes do logo em mobile - mais alto */
	.header__logo {
		width: 140px;
	}
	
	.header__logo img {
		height: 200px;
		top: -100px;
	}
}

@media (max-width: 640px) {
	.header__nav--mobile {
		width: 100%;
		right: -100%;
	}

	.header__wrap {
		padding: 20px 0;
	}

	.header__logo {
		width: 120px;
	}
	
	.header__logo img {
		height: 170px;
		top: -85px;
	}
}
