/**
 * Header base styles.
 */

.site-header,
.hg-header {
	background: var(--hga-color-header-bg);
	color: var(--hga-color-header-text);
	position: relative;
	z-index: 100;
}

.hg-header-has-border .hg-header {
	border-bottom: 1px solid var(--hga-color-border);
}

.hg-header-shadow--subtle .hg-header {
	box-shadow: var(--hga-shadow-sm);
}

.hg-header-shadow--medium .hg-header {
	box-shadow: var(--hga-shadow-md);
}

body.hg-header-sticky .hg-header {
	position: sticky;
	top: 0;
}

body.admin-bar.hg-header-sticky .hg-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar.hg-header-sticky .hg-header {
		top: 46px;
	}

	body.hg-header-sticky:not(.hg-header-sticky-mobile) .hg-header {
		position: relative;
		top: auto;
	}
}

.hg-header__inner,
.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--hga-space-md);
	min-height: var(--hga-header-height);
	padding-block: 0.65rem;
}

.hg-header__inner--full {
	width: 100%;
	padding-inline: var(--hga-space-md);
}

.hg-header__branding .custom-logo-link,
.site-branding .custom-logo-link {
	display: inline-flex;
	align-items: center;
	line-height: 0;
}

.hg-header__branding .custom-logo,
.site-branding .custom-logo {
	display: block;
	width: auto;
	height: auto;
	max-width: min(150px, 40vw);
	max-height: var(--hga-logo-height-mobile, 46px);
	object-fit: contain;
}

@media (min-width: 640px) {
	.hg-header__branding .custom-logo,
	.site-branding .custom-logo {
		max-width: min(180px, 36vw);
		max-height: var(--hga-logo-height-tablet, 44px);
	}
}

@media (min-width: 1025px) {
	.hg-header__branding .custom-logo,
	.site-branding .custom-logo {
		max-width: none;
		max-height: var(--hga-logo-height-desktop, 48px);
	}
}

.site-title {
	margin: 0;
	font-size: 1.25rem;
	font-family: var(--hga-font-heading);
}

.site-title a {
	color: var(--hga-color-header-text);
	text-decoration: none;
}

.site-description {
	margin: 0;
	font-size: var(--hga-font-size-sm);
	color: var(--hga-color-muted);
}

.hg-header__nav .menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.15rem 1.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.hg-header__nav a {
	color: var(--hga-color-nav-link);
	text-decoration: none;
	font-weight: 600;
	padding: 0.45rem 0;
	display: inline-flex;
	min-height: 44px;
	align-items: center;
}

.hg-header__nav a:hover,
.hg-header__nav a:focus-visible {
	color: var(--hga-color-nav-hover);
}

.hg-header__nav .current-menu-item > a,
.hg-header__nav .current_page_item > a {
	color: var(--hga-color-nav-active);
}

.hg-header__actions {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	flex-shrink: 0;
	min-width: 0;
}

/* Account control */
.hga-account-control {
	position: relative;
	flex-shrink: 1;
	min-width: 0;
}

.hga-account-control__toggle,
.hga-account-control__signin {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 44px;
	max-width: 100%;
	padding: 0.35rem 0.65rem;
	border: 1px solid var(--hga-color-border);
	border-radius: var(--hga-radius-sm);
	background: var(--hga-color-surface);
	color: inherit;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	box-sizing: border-box;
}

.hga-account-control__toggle:hover,
.hga-account-control__toggle:focus-visible,
.hga-account-control__signin:hover,
.hga-account-control__signin:focus-visible {
	border-color: var(--hga-color-primary);
	color: var(--hga-color-primary);
	outline: none;
	box-shadow: 0 0 0 2px rgba(13, 110, 110, 0.2);
}

.hga-account-control__avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	overflow: hidden;
	background: rgba(13, 110, 110, 0.08);
	color: var(--hga-color-primary);
}

.hga-account-control__avatar-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.hga-account-control__avatar-fallback {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.hga-account-control__icon {
	width: 32px;
	height: 32px;
}

.hga-account-control__text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
	text-align: left;
}

.hga-account-control__name {
	max-width: 10rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hga-account-control__role {
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--hga-color-muted);
	line-height: 1.2;
}

.hga-account-control__name-short {
	display: none;
}

.hga-account-control__chevron {
	flex-shrink: 0;
	transition: transform var(--hga-transition);
}

.hga-account-control.is-open .hga-account-control__chevron {
	transform: rotate(180deg);
}

