/**
 * Aurevya Avada Child - Header Component
 *
 * Three-column flexbox layout with:
 * - Admin bar compatibility
 * - Multiple logo variants (standard, retina, sticky, mobile)
 * - Language dropdown (sibling-menu style)
 * - Search overlay
 * - Transparent header with gradient overlay
 */

/* ==========================================================================
   CSS Custom Properties (configurable via inline styles from PHP)
   ========================================================================== */

:root {
	/* Z-Index Hierarchy */
	--z-header: 10000;
	--z-search-overlay: 9999;
	--z-nav-panel: 9998;
	--z-nav-submenu: 9997;
	--z-nav-overlay: 9996;
	--z-dropdown: 9995;

	/* Header Heights */
	--header-height: 80px;
	--header-height-small: 60px;
	--header-height-mobile: 70px;

	/* Logo Heights (defaults, overridden by inline styles) */
	--header-logo-height: 60px;
	--header-logo-height-sticky: 45px;
	--header-logo-height-mobile: 40px;

	/* Admin Bar Heights */
	--wp-admin-bar-height: 0px;
}

/* ==========================================================================
   Admin Bar Compatibility
   ========================================================================== */

body.admin-bar {
	--wp-admin-bar-height: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar {
		--wp-admin-bar-height: 46px;
	}
}

/* Offset fixed header for admin bar */
body.admin-bar .main-header .header.-fixed {
	top: var(--wp-admin-bar-height);
}

/* Adjust slide-out menus for admin bar */
body.admin-bar .leftnavbar {
	top: calc(var(--header-height) + var(--wp-admin-bar-height));
	height: calc(100vh - var(--header-height) - var(--wp-admin-bar-height));
}

body.admin-bar .rightnavbar {
	top: var(--wp-admin-bar-height);
	height: calc(100vh - var(--wp-admin-bar-height));
	padding-top: var(--header-height);
}

body.admin-bar.-small .leftnavbar {
	top: calc(var(--header-height-small) + var(--wp-admin-bar-height));
	height: calc(100vh - var(--header-height-small) - var(--wp-admin-bar-height));
}

body.admin-bar.-small .rightnavbar {
	padding-top: var(--header-height-small);
}

/* ==========================================================================
   Main Header Container
   ========================================================================== */

.main-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	z-index: var(--z-header);
	transition: all 0.3s linear;
}

.main-header-container {
	min-height: var(--header-height);
	height: auto; /* Allow content to determine height */
	transition: all 0.3s linear;
	position: relative;
}

.main-header-container.-small {
	min-height: var(--header-height-small);
	height: auto; /* Allow content to determine height */
}

/* Header Inner - Flexbox Layout */
.main-header .header {
	position: relative;
	min-height: var(--header-height);
	height: auto; /* Allow content to determine height */
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 20px;
	background-color: var(--aurevya-navy);
	box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.3);
	transition: all 0.3s linear;
}

.main-header .header.-small {
	min-height: var(--header-height-small);
	height: auto; /* Allow content to determine height */
}

.main-header .header.-fixed {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
}

/* ==========================================================================
   Three-Column Layout
   ========================================================================== */

.header-left,
.header-right {
	flex: 1;
	display: flex;
	align-items: center;
}

.header-left {
	justify-content: flex-start;
	gap: 15px;
}

.header-center {
	flex: 0 0 auto;
	display: flex;
	justify-content: center;
	align-items: center;
}

.header-right {
	justify-content: flex-end;
	gap: 10px;
}

/* ==========================================================================
   Transparent Header (Homepage with Hero)
   ========================================================================== */

.main-header.transparent-header .main-header-container,
.main-header.transparent-header .main-header-container.-small {
	height: 0;
}

.main-header.transparent-header .header:not(.-small) {
	background: transparent;
	box-shadow: none;
}

/* Gradient Overlay Effect (::after pseudo-element) */
.main-header.transparent-header .main-header-container .header::after {
	background: repeat-x url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAACqCAQAAAAt8FYsAAAASUlEQVQoz2NkeMbAwMTAQBnBwvAfOxfMwsYlh/hHWAwnl2IWEVySxPBLUCxLkjpqO+M/BUqIkMDJIp2LU4wggUjPzAyMUC6YBQCU85aEHoC26QAAAABJRU5ErkJggg==");
	content: "";
	height: 170px;
	left: 0;
	opacity: 0;
	pointer-events: none;
	position: absolute;
	right: 0;
	top: 0;
	transition: all 0.3s linear;
	visibility: hidden;
	z-index: -1;
}

