/**
 * GamesVTV Header
 * @package GamesVTV
 */

/* Header shell */
.gv-header {
	position: sticky;
	top: 0;
	z-index: var(--gv-z-header);
	height: var(--gv-header-height);
	background: rgba(8, 12, 22, 0.75);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
	transition:
		height var(--gv-duration-header) var(--gv-ease),
		box-shadow var(--gv-duration-header) var(--gv-ease),
		border-color var(--gv-duration-header) var(--gv-ease),
		background var(--gv-duration-header) var(--gv-ease);
}

html:not([data-theme="dark"]) .gv-header {
	background: var(--gv-header-bg);
	border-bottom-color: var(--gv-border);
}

.gv-header[data-scrolled="true"] {
	height: var(--gv-header-compact);
	box-shadow: var(--gv-shadow-header);
	border-bottom-color: var(--gv-border);
}

.gv-header__inner {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 1.5rem;
	height: 100%;
}

.gv-header__start {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-width: 0;
}

.gv-header__brand {
	min-width: 0;
}

.gv-site-logo {
	display: inline-flex;
	align-items: center;
	line-height: 0;
	color: inherit;
}

.gv-site-logo:hover {
	opacity: 0.92;
	color: inherit;
}

.gv-site-logo__image {
	display: block;
	width: auto;
	height: auto;
	max-height: 44px;
	max-width: min(220px, 42vw);
	object-fit: contain;
	transition: max-height var(--gv-duration-header) var(--gv-ease), max-width var(--gv-duration-header) var(--gv-ease);
}

.gv-header[data-scrolled="true"] .gv-site-logo--header .gv-site-logo__image {
	max-height: 36px;
	max-width: min(190px, 38vw);
}

.gv-header__logo img,
.gv-header__logo .custom-logo {
	max-height: 40px;
	width: auto;
	display: block;
	transition: max-height var(--gv-duration-header) var(--gv-ease);
}

.gv-header[data-scrolled="true"] .gv-header__logo img,
.gv-header[data-scrolled="true"] .gv-header__logo .custom-logo {
	max-height: 34px;
}

.gv-header__logo-text {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	color: var(--gv-text-primary);
	font-family: var(--gv-font-display);
	font-weight: 700;
	line-height: 1;
}

.gv-header__logo-text:hover {
	color: var(--gv-text-primary);
}

.gv-header__logo-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: var(--gv-radius-sm);
	background: var(--gv-accent);
	color: var(--gv-text-primary);
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.04em;
}

.gv-header__logo-name {
	font-size: 1.05rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 12rem;
}

/* Desktop navigation */
.gv-header__nav {
	display: none;
	justify-content: center;
	min-width: 0;
}

