/**
 * Custom Header & Mobile Menu Styles
 * Replaces Elementor header (post-147) and mobile popup (post-3629).
 */

/* ========== CUSTOM FONTS ========== */
@font-face {
	font-family: 'Filosofia Grand';
	font-style: normal;
	font-weight: normal;
	font-display: swap;
	src: url('/wp-content/uploads/2023/12/Filosofia-Grand.ttf') format('truetype');
}

@font-face {
	font-family: 'Filosofia Grand';
	font-style: normal;
	font-weight: bold;
	font-display: swap;
	src: url('/wp-content/uploads/2023/12/Filosofia-GrandBold.ttf') format('truetype');
}

/* ========== HEADER TOKENS ========== */
.site-header {
	--hdr-bg: #FFFFFF;
	--hdr-color-primary: #433E39;
	--hdr-color-secondary: #6F675F;
	--hdr-color-near-black: #161413;
	--hdr-color-accent: #CE9C9C;
	--hdr-color-link: #92673F;
	--hdr-shadow: 0px 1px 0px 0px rgba(210, 213, 217, 0.3);
	--hdr-font: 'Filosofia', serif;
	--hdr-font-nav: 'Filosofia Grand', serif;
}

/* ========== BODY PADDING FOR FIXED HEADER ========== */
body.has-custom-header {
	padding-top: 92px;
}

/* Admin bar offset — header pushes down, body padding stays same */
body.has-custom-header.admin-bar {
	padding-top: 92px;
}

@media (max-width: 782px) {
	body.has-custom-header.admin-bar {
		padding-top: 74px;
	}
}

@media (max-width: 767px) {
	body.has-custom-header {
		padding-top: 74px;
	}
}

/* Override Hello Elementor theme.min.css max-width constraints */
.site-header#site-header,
.site-header#site-header .header-inner {
	max-width: none !important;
	margin-left: auto;
	margin-right: auto;
}

body.has-custom-header .site-main {
	max-width: none !important;
}

/* ========== FIXED HEADER ========== */
/* Override header-footer.min.css .site-header defaults */
.site-header#site-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 1000;
	background-color: var(--hdr-bg);
	box-shadow: var(--hdr-shadow);
	padding-block-start: 0;
	padding-block-end: 0;
	padding: 0;
	flex-wrap: nowrap;
}

/* Admin bar: push header down */
body.admin-bar .site-header#site-header {
	top: 32px;
}

@media (max-width: 782px) {
	body.admin-bar .site-header#site-header {
		top: 46px;
	}
}

.header-inner {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: stretch;
	padding: 10px 5vw;
	gap: 0;
}

/* ========== BRAND (Logo + Title) ========== */
.header-brand {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 30px;
	flex-wrap: nowrap;
	width: 340px;
}

.header-logo-link {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.header-logo {
	width: 60px;
	height: auto;
}

.header-title-link {
	text-decoration: none;
}

.header-title {
	font-family: var(--hdr-font);
	font-size: 30px;
	font-weight: bold;
	line-height: 1.2em;
	letter-spacing: 15px;
	color: var(--hdr-color-primary);
	display: block;
}

/* ========== DESKTOP NAVIGATION ========== */
.header-nav-desktop {
	display: flex;
	align-items: center;
}

.header-menu {
	display: flex;
	flex-direction: row;
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 30px;
}

.header-menu li {
	position: relative;
	list-style: none;
}

.header-menu > li > a {
	font-family: var(--hdr-font-nav);
	font-size: 20px;
	font-weight: bold;
	letter-spacing: 5px;
	color: var(--hdr-color-secondary);
	text-decoration: none;
	padding: 8px 0;
	position: relative;
	display: inline-block;
	transition: color 0.3s;
}

/* Underline animation — fade in from center */
.header-menu > li > a::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 3px;
	background-color: var(--hdr-color-accent);
	transform: scaleX(0);
	transition: transform 0.3s ease, opacity 0.3s ease;
	opacity: 0;
}