.main-header.transparent-header .header:not(.-small)::after {
	opacity: 1;
	visibility: visible;
}

/* Navbar header background gradient for transparent state */
.transparent-header .header:not(.-small) .navbar-header {
    background: none !important;
	background: linear-gradient(270deg, transparent 0, rgba(0, 0, 0, 0.4) 50px, rgba(0, 0, 0, 0.8));
}

/* ==========================================================================
   Navbar Header (Hamburger Button)
   ========================================================================== */

.navbar-header {
	display: flex;
	align-items: center;
	height: 100%;
	padding: 0 15px;
	z-index: 51;
}

/* Hamburger Menu Button */
.navbar-toggle.menu-btn {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	width: 44px;
	height: 44px;
	padding: 10px;
	background: transparent;
	border: none;
	cursor: pointer;
	z-index: calc(var(--z-nav-panel) + 1);
}

.navbar-toggle.menu-btn:focus-visible {
	outline: 2px solid var(--aurevya-gold);
	outline-offset: 2px;
}

/* Animated hamburger bars */
.navbar-toggle.menu-btn .icon-bar {
	display: block;
	width: 22px;
	height: 2px !important;
	min-height: 2px !important;
	background-color: #fff;
	transition: transform 0.3s ease, opacity 0.3s ease;
	margin: 3px 0;
}

/* Active state - X formation */
.navbar-toggle.menu-btn.-active .icon-bar.top-bar {
	transform: translateY(8px) rotate(45deg);
}

.navbar-toggle.menu-btn.-active .icon-bar.middle-bar {
	opacity: 0;
}

.navbar-toggle.menu-btn.-active .icon-bar.bottom-bar {
	transform: translateY(-8px) rotate(-45deg);
}

/* Menu text label */
.navbar-toggle.menu-btn .text-menu {
	font-size: 10px;
	color: #fff;
	margin-top: 4px;
	text-transform: lowercase;
}

/* Change text to "close" when active */
.navbar-toggle.menu-btn:not(.-active) .text-menu::after {
	content: 'menu';
}

.navbar-toggle.menu-btn.-active .text-menu::after {
	content: 'close';
}

/* Hide the static text, use ::after */
.navbar-toggle.menu-btn .text-menu {
	font-size: 0;
}

.navbar-toggle.menu-btn .text-menu::after {
	font-size: 10px;
}

/* Screen reader only text */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ==========================================================================
   Language Dropdown (Sibling-Menu Style)
   ========================================================================== */

.lang-dropdown {
	position: relative;
	z-index: 1;
}

.lang-dropdown.is-open {
	z-index: var(--z-dropdown);
}

/* Backdrop overlay */
.lang-dropdown-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.3);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	z-index: -1;
}

.lang-dropdown.is-open .lang-dropdown-backdrop {
	opacity: 1;
	visibility: visible;
}

/* Inner container */
.lang-dropdown-inner {
	position: relative;
	z-index: 1;
}

/* Trigger button */
.lang-dropdown-trigger {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	background: transparent;
	border: none;
	cursor: pointer;
	color: #fff;
	font-family: inherit;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 1px;
	transition: color 0.2s ease;
}

.lang-dropdown-trigger:hover,
.lang-dropdown-trigger:focus {
	color: var(--aurevya-gold, #b59533);
	outline: none;
}

.lang-dropdown-trigger:focus-visible {
	outline: 2px solid var(--aurevya-gold);
	outline-offset: 2px;
}

/* Chevron with rotation on open */
.lang-dropdown-chevron {
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.3s ease;
}

.lang-dropdown.is-open .lang-dropdown-chevron {
	transform: rotate(180deg);
}

/* Slide-down menu */
.lang-dropdown-menu {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	min-width: 120px;
	max-height: 0;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.95);
	border-radius: 4px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
	transition: max-height 0.3s ease, opacity 0.3s ease;
	opacity: 0;
}