.hga-account-control__menu {
	position: absolute;
	right: 0;
	top: calc(100% + 0.35rem);
	z-index: 140;
	min-width: 14rem;
	max-width: min(18rem, calc(100vw - 1.5rem));
	background: var(--hga-color-surface);
	border: 1px solid var(--hga-color-border);
	border-radius: var(--hga-radius-sm);
	box-shadow: var(--hga-shadow-md);
	padding: 0.35rem 0;
}

.hga-account-control__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.hga-account-control__link {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 0.55rem 1rem;
	color: inherit;
	text-decoration: none;
	font-weight: 600;
}

.hga-account-control__link:hover,
.hga-account-control__link:focus-visible {
	background: rgba(13, 110, 110, 0.08);
	color: var(--hga-color-primary);
	outline: none;
}

.hga-account-control__item.is-logout {
	border-top: 1px solid var(--hga-color-border);
	margin-top: 0.25rem;
	padding-top: 0.25rem;
}

.hg-header__search-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	border-radius: var(--hga-radius-sm);
}

.hg-header__search {
	position: absolute;
	right: var(--hga-space-md);
	top: calc(100% + 0.35rem);
	background: var(--hga-color-surface);
	border: 1px solid var(--hga-color-border);
	border-radius: var(--hga-radius-md);
	padding: var(--hga-space-sm);
	box-shadow: var(--hga-shadow-md);
	z-index: 120;
	min-width: min(20rem, calc(100vw - 2rem));
}

.menu-toggle,
.hga-mobile-menu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 5px;
	width: 44px;
	min-width: 44px;
	height: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--hga-radius-sm);
	background: transparent;
	color: inherit;
	cursor: pointer;
	flex-shrink: 0;
}

.menu-toggle:focus-visible,
.hga-mobile-menu-toggle:focus-visible {
	outline: 2px solid var(--hga-color-primary, currentColor);
	outline-offset: 2px;
}

.menu-toggle__icon,
.hga-mobile-menu-toggle__icon {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 22px;
}

.menu-toggle__bar {
	display: block;
	width: 100%;
	height: 2px;
	border-radius: 999px;
	background: currentColor;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.hga-mobile-menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.hga-mobile-menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(2) {
	opacity: 0;
}

.hga-mobile-menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

.hg-submenu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	margin-left: auto;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	flex-shrink: 0;
}

@media (min-width: 1025px) {
	.hg-submenu-toggle {
		display: none;
	}
}

html {
	scroll-padding-top: calc(var(--hga-header-height) + 1rem);
}

body.admin-bar {
	scroll-padding-top: calc(var(--hga-header-height) + 32px + 1rem);
}



/* Topbar */
.hg-topbar {
	background: var(--hga-color-topbar-bg);
	color: var(--hga-color-topbar-text);
	font-size: var(--hga-font-size-sm);
}

.hg-topbar__inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem 1rem;
	padding-block: 0.4rem;
}

.hg-topbar a {
	color: var(--hga-color-topbar-link);
	text-decoration: none;
}

.hg-topbar a:hover,
.hg-topbar a:focus-visible {
	color: var(--hga-color-topbar-link-hover);
}

.hg-topbar__left,
.hg-topbar__right {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
}