.header-menu > li > a:hover::after,
.header-menu > li > a:focus::after {
	transform: scaleX(1);
	opacity: 1;
}

/* Active item underline always visible */
.header-menu > li.current-menu-item > a::after,
.header-menu > li.current_page_item > a::after {
	transform: scaleX(1);
	opacity: 1;
}

/* ========== DROPDOWN SUBMENU ========== */

/* Caret indicator for items with submenus */
.header-menu > li.menu-item-has-children > a {
	padding-right: 18px;
}

.header-menu > li.menu-item-has-children > a::before {
	content: '';
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 5px solid var(--hdr-color-secondary);
}

.header-menu li .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	background: var(--hdr-bg);
	min-width: 220px;
	padding: 10px 0;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	z-index: 1001;
	list-style: none;
	margin: 0;
}

.header-menu li:hover > .sub-menu,
.header-menu li:focus-within > .sub-menu {
	display: block;
}

.header-menu .sub-menu li a {
	display: block;
	padding: 8px 20px;
	font-family: var(--hdr-font-nav);
	font-size: 16px;
	font-weight: bold;
	letter-spacing: 3px;
	color: var(--hdr-color-secondary);
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.3s, background-color 0.3s;
}

.header-menu .sub-menu li a:hover {
	color: var(--hdr-color-near-black);
	background-color: rgba(0, 0, 0, 0.03);
}

/* ========== HAMBURGER BUTTON ========== */
/* Aggressive reset to override Elementor kit button styles */
.header-hamburger,
.header-hamburger:hover,
.header-hamburger:focus {
	display: none;
	align-items: center;
	justify-content: center;
	background: transparent !important;
	background-color: transparent !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none;
	cursor: pointer;
	padding: 4px;
	margin: 0;
	align-self: center;
	-webkit-appearance: none;
	appearance: none;
	color: inherit;
	letter-spacing: 0;
	text-transform: none;
	line-height: 1;
}

.header-hamburger svg {
	fill: var(--hdr-color-secondary);
	width: 32px;
	height: 32px;
}

/* ========== MOBILE MENU OVERLAY ========== */
.mobile-menu-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9999;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Push below admin bar when logged in */
body.admin-bar .mobile-menu-overlay {
	top: 32px;
}

@media (max-width: 782px) {
	body.admin-bar .mobile-menu-overlay {
		top: 46px;
	}
}

.mobile-menu-overlay.is-open {
	pointer-events: all;
	opacity: 1;
	visibility: visible;
}

.mobile-menu-panel {
	width: 100%;
	height: 100%;
	background: linear-gradient(180deg, #F4F3F3 0%, #DFDAD4 100%);
	box-shadow: 2px 8px 23px 3px rgba(0, 0, 0, 0.2);
	position: relative;
	overflow-y: auto;
}

.mobile-menu-overlay.is-open .mobile-menu-panel {
	animation: mobileMenuIn 0.4s ease forwards;
}

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

/* Close button — aggressive reset to strip Elementor kit button styles */
.mobile-menu-close,
.mobile-menu-close:hover,
.mobile-menu-close:focus {
	position: absolute;
	top: 20px;
	right: 20px;
	background: transparent !important;
	background-color: transparent !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none;
	cursor: pointer;
	padding: 0;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	-webkit-appearance: none;
	appearance: none;
	letter-spacing: 0;
	text-transform: none;
	line-height: 1;
	color: inherit;
}

.mobile-menu-close svg {
	fill: #6F675F;
	width: 32px;
	height: 32px;
}

/* Content */
.mobile-menu-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 40px 0;
}

.mobile-menu-logo-link {
	display: block;
	text-align: center;
	margin-bottom: 10px;
}

.mobile-menu-logo {
	width: 80px;
	height: 120px;
	object-fit: contain;
}

.mobile-menu-site-title-link {
	text-decoration: none;
	display: block;
	text-align: center;
	margin-bottom: 16px;
}