.lang-dropdown.is-open .lang-dropdown-menu {
	max-height: 200px;
	opacity: 1;
}

/* Menu list */
.lang-dropdown-list {
	list-style: none;
	margin: 0;
	padding: 8px 0;
}

/* Menu items */
.lang-dropdown-item a {
	display: block;
	padding: 10px 16px;
	color: #fff;
	text-decoration: none;
	font-size: 13px;
	opacity: 0.7;
	transition: opacity 0.2s ease, background 0.2s ease;
}

.lang-dropdown-item a:hover,
.lang-dropdown-item a:focus {
	opacity: 1;
	background: rgba(255, 255, 255, 0.1);
}

.lang-dropdown-item.active a {
	opacity: 1;
	font-weight: 600;
}

/* ==========================================================================
   Logo (Centered)
   ========================================================================== */

.main-link {
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	outline: none !important;
}

.main-link:hover {
	text-decoration: none;
}

/* Logo images */
.main-link img {
	height: var(--header-logo-height);
	width: auto;
	transition: height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
	margin-top: var(--logo-margin-top, 10px);
	margin-bottom: var(--logo-margin-bottom, 10px);
	margin-left: var(--logo-margin-left, 0);
	margin-right: var(--logo-margin-right, 0);
}

/* Standard logo - visible by default on desktop */
.main-link .logo-standard {
	display: block;
}

/* Sticky logo - hidden by default */
.main-link .logo-sticky {
	display: none;
	height: var(--header-logo-height-sticky);
}

/* Mobile logo - hidden by default */
.main-link .logo-mobile {
	display: none;
	height: var(--header-logo-height-mobile);
}

/* Text fallback */
.main-link .logo-text {
	color: #fff;
	font-size: 20px;
	font-weight: 600;
}

/* Sticky/scrolled state - show sticky logo if available */
.-small .main-link .logo-standard {
	display: none;
}

.-small .main-link .logo-sticky {
	display: block;
}

/* If no sticky logo, shrink standard logo */
.-small .main-link .logo-sticky:only-child,
.-small .main-link:not(:has(.logo-sticky)) .logo-standard {
	display: block;
	height: var(--header-logo-height-sticky);
}

/* ==========================================================================
   Search Toggle Button
   ========================================================================== */

.search-toggle {
	position: relative;
}

.search-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px;
	background: transparent;
	border: none;
	cursor: pointer;
	color: #fff;
	transition: color 0.3s ease;
}

