/**
 * Header Layout: Sticky Slide Down
 *
 * All styles for the Sticky Slide Down header system (Ghost Header architecture).
 * Extracted from style.css — Atomic CSS refactor per v7.0 modular architecture.
 *
 * Loaded conditionally via celeste_enqueue_layout_assets() in functions.php —
 * only enqueued when this layout is the active header for the current page.
 *
 * @package Celeste_Theme
 * @since   2.2.0
 */

/* ==========================================================================
   HEADER STYLES (Dual-Header Ghost System v7.0)
   ========================================================================== */

/* Base Header Styles (Shared by Both Headers) */
.site-header {
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 1000;
	padding-top: 60px;
	padding-bottom: 30px;
}

/* Hero Header (Absolute - Scrolls with Page) */
.site-header--hero {
	position: absolute;
	background-color: var(--bg-header);
}

/* Ghost Header (Fixed - Slides In/Out) */
.site-header--ghost {
	position: fixed;
	background-color: var(--bg-header-sticky);
	color: var(--text-header-sticky);
	padding-top: 40px;
	padding-bottom: 30px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	transform: translateY(-100%);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ghost Header - Visible State */
.site-header--ghost.is-visible {
	transform: translateY(0);
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* Ghost Header - Hidden State (Scrolling Down) */
.site-header--ghost.is-hidden {
	transform: translateY(-100%);
	opacity: 1;
	visibility: visible;
}

/* Ghost Header - Fading Out (Returning to Top) */
.site-header--ghost.is-fading {
	transform: translateY(-100%);
	opacity: 0;
	pointer-events: none;
	visibility: hidden;
}

/* Ghost Header CTA Styling */
.site-header--ghost .header-cta {
	color: var(--text-header-sticky);
	border-color: var(--text-header-sticky);
}

/* NOTE: Ghost hover styles are dynamically generated in dynamic-css.php
   based on the selected animation style to prevent conflicts */

/* Ghost Header Burger Icon */
.site-header--ghost .burger-icon span {
	background-color: var(--text-header-sticky);
}

/* Header Inner Wrapper */
.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

/* Desktop Header */
.header-desktop {
	display: none;
	width: 100%;
	align-items: center;
	justify-content: space-between;
}
.header-mobile {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: flex-end;
}

@media (min-width: 1080px) {
	.header-desktop {
		display: flex; /* Show Desktop Header */
	}
	.header-mobile {
		display: none!important; /* Hide Mobile Header */
	}
}

/* Logo Styling */
.site-logo {
	height: 48px;
	display: flex;
	align-items: center;
	margin-right: 48px;
}

.site-logo a {
	display: flex;
	height: 100%;
	align-items: center;
}

.site-logo img {
	height: 100%;
	width: auto;
	object-fit: contain;
}

/* Navigation */
.main-navigation {
	display: flex;
	align-items: center;
	gap: 24px;
	flex: 1;
	justify-content: flex-end;
}

.primary-menu {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 24px;
	align-items: center;
	flex-wrap: wrap;
}

.primary-menu > li {
	position: relative;
}

.primary-menu > li > a {
	font-family: var(--font-nav, var(--font-modern));
	font-weight: var(--weight-nav-default, 500);
	font-size: var(--size-header-desktop, 16px);
	text-decoration: none;
	color: currentColor;
	transition: font-weight 0.3s ease, text-shadow 0.3s ease;
	text-shadow: none;
	display: block;
	padding: 8px 0;
	text-transform: uppercase;
}

.primary-menu > li > a:hover,
.primary-menu > li.current-menu-item > a,
.primary-menu .sub-menu > li > a:hover,
.primary-menu .sub-menu > li.current-menu-item > a,
.primary-menu .sub-menu .sub-menu > li.current-menu-item > a,
.primary-menu .sub-menu .sub-menu .sub-menu > li > a:hover,
.primary-menu .sub-menu .sub-menu .sub-menu > li.current-menu-item > a,
.primary-menu .sub-menu .sub-menu .sub-menu .sub-menu > li > a:hover,
.primary-menu .sub-menu .sub-menu .sub-menu .sub-menu > li.current-menu-item > a
 {
	/* font-weight: var(--weight-nav-hover, 700); */
	text-shadow: 1.2px 0.3px 0 currentColor;
}



/* Sub-Menu Styling */
.primary-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	background-color: var(--color-submenu-bg, #f8f7f2);
	border: var(--submenu-border-width, 1px) solid var(--color-submenu-border, #000);
	border-radius: var(--submenu-radius, 12px);
	min-width: 220px;
	padding: 10px 0;
	list-style: none;
	margin: 0;
	display: none;
	opacity: 0;
	transform: translateY(-10px);
	transition: opacity 0.3s ease, transform 0.3s ease;
	z-index: 100;
}

.primary-menu .sub-menu.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.primary-menu .sub-menu li {
	position: relative;
}

.primary-menu .sub-menu a {
	display: block;
	padding: 13px 20px;
	font-size: var(--size-submenu, 14px);
	color: var(--color-submenu-text, #000);
	text-decoration: none;
	text-transform: uppercase;
	position: relative;
	padding-bottom: 5px;
}

/* Nested Sub-Menus (Level 2 & 3) */
.primary-menu .sub-menu .sub-menu {
	top: 0;
	left: 100%;
	margin-left: 5px;
	transform: translateX(-10px);
}

.primary-menu .sub-menu .sub-menu.flip-left {
	left: auto;
	right: 100%;
	margin-left: 0;
	margin-right: 5px;
	transform: translateX(10px);
}

.primary-menu .sub-menu .sub-menu.is-visible {
	transform: translateX(0);
}

/* Header CTA Button */
.header-cta {
	font-family: var(--font-ui);
	font-weight: 700;
	font-size: 14px;
	text-transform: uppercase;
	text-decoration: none;
	padding: 12px 24px;
	border: 2px solid currentColor;
	border-radius: 50px;
	background-color: transparent;
	color: currentColor;
	transition: all 0.3s ease;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* NOTE: Hover styles are dynamically generated in dynamic-css.php
   based on the selected animation style to prevent conflicts */

/* Header Skin Classes (Hero Header Only) */
.site-header--hero.skin--light {
	color: #FCF3DE;
}

.site-header--hero.skin--dark {
	color: #1a1a1a;
}

/* Mobile Header */
.header-mobile {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: flex-end;
}

.site-logo-mobile {
	height: 32px;
	display: flex;
	align-items: center;
	margin-right: auto;
}

.site-logo-mobile a {
	display: flex;
	height: 100%;
	align-items: center;
}

.site-logo-mobile img {
	height: 100%;
	width: auto;
	object-fit: contain;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.burger-icon {
	display: flex;
	flex-direction: column;
	gap: 5px;
	width: 24px;
}

.burger-icon span {
	display: block;
	width: 100%;
	height: 2px;
	background-color: #f8f7f2;
	transition: all 0.3s ease;
}
.site-header.skin--dark .burger-icon span {
	background-color: #1a1a1a;
}

/* Burger icon for ghost header is now handled in the Ghost Header section above */


/* Mobile Flyout */
.mobile-flyout {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: var(--bg-flyout-menu, #1a1a1a);
	z-index: 2000;
	visibility: hidden;
	transition: opacity 0.4s ease, visibility 0.4s ease;
	padding: 96px 40px 94px;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
	overflow-y: auto;
	transform: translateX(100%); /* Start completely off-screen to the right */
    transition: transform 0.6s cubic-bezier(0.25, 0.6, 0.25, 1), visibility 0s linear 0.4s;
    visibility: hidden; /* Hide from screen readers/clicks when closed */
    will-change: transform;
}

body.flyout-active .mobile-flyout {
	visibility: visible;
	transform: translateX(0);
    visibility: visible;
    transition: transform 0.6s cubic-bezier(0.25, 0.6, 0.25, 1), visibility 0s linear 0s;
}

.flyout-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 40px;
	min-height: 37px;
}

.flyout-logo {
	height: 37px;
	display: flex;
	align-items: center;
	max-width: 400px;
}

.flyout-logo img {
	height: 100%;
	width: 100%;
	object-fit: contain;
}

.flyout-close {
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
	color: var(--color-flyout-menu-close-button, #FCF3DE);
}

.close-icon {
	display: block;
	width: 24px;
	height: 24px;
}

.close-icon svg {
	width: 100%;
	height: 100%;
}

/* Flyout Body */
.flyout-body {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	flex: 1;
}

.flyout-navigation {
	display: flex;
	margin-bottom: 68px;
}

.mobile-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mobile-menu > li {
	margin-bottom: 32px;
}

.mobile-menu a {
	font-size: var(--size-menu-mobile, 24px);
	font-family: var(--font-nav, var(--font-modern));
	font-weight: var(--weight-nav-default, 400);
	color: var(--color-flyout-menu-text, #FCF3DE);
	text-decoration: none;
	text-transform: uppercase;
}
.mobile-menu a:hover, 
.mobile-menu a:focus,
.mobile-menu > li > a:hover,
.mobile-menu > li.current-menu-item > a
 {
	font-weight: var(--weight-nav-hover, 700);
}

.flyout-cta {
	font-family: var(--font-ui);
	font-weight: 700;
	font-size: 16px;
	text-transform: uppercase;
	text-decoration: none;
	padding: 16px 32px;
	border: 2px solid var(--color-flyout-menu-button-border, #FCF3DE);
	border-radius: 50px;
	background-color: var(--color-flyout-menu-button-bg, transparent);
	color: var(--color-flyout-menu-button-text, #FCF3DE);
	text-align: center;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: flex-start;
	margin-bottom: 36px;
	transition: all 0.3s ease;
}

/* NOTE: Flyout CTA hover styles are dynamically generated in dynamic-css.php
   based on the selected animation style to prevent conflicts */

/* MOBILE MENU SUB-MENU */

/* Reset Desktop Styles */
.mobile-menu .sub-menu {
	display: none;
	position: static !important;
	opacity: 1 !important;
	visibility: visible !important;
	transform: none !important;
	box-shadow: none;
	border: none;
	padding-left: 20px;
	margin-top: 10px;
	background-color: transparent;
}

/* Active State (Triggered by JS) */
.mobile-menu .menu-item-has-children.active > .sub-menu {
	display: block;
	animation: fadeIn 0.3s ease;
}

.mobile-menu .sub-menu li {
	margin-bottom: 12px;
}

.mobile-menu .sub-menu a {
	font-size: 18px;
	font-weight: 400;
	color: var(--color-flyout-menu-text, #FCF3DE);
}

.mobile-menu .menu-item-has-children > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu .menu-item-has-children > a::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-right: 3px solid currentColor;
    border-bottom: 3px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.3s ease;
    margin-left: 25px;
}
.mobile-menu .menu-item-has-children.active > a::after {
    transform: translateY(-2px) rotate(225deg);
}

@keyframes fadeIn {
	from { opacity: 0; transform: translateY(-5px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Flyout Social Icons */
.flyout-social {
	display: flex;
	gap: 12px;
	align-items: center;
}

.flyout-social a {
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #000;
	transition: color 0.3s ease;
}

.flyout-social a:hover {
	color: #e30613;
}

.flyout-social svg {
	width: 100%;
	height: 100%;
}

/* Mobile Responsive */
@media (max-width: 1023px) {
	.site-header {
		padding-top: 38px;
		padding-bottom: 30px;
	}
}

/* MENU INDICATORS */

/* Main Menu (Level 1) - Down Chevron */
.primary-menu > .menu-item-has-children > a {
    display: flex;
    align-items: center;
    gap: 6px;
}

.primary-menu > .menu-item-has-children > a::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    margin-top: -2px;
    transition: transform 0.3s ease;
}

.primary-menu > .menu-item-has-children:hover > a::after {
    transform: rotate(225deg) translate(-1px, -1px);
}

/* Sub-Menus (Level 2 & 3) - Right Chevron */
.primary-menu .sub-menu .menu-item-has-children > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.primary-menu .sub-menu .menu-item-has-children > a::after {
    content: '';
    display: block;
    width: 5px;
    height: 5px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform:translatex(-20px)  rotate(45deg) ;
    margin-left: 10px;
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.primary-menu .sub-menu .menu-item-has-children:hover > a::after {
	opacity: 1;
	transform: translateX(0)  rotate(45deg);
}

/* ==========================================================================
   404 OVERRIDE — Dark Header Mode
   Migrated from style.css 404 section; header-specific context belongs here.
   ========================================================================== */

/* Dark Mode for 404 Editorial Fallback
   Forces dark header styling when fallback is displayed */
body.error-404-dark .site-header--hero {
	background-color: var(--bg-header-sticky, #000);
	color: var(--text-header-sticky, #fff);
}

body.error-404-dark .site-header--hero a {
	color: var(--text-header-sticky, #fff);
}