.mobile-menu-site-title {
	font-family: 'Filosofia', serif;
	font-size: 28px;
	font-weight: bold;
	line-height: 1.2em;
	letter-spacing: 7px;
	color: #433E39;
	margin: 0;
}

/* Mobile nav list — target by parent container so it works
   with both wp_nav_menu class and fallback menu class */
.mobile-menu-nav {
	width: 100%;
	text-align: center;
}

.mobile-menu-nav ul,
.mobile-menu-nav ul ul {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	flex-wrap: nowrap !important;
}

.mobile-menu-nav > ul > li {
	margin: 0 0 15px 0 !important;
	padding: 0 !important;
	list-style: none !important;
	display: block !important;
	width: auto;
	text-align: center;
}

.mobile-menu-nav li a,
.mobile-menu-nav li a:visited {
	font-family: 'Filosofia', serif;
	font-size: 24px;
	font-weight: 400;
	letter-spacing: 2.5px;
	color: #92673F;
	text-decoration: none;
	transition: color 0.3s;
	display: inline-block;
}

.mobile-menu-nav li a:hover,
.mobile-menu-nav li a:focus {
	color: #CBA824;
	background-color: transparent;
}

/* Current page — underline */
.mobile-menu-nav > ul > li.current-menu-item > a,
.mobile-menu-nav > ul > li.current_page_item > a {
	text-decoration: underline;
	text-underline-offset: 4px;
	text-decoration-color: #CE9C9C;
	text-decoration-thickness: 2px;
}

/* Services parent item — gold underline separator */
.mobile-menu-nav .menu-item-has-children > a {
	border-bottom: 1px solid #92673F;
	padding-bottom: 10px;
	cursor: default;
}

/* Sub-menu in mobile */
.mobile-menu-nav .sub-menu {
	list-style: none !important;
	margin: 0 !important;
	padding: 10px 0 0 0 !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
}

.mobile-menu-nav .sub-menu li {
	margin: 0 0 8px 0 !important;
}

.mobile-menu-nav .sub-menu li a {
	font-size: 20px;
	letter-spacing: 2px;
}

/* Social icons */
.mobile-menu-social {
	display: flex;
	flex-direction: row;
	justify-content: center;
	gap: 25px;
	margin-top: 20px;
}

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

.mobile-social-icon svg {
	fill: #6F675F;
	width: 24px;
	height: 24px;
	transition: fill 0.3s;
}

.mobile-social-icon:hover svg {
	fill: #433E39;
}

/* ========== RESPONSIVE — TABLET ========== */
@media (max-width: 1024px) {
	.header-nav-desktop {
		display: none;
	}

	.header-hamburger {
		display: flex !important;
	}
}

/* ========== RESPONSIVE — MOBILE ========== */
@media (max-width: 767px) {
	.header-inner {
		padding: 10px 3vw;
	}

	.header-brand {
		width: 220px;
		gap: 15px;
	}

	.header-logo {
		width: 45px;
	}

	.header-title {
		font-size: 22px;
		letter-spacing: 8px;
	}

	.header-hamburger svg {
		width: 28px;
		height: 28px;
	}

	/* Mobile menu adjustments */
	.mobile-menu-content {
		padding: 10px 0;
	}

	.mobile-menu-logo-link {
		margin-bottom: 20px;
	}

	.mobile-menu-logo {
		height: 80px;
	}

	.mobile-menu-site-title-link {
		width: 90%;
		padding: 0 3vw;
		margin-bottom: 10px;
	}

	.mobile-menu-site-title {
		font-size: 24px;
		line-height: 1.3em;
		letter-spacing: 5px;
	}

	.mobile-menu-nav li a {
		font-size: 20px;
		letter-spacing: 2px;
	}

	.mobile-menu-nav .sub-menu li a {
		font-size: 18px;
	}
}

/* ========== PREVENT SCROLL WHEN MENU OPEN ========== */
body.mobile-menu-open {
	overflow: hidden !important;
	position: fixed;
	width: 100%;
	height: 100%;
}