.search-btn:hover {
	color: var(--aurevya-gold, #b59533);
}

.search-btn:focus-visible {
	outline: 2px solid var(--aurevya-gold);
	outline-offset: 2px;
}

.search-btn svg {
	width: 20px;
	height: 20px;
}

/* Toggle icons */
.search-btn .icon-close {
	display: none;
}

.search-btn[aria-expanded="true"] .icon-search {
	display: none;
}

.search-btn[aria-expanded="true"] .icon-close {
	display: block;
}

/* ==========================================================================
   Search Overlay (Slides Down)
   ========================================================================== */

.search-overlay {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	max-height: 0;
	overflow: hidden;
	background-color: var(--aurevya-navy, #130429);
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	transition: max-height 0.3s ease, opacity 0.3s ease;
	opacity: 0;
	z-index: var(--z-search-overlay);
}

.search-overlay.is-open {
	max-height: 100px;
	opacity: 1;
}

.search-overlay-inner {
	padding: 15px 20px;
}

.search-form {
	display: flex;
	align-items: center;
	max-width: 600px;
	margin: 0 auto;
	border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.search-input {
	flex: 1;
	background: transparent;
	border: none;
	color: #fff;
	font-size: 16px;
	font-family: inherit;
	padding: 10px 0;
	outline: none;
}

.search-input::placeholder {
	color: rgba(255, 255, 255, 0.5);
}

.search-submit {
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 10px;
	color: #fff;
	transition: color 0.3s ease;
}

.search-submit:hover {
	color: var(--aurevya-gold, #b59533);
}

.search-submit svg {
	width: 20px;
	height: 20px;
}

/* ==========================================================================
   Member/Login Button
   ========================================================================== */

.member-toggle {
	display: flex;
	align-items: center;
}

#login-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px 15px;
	cursor: pointer;
	transition: opacity 0.3s ease;
	color: #fff;
}

#login-btn:hover {
	opacity: 0.8;
}

#login-btn:focus-visible {
	outline: 2px solid var(--aurevya-gold);
	outline-offset: 2px;
}

.member-icon {
	display: flex;
	align-items: center;
	justify-content: center;
}

.member-icon svg {
	width: 20px;
	height: 20px;
}

/* ==========================================================================
   Right Navbar (Login Dropdown Panel)
   ========================================================================== */

.rightnavbar {
	position: fixed;
	top: 0;
	right: 0;
	width: 300px;
	height: 100vh;
	background: repeat-y url("data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMCwsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/wAALCAABAAEBAREA/8QAFAABAAAAAAAAAAAAAAAAAAAACf/EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAD8AVN//2Q==") var(--aurevya-navy);
	box-shadow: -1px 1px 0 0 rgba(0, 0, 0, 0.3);
	transform: translateX(100%);
	transition: transform 0.5s ease-in-out;
	padding-top: var(--header-height);
	z-index: calc(var(--z-nav-panel) - 1);
}

.rightnavbar.-active {
	transform: translateX(0);
}

.-small .rightnavbar {
	padding-top: var(--header-height-small);
}

.rightnavbar-overflow {
	max-height: calc(100vh - var(--header-height));
	overflow: auto;
}

.-small .rightnavbar-overflow {
	max-height: calc(100vh - var(--header-height-small));
}

.rightnavbar nav {
	border-top: 1px solid #000;
}

.rightnavbar-links {
	list-style: none;
	margin: 0;
	padding: 20px 0;
}

.rightnavbar-links li {
	list-style: none;
}

.rightnavbar-link {
	display: block;
	padding: 15px 25px;
	color: #fff;
	text-decoration: none;
	font-size: 16px;
	transition: opacity 0.3s ease;
}

.rightnavbar-link:hover {
	opacity: 0.7;
	color: #fff;
}

.rightnavbar-link::after {
	content: '';
	display: inline-block;
	width: 8px;
	height: 8px;
	border-right: 2px solid #fff;
	border-top: 2px solid #fff;
	transform: rotate(45deg);
	margin-left: 10px;
	transition: transform 0.3s ease;
}

.rightnavbar-link:hover::after {
	transform: translateX(5px) rotate(45deg);
}

.rightnavbar-closer {
	color: #9c938c;
	cursor: pointer;
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-size: 1rem;
	left: 0;
	padding: 28px 50px 28px 25px;
	position: absolute;
	top: 0;
}

.-small .rightnavbar-closer {
	padding-bottom: 18px;
	padding-top: 18px;
}

/* ==========================================================================
   Navigation Overlay
   ========================================================================== */

.aurevya-nav-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	z-index: var(--z-nav-overlay);
}

.aurevya-nav-overlay.-active {
	opacity: 1;
	visibility: visible;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
	:root {
		--header-height: var(--header-height-mobile);
	}

	.main-header-container,
	.main-header-container.-small {
		height: var(--header-height-mobile);
	}

	.main-header .header,
	.main-header .header.-small {
		height: var(--header-height-mobile);
		padding: 0 15px;
	}

	/* Hide standard and sticky logos on mobile */
	.main-link .logo-standard,
	.main-link .logo-sticky {
		display: none !important;
	}

	/* Show mobile logo */
	.main-link .logo-mobile {
		display: block !important;
	}

	/* Hide language dropdown on very small screens */
	.lang-dropdown {
		display: none;
	}

	/* Right navbar full width on mobile */
	.rightnavbar {
		width: 100%;
	}

	/* Adjust gap in header sections */
	.header-left {
		gap: 10px;
	}

	.header-right {
		gap: 5px;
	}
}

@media (max-width: 480px) {
	.main-header .header {
		padding: 0 10px;
	}
}

/* ==========================================================================
   Bootstrap-like Utility Classes
   ========================================================================== */

.d-none {
	display: none !important;
}

@media (min-width: 768px) {
	.d-md-block {
		display: block !important;
	}
}

.clear {
	clear: both;
}

/* ==========================================================================
   Screen Reader Only
   ========================================================================== */

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}