.hg-topbar .hga-social-links {
	display: flex;
	gap: 0.75rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Mobile navigation base — switch below desktop (≤1024px) */
@media (max-width: 1024px) {
	.hg-header,
	.site-header {
		position: relative;
	}

	.hg-header__inner,
	.site-header__inner,
	.hg-header__inner--split {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
		gap: 0.5rem;
		position: relative;
	}

	.hg-header__branding,
	.site-branding {
		min-width: 0;
	}

	.hg-header__actions {
		justify-self: end;
		gap: 0.35rem;
	}

	.hg-header__cta {
		display: none;
	}

	.hg-header__nav,
	.hga-mobile-navigation {
		display: none;
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		width: 100%;
		max-width: 100vw;
		box-sizing: border-box;
		background: var(--hga-color-header-bg);
		border-bottom: 1px solid var(--hga-color-border);
		padding: var(--hga-space-sm) var(--hga-space-md) var(--hga-space-md);
		box-shadow: var(--hga-shadow-md);
		z-index: 150;
	}

	.hg-header__nav.is-open,
	.hga-mobile-navigation.is-open {
		display: block;
	}

	.hg-header__nav[hidden],
	.hga-mobile-navigation[hidden] {
		display: none !important;
	}

	.hg-header__nav.is-open[hidden],
	.hga-mobile-navigation.is-open[hidden] {
		display: block !important;
	}

	.hga-mobile-navigation__search {
		display: none;
		margin-bottom: 0.75rem;
		padding-bottom: 0.75rem;
		border-bottom: 1px solid var(--hga-color-border);
	}

	.hg-header__nav .menu {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.hg-header__nav .menu > li {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		border-bottom: 1px solid var(--hga-color-border);
	}

	.hg-header__nav .menu > li > a {
		flex: 1;
		min-height: 44px;
		padding: 0.85rem 0.25rem;
	}

	.hg-header__nav .sub-menu {
		list-style: none;
		margin: 0;
		padding-left: 1rem;
		width: 100%;
		display: none;
	}

	.hg-header__nav .menu-item-has-children.is-submenu-open > .sub-menu {
		display: block;
	}

	.hga-account-control__role {
		display: none;
	}

	.hga-account-control__name {
		max-width: 6.5rem;
	}

	.hga-account-control__name-short {
		display: none;
	}

	.hga-account-control__avatar {
		width: 34px;
		height: 34px;
	}

	.hga-account-control__toggle,
	.hga-account-control__signin {
		padding: 0.35rem 0.5rem;
		max-width: 100%;
	}
}

@media (max-width: 480px) {
	.hga-account-control__name,
	.hga-account-control__role,
	.hga-account-control__text {
		display: none;
	}

	.hga-account-control__chevron {
		display: none;
	}

	.hga-account-control__toggle,
	.hga-account-control__signin {
		padding: 0.25rem;
		min-width: 44px;
		justify-content: center;
	}
}

@media (max-width: 412px) {
	.hg-header__search-toggle {
		display: none;
	}

	.hga-mobile-navigation.is-open .hga-mobile-navigation__search {
		display: block;
	}
}

html.hg-nav-open,
body.hg-nav-open {
	overflow-x: hidden;
}

@media (min-width: 1025px) {
	.menu-toggle,
	.hga-mobile-menu-toggle {
		display: none;
	}

	.hga-mobile-navigation__search {
		display: none !important;
	}

	.hg-header__nav,
	.hga-mobile-navigation {
		display: block;
		position: static;
		width: auto;
		max-width: none;
		border: 0;
		padding: 0;
		box-shadow: none;
		background: transparent;
	}

	.hg-header__nav[hidden],
	.hga-mobile-navigation[hidden] {
		display: block !important;
	}

	.hg-header__nav .sub-menu {
		position: absolute;
		left: 0;
		top: 100%;
		min-width: 12rem;
		background: var(--hga-color-surface);
		border: 1px solid var(--hga-color-border);
		border-radius: var(--hga-radius-sm);
		padding: 0.35rem 0;
		list-style: none;
		margin: 0;
		opacity: 0;
		visibility: hidden;
		transform: translateY(0.25rem);
		transition: opacity var(--hga-transition), visibility var(--hga-transition), transform var(--hga-transition);
		z-index: 130;
	}

	.hg-header__nav .menu-item-has-children {
		position: relative;
	}

	.hg-header__nav .menu-item-has-children:hover > .sub-menu,
	.hg-header__nav .menu-item-has-children:focus-within > .sub-menu,
	.hg-header__nav .menu-item-has-children.is-submenu-open > .sub-menu {
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.hg-header__nav .sub-menu a {
		display: block;
		padding: 0.55rem 1rem;
		min-height: 44px;
	}
}

/* Transparent header */
body.hg-header-transparent .hg-header {
	position: absolute;
	left: 0;
	right: 0;
	background: transparent;
	border-bottom-color: transparent;
	box-shadow: none;
	color: var(--hga-color-transparent-text);
}

body.hg-header-transparent .hg-header .site-title a,
body.hg-header-transparent .hg-header__nav a,
body.hg-header-transparent .hg-header__account,
body.hg-header-transparent .hg-header__search-toggle {
	color: var(--hga-color-transparent-nav);
}

body.hg-header-transparent.hg-header-sticky .hg-header.is-solid,
body.hg-header-transparent .hg-header.is-solid {
	position: sticky;
	background: var(--hga-color-header-bg);
	color: var(--hga-color-header-text);
	border-bottom: 1px solid var(--hga-color-border);
}

body.hg-header-transparent .hg-header.is-solid .site-title a,
body.hg-header-transparent .hg-header.is-solid .hg-header__nav a,
body.hg-header-transparent .hg-header.is-solid .hg-header__account,
body.hg-header-transparent .hg-header.is-solid .hg-header__search-toggle {
	color: var(--hga-color-nav-link);
}

body.hg-header-transparent.hg-has-flush-hero .hga-hero {
	padding-top: calc(var(--hga-space-xxl) + var(--hga-header-height));
}