.gv-header__menu {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.gv-header__menu > li,
.gv-header__item {
	position: relative;
}

.gv-header__menu a,
.gv-header__parent {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.55rem 0.85rem;
	border-radius: var(--gv-radius-sm);
	font-family: var(--gv-font-display);
	font-size: var(--gv-text-small);
	font-weight: 600;
	color: var(--gv-text-secondary);
	background: transparent;
	transition:
		color 300ms var(--gv-ease),
		background 300ms var(--gv-ease);
}

.gv-header__menu > li > a::after {
	content: '';
	position: absolute;
	left: 0.85rem;
	right: 0.85rem;
	bottom: 0.35rem;
	height: 2px;
	border-radius: var(--gv-radius-full);
	background: var(--gv-accent);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 300ms var(--gv-ease);
}

.gv-header__item--has-children > .gv-header__parent::after,
.gv-header__menu .menu-item-has-children > a::after {
	content: '';
	display: block;
	position: static;
	width: 0.45rem;
	height: 0.45rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	background: none;
	border-radius: 0;
	transform: rotate(45deg) translateY(-1px);
	opacity: 0.7;
	flex-shrink: 0;
}

.gv-header__menu > li:not(.menu-item-has-children) > a:hover::after,
.gv-header__item:not(.gv-header__item--has-children) > a:hover::after,
.gv-header__menu .current-menu-item:not(.menu-item-has-children) > a::after,
.gv-header__menu .current_page_item:not(.menu-item-has-children) > a::after {
	transform: scaleX(1);
}

.gv-header__menu a:hover,
.gv-header__parent:hover,
.gv-header__menu .current-menu-item > a,
.gv-header__menu .current_page_item > a {
	color: var(--gv-text-primary);
	background: transparent;
}

.gv-header__submenu,
.gv-header__menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 12rem;
	margin: 0;
	padding: 0.5rem;
	padding-top: 0.65rem;
	list-style: none;
	background: var(--gv-card-bg);
	border: 1px solid var(--gv-border);
	border-radius: var(--gv-radius-sm);
	box-shadow: var(--gv-shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition:
		opacity 250ms var(--gv-ease),
		transform 250ms var(--gv-ease),
		visibility 250ms var(--gv-ease);
	z-index: calc(var(--gv-z-header) + 1);
}

[data-theme="dark"] .gv-header__submenu,
[data-theme="dark"] .gv-header__menu .sub-menu {
	background: rgba(8, 12, 22, 0.94);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border-color: rgba(255, 255, 255, 0.08);
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.gv-header__submenu::before,
.gv-header__menu .sub-menu::before {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 0.65rem;
	transform: translateY(-100%);
}

.gv-header__item--has-children:hover > .gv-header__submenu,
.gv-header__menu .menu-item-has-children:hover > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.gv-header__submenu a,
.gv-header__menu .sub-menu a {
	display: block;
	width: 100%;
	padding: 0.65rem 0.85rem;
	border-radius: calc(var(--gv-radius-sm) - 2px);
	font-family: var(--gv-font-sans);
	font-weight: 500;
}

.gv-header__submenu a::after,
.gv-header__menu .sub-menu a::after {
	display: none;
}

.gv-header__submenu a:hover,
.gv-header__menu .sub-menu a:hover {
	color: var(--gv-text-primary);
	background: var(--gv-bg-secondary);
}

/* Header actions */
.gv-header__actions {
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.gv-header__action,
.gv-header__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 0;
	border-radius: var(--gv-radius-full);
	background: transparent;
	color: var(--gv-text-secondary);
	cursor: pointer;
	transition:
		color var(--gv-duration-fast) var(--gv-ease),
		background var(--gv-duration-fast) var(--gv-ease),
		transform var(--gv-duration-fast) var(--gv-ease);
}

.gv-header__action:hover,
.gv-header__toggle:hover {
	color: var(--gv-text-primary);
	background: var(--gv-bg-secondary);
}

.gv-header__toggle {
	display: inline-flex;
}

.gv-header__action--theme .gv-icon-sun {
	display: none;
}

[data-theme="dark"] .gv-header__action--theme .gv-icon-moon {
	display: none;
}

[data-theme="dark"] .gv-header__action--theme .gv-icon-sun {
	display: block;
}

/* Search overlay */
.gv-search-overlay {
	position: fixed;
	inset: 0;
	z-index: var(--gv-z-overlay);
}

.gv-search-overlay[hidden] {
	display: none;
}

.gv-search-overlay__backdrop {
	position: absolute;
	inset: 0;
	background: var(--gv-overlay-backdrop);
	backdrop-filter: blur(4px);
}

.gv-search-overlay__panel {
	position: relative;
	display: flex;
	align-items: center;
	gap: 1rem;
	max-width: 720px;
	margin: 6rem auto 0;
	padding: 0 1.5rem;
	animation: gv-search-in var(--gv-duration) var(--gv-ease);
}

.gv-search-overlay__form {
	flex: 1;
	display: flex;
	gap: 0.75rem;
}

.gv-search-overlay__input {
	flex: 1;
	height: 3.25rem;
	padding: 0 1.25rem;
	border: 1px solid var(--gv-border);
	border-radius: var(--gv-radius);
	background: var(--gv-card-bg);
	color: var(--gv-text-primary);
	font-size: 1rem;
	box-shadow: var(--gv-shadow);
}

.gv-search-overlay__input:focus {
	outline: 2px solid var(--gv-accent-ring);
	outline-offset: 2px;
}

.gv-search-overlay__submit {
	height: 3.25rem;
	padding: 0 1.25rem;
	border: 0;
	border-radius: var(--gv-radius);
	background: var(--gv-accent);
	color: var(--gv-text-primary);
	font-size: var(--gv-text-small);
	font-weight: 700;
	cursor: pointer;
	transition: background var(--gv-duration-fast) var(--gv-ease);
}

.gv-search-overlay__submit:hover {
	background: var(--gv-accent-hover);
}

.gv-search-overlay__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border: 0;
	border-radius: var(--gv-radius-full);
	background: var(--gv-card-bg);
	color: var(--gv-text-primary);
	cursor: pointer;
	box-shadow: var(--gv-shadow);
}

/* Mobile nav */
.gv-mobile-nav {
	position: fixed;
	inset: 0;
	z-index: calc(var(--gv-z-overlay) + 1);
}

.gv-mobile-nav[hidden] {
	display: none;
}

.gv-mobile-nav__backdrop {
	position: absolute;
	inset: 0;
	background: var(--gv-overlay-backdrop);
}

.gv-mobile-nav__panel {
	position: absolute;
	top: 0;
	left: 0;
	width: min(88vw, 320px);
	height: 100%;
	background: var(--gv-card-bg);
	box-shadow: var(--gv-shadow-lg);
	padding: 1rem 1rem 2rem;
	overflow-y: auto;
	animation: gv-drawer-in var(--gv-duration) var(--gv-ease);
}

.gv-mobile-nav__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--gv-border);
}

.gv-mobile-nav__title {
	font-family: var(--gv-font-display);
	font-size: 1rem;
	font-weight: 700;
}

.gv-mobile-nav__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border: 0;
	border-radius: var(--gv-radius-full);
	background: var(--gv-bg-secondary);
	color: var(--gv-text-primary);
	cursor: pointer;
}

.gv-mobile-nav__list,
.gv-mobile-nav__sublist {
	list-style: none;
	margin: 0;
	padding: 0;
}

.gv-mobile-nav__link {
	display: block;
	padding: 0.85rem 0.5rem;
	font-size: 1rem;
	font-weight: 600;
	color: var(--gv-text-primary);
}

.gv-mobile-nav__sublist {
	padding-left: 0.75rem;
	margin-bottom: 0.5rem;
}

.gv-mobile-nav__sublist a {
	display: block;
	padding: 0.55rem 0.5rem;
	font-size: var(--gv-text-small);
	color: var(--gv-text-secondary);
}

.gv-mobile-nav__sublist a:hover,
.gv-mobile-nav__link:hover {
	color: var(--gv-accent);
}

/* Body lock */
.gv-nav-open,
.gv-search-open {
	overflow: hidden;
}

@keyframes gv-search-in {
	from {
		opacity: 0;
		transform: translateY(-12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes gv-drawer-in {
	from {
		transform: translateX(-100%);
	}
	to {
		transform: translateX(0);
	}
}

@media (min-width: 1024px) {
	.gv-header__nav {
		display: flex;
	}

	.gv-header__toggle {
		display: none;
	}

	.gv-header__logo-name {
		max-width: none;
	}
}

@media (max-width: 1023px) {
	.gv-header__inner {
		grid-template-columns: 1fr auto;
	}

	.gv-header__nav {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gv-search-overlay__panel,
	.gv-mobile-nav__panel {
		animation: none;
	}
}
