/**
 * Header, mega-menu (.submenu) and mobile menu overrides.
 *
 * Loaded after master.css, new-styles.css and Elementor's own CSS (see
 * kijo_header_assets() in functions.php), so it replaces the old inline
 * <style> blocks that lived in the Elementor header template.
 *
 * Breakpoints: desktop >= 1081px, mobile <= 1080px, small mobile <= 767px.
 *
 * Tweak the two variables below instead of hunting for hard-coded numbers:
 *   --kijo-header-h   height of the header bar (98px, 66px on small mobile)
 *   --app-height      real viewport height, set by navigation.js (fixes the
 *                     100vh jump caused by mobile browser toolbars)
 */

:root {
	--kijo-header-h: 98px;
	--app-height: 100%;
	--kijo-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media only screen and (max-width: 767px) {
	:root {
		--kijo-header-h: 66px;
	}
}

/* ------------------------------------------------------------------ */
/* Header bar                                                          */
/* ------------------------------------------------------------------ */

header {
	z-index: 100 !important;
}

body:not(.elementor-editor-active) header.scrolled {
	position: fixed !important;
	background-color: var(--e-global-color-primary);
	transition: background-color 0.35s linear;
	z-index: 100;
}

header .elementor-icon-wrapper {
	height: 22px;
}

/* CTA button in the header (heading widget with the "button" class) */
header .elementor-widget-heading.button a {
	font-weight: 400;
	padding: 18px 20px;
	border: 1px solid transparent;
	transition: color 0.35s linear, background-color 0.35s linear, border-color 0.35s linear;
}

header:hover .elementor-widget-heading.button a,
header.scrolled .elementor-widget-heading.button a {
	border-color: var(--e-global-color-accent);
}

header:hover .elementor-widget-heading.button a:hover {
	color: var(--e-global-color-primary) !important;
	background-color: var(--e-global-color-accent);
	border-color: var(--e-global-color-accent);
}

@media only screen and (max-width: 767px) {
	header .elementor-widget-heading.button a {
		padding: 12px 10px;
	}
}

/* Logo centred between the icons on tablet */
@media only screen and (min-width: 768px) and (max-width: 1080px) {
	header .elementor-widget-image.logo {
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
	}
}

/* ------------------------------------------------------------------ */
/* Main menu items                                                     */
/* ------------------------------------------------------------------ */

header #main_menu nav ul li.center a {
	display: block;
	margin: 20px 0;
	text-align: center;
	font-family: var(--e-global-typography-e0dcb36-font-family);
	font-size: var(--e-global-typography-e0dcb36-font-size);
	font-weight: var(--e-global-typography-e0dcb36-font-weight);
	text-transform: var(--e-global-typography-e0dcb36-text-transform);
	font-style: var(--e-global-typography-e0dcb36-font-style);
	text-decoration: var(--e-global-typography-e0dcb36-text-decoration);
	line-height: var(--e-global-typography-e0dcb36-line-height);
	color: var(--e-global-color-f0d6634) !important;
}

header #main_menu nav ul li.button a {
	position: relative;
	display: block;
	padding: 20px !important;
	border: none !important;
	border-radius: 0;
	text-align: center;
	font-family: var(--e-global-typography-d9b8830-font-family) !important;
	font-size: var(--e-global-typography-d9b8830-font-size) !important;
	font-weight: var(--e-global-typography-d9b8830-font-weight) !important;
	text-transform: var(--e-global-typography-d9b8830-text-transform) !important;
	font-style: var(--e-global-typography-d9b8830-font-style) !important;
	text-decoration: var(--e-global-typography-d9b8830-text-decoration) !important;
	line-height: var(--e-global-typography-d9b8830-line-height) !important;
	letter-spacing: var(--e-global-typography-d9b8830-letter-spacing) !important;
	word-spacing: var(--e-global-typography-d9b8830-word-spacing) !important;
	fill: var(--e-global-color-accent);
	color: var(--e-global-color-accent);
	background-color: var(--e-global-color-secondary) !important;
	transition: background-color 0.3s ease, color 0.3s ease;
}

header #main_menu nav ul li.button a:hover {
	background-color: var(--e-global-color-e390767) !important;
}

header #main_menu nav ul li ul li {
	padding: 0 0 20px 10px;
}

header #main_menu nav ul li ul li a {
	margin: 0;
	padding: 0;
	border: 0;
	text-transform: uppercase;
	color: var(--e-global-color-f0d6634) !important;
}

/* Arrow after mobile menu items */
header li.mob_arrow a:after {
	content: '';
	position: relative;
	margin-left: 10px;
	width: 16px;
	height: 16px;
	opacity: 1 !important;
	background: url(/wp-content/uploads/2024/09/mob_arrow.svg) no-repeat;
	background-size: 16px 16px;
}

/* Close button section inside a mega menu */
body:not(.elementor-editor-active) section.close {
	position: absolute;
	top: 30px;
	right: 30px;
	z-index: 100;
	width: auto;
	margin: 0;
}

/* ------------------------------------------------------------------ */
/* Mega menu (.submenu) - all sizes                                    */
/* ------------------------------------------------------------------ */

.submenu nav ul li ul li {
	display: block;
	margin-bottom: 10px;
}

.submenu nav ul li a.highlighted {
	color: var(--e-global-color-f0d6634) !important;
	fill: var(--e-global-color-f0d6634) !important;
}

.submenu nav ul li.active a {
	color: var(--e-global-color-accent) !important;
	fill: var(--e-global-color-accent) !important;
}

/* ------------------------------------------------------------------ */
/* Desktop (>= 1081px)                                                 */
/* ------------------------------------------------------------------ */

@media only screen and (min-width: 1081px) {
	header #main_menu nav ul li {
		padding-top: 0;
		padding-bottom: 0;
	}

	.submenu nav {
		min-height: auto;
	}

	.submenu nav ul li {
		width: auto !important;
	}

	/* Full-width panel under the header */
	body.logged-in:not(.elementor-editor-active) header .submenu,
	body:not(.elementor-editor-active) header .submenu,
	body:not(.elementor-editor-active) header .submenu.active {
		width: 90% !important;
		margin: 0 5% !important;
		height: calc(100vh - 218px);
		min-height: calc(100vh - 218px);
		max-height: calc(100vh - 218px);
		scrollbar-width: none;
	}

	body.logged-in:not(.elementor-editor-active) header .submenu::-webkit-scrollbar,
	body:not(.elementor-editor-active) header .submenu::-webkit-scrollbar {
		display: none;
	}

	/* Compact panel (.small), pinned to the right */
	body.logged-in:not(.elementor-editor-active) header .small.submenu,
	body:not(.elementor-editor-active) header .small.submenu,
	body:not(.elementor-editor-active) header .small.submenu.active {
		width: 260px !important;
		height: auto;
		min-height: auto;
		margin: 0 360px 0 0 !important;
		left: auto;
		right: 0;
	}

	.submenu nav ul li.current-menu-item a {
		color: var(--e-global-color-f0d6634) !important;
	}

	.submenu nav ul li.current-menu-item a.has-submenu {
		border: none !important;
	}

	header .submenu nav ul li a.has-submenu {
		width: 100%;
	}

	/* The WP sub-menu <ul>s are replaced by the "Also available" list that
	   navigation.js builds under the image, so hide the originals. */
	.elementor-nav-menu--main .elementor-nav-menu ul {
		display: none !important;
	}

	body:not(.elementor-editor-active) header .submenu .images .elementor-widget-wrap {
		height: 55vh;
	}

	header .submenu .images ul.newsubnav {
		position: absolute;
		top: calc(55vh + 50px);
		left: 0;
		z-index: 20;
		display: flex;
		flex-wrap: wrap;
		gap: 10px 30px;
		margin: 0;
		padding: 0 0 0 10px;
		list-style: none;
		opacity: 0;
		visibility: hidden;
		transform: translateY(10px);
		transition: opacity 0.35s var(--kijo-ease), transform 0.35s var(--kijo-ease), visibility 0.35s linear;
	}

	header .submenu .images ul.newsubnav.is-visible {
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	header .submenu .images ul.newsubnav::before {
		content: 'Also available:';
		position: absolute;
		top: -30px;
		left: 10px;
		font-size: var(--e-global-typography-decf7b6-font-size);
		text-transform: uppercase;
		color: #fff;
	}

	header .submenu .images ul.newsubnav li {
		position: relative;
	}

	header .submenu .images ul.newsubnav li a {
		font-family: var(--e-global-typography-e0dcb36-font-family);
		font-size: var(--e-global-typography-decf7b6-font-size);
		font-weight: var(--e-global-typography-e0dcb36-font-weight);
		font-style: var(--e-global-typography-e0dcb36-font-style);
		text-transform: var(--e-global-typography-e0dcb36-text-transform);
		text-decoration: var(--e-global-typography-e0dcb36-text-decoration);
		color: #fff;
		/* sliding underline */
		background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
		padding-bottom: 2px;
		transition: background-size 0.3s var(--kijo-ease), opacity 0.3s var(--kijo-ease);
	}

	header .submenu .images ul.newsubnav li a:hover,
	header .submenu .images ul.newsubnav li a:focus-visible {
		background-size: 100% 1px;
	}
}

/* ------------------------------------------------------------------ */
/* Mobile / tablet (<= 1080px)                                         */
/* ------------------------------------------------------------------ */

@media only screen and (max-width: 1080px) {
	header #main_menu nav ul li a {
		font-family: var(--e-global-typography-b7fd117-font-family);
		font-size: var(--e-global-typography-b7fd117-font-size);
		font-weight: var(--e-global-typography-b7fd117-font-weight);
		font-style: var(--e-global-typography-b7fd117-font-style);
		line-height: var(--e-global-typography-b7fd117-line-height);
		letter-spacing: var(--e-global-typography-b7fd117-letter-spacing);
		word-spacing: var(--e-global-typography-b7fd117-word-spacing);
	}

	/* Logged-in users: panel sits under the header bar */
	body.logged-in:not(.elementor-editor-active) header .submenu {
		top: var(--kijo-header-h);
		height: calc(100vh - var(--kijo-header-h));
	}

	body:not(.elementor-editor-active) header .submenu .images .elementor-widget-wrap {
		height: 250px;
	}

	.submenu nav ul li.menu-item-has-children ul {
		display: block !important;
		margin-left: 10px;
	}

	.submenu nav ul li:hover a,
	.submenu nav ul li.current-menu-item a {
		color: var(--e-global-color-f0d6634) !important;
	}

	.submenu nav ul li:hover > a,
	.submenu nav ul li.current-menu-item > a {
		color: var(--e-global-color-accent) !important;
	}

	.submenu nav ul li ul li a {
		color: var(--e-global-color-f0d6634) !important;
		text-transform: uppercase !important;
	}

	/* Slide-down menu (Elementor dropdown) */
	header nav.elementor-nav-menu--dropdown {
		height: calc(var(--app-height) - 98px) !important;
	}

	header .elementor-nav-menu--toggle .elementor-menu-toggle.active + .elementor-nav-menu__container {
		height: calc(var(--app-height) - 98px) !important;
		overflow-y: scroll;
	}

	header .elementor-nav-menu--toggle .elementor-menu-toggle.active + .elementor-nav-menu__container ul {
		display: block !important;
		height: auto;
	}

	header .elementor-nav-menu--toggle .elementor-menu-toggle.active + .elementor-nav-menu__container ul.elementor-nav-menu {
		display: block !important;
		height: calc(var(--app-height) - 273px);
		overflow-y: scroll;
	}
}

/* ------------------------------------------------------------------ */
/* Small mobile (<= 767px)                                             */
/* ------------------------------------------------------------------ */

@media only screen and (max-width: 767px) {
	header nav.elementor-nav-menu--dropdown {
		padding: 60px 20px 0 !important;
	}

	header .elementor-nav-menu--toggle .elementor-menu-toggle.active + .elementor-nav-menu__container {
		padding-top: 0 !important;
		max-height: calc(var(--app-height) - 66px);
		--menu-height: calc(var(--app-height) - 66px);
	}

	header .elementor-nav-menu--toggle .elementor-menu-toggle.active + .elementor-nav-menu__container ul {
		height: auto !important;
		--menu-height: auto !important;
	}

	header .elementor-nav-menu--toggle .elementor-menu-toggle.active + .elementor-nav-menu__container ul.elementor-nav-menu {
		height: 100% !important;
		padding-top: 15px;
		padding-bottom: 30px;
	}
}

/* ------------------------------------------------------------------ */
/* Transitions & hover effects                                         */
/* ------------------------------------------------------------------ */

/* Colour / opacity easing on header links and icons */
header #main_menu nav ul li a,
.submenu nav ul li a {
	transition: color 0.3s var(--kijo-ease), fill 0.3s var(--kijo-ease), opacity 0.3s var(--kijo-ease);
}

header .elementor-widget-image.logo img,
header .elementor-icon-wrapper,
header .elementor-menu-toggle {
	transition: opacity 0.3s var(--kijo-ease);
}

header .elementor-widget-image.logo:hover img,
header .elementor-icon-wrapper:hover,
header .elementor-menu-toggle:hover {
	opacity: 0.8;
}

/* Close button: icon turns a quarter on hover */
section.close .elementor-button-icon {
	transition: transform 0.35s var(--kijo-ease);
}

section.close:hover .elementor-button-icon {
	transform: rotate(90deg);
}

/* Crossfade layer created by navigation.js when the panel image changes */
body:not(.elementor-editor-active) header .submenu .images .elementor-widget-wrap {
	position: relative;
	overflow: hidden;
}

.kijo-bg-fade {
	position: absolute;
	inset: 0;
	z-index: 0;
	background-position: center center;
	background-repeat: no-repeat;
	background-size: cover;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.45s var(--kijo-ease);
}

.kijo-bg-fade.is-in {
	opacity: 1;
}

@media only screen and (min-width: 1081px) {
	/* Panel eases in: fade (existing) + a small slide down */
	body:not(.elementor-editor-active) header .submenu {
		transform: translateY(-12px);
		transition: visibility 0.35s linear, opacity 0.35s var(--kijo-ease), transform 0.35s var(--kijo-ease), z-index 0.35s linear !important;
	}

	body:not(.elementor-editor-active) header .submenu.active {
		transform: translateY(0);
		transition: visibility 0.35s linear, opacity 0.35s var(--kijo-ease), transform 0.35s var(--kijo-ease), z-index 0.35s linear !important;
	}
}

/* Mouse only: nudge + dim siblings so the hovered item stands out */
@media only screen and (min-width: 1081px) and (hover: hover) {
	.submenu nav > ul > li {
		transition: transform 0.3s var(--kijo-ease);
	}

	.submenu nav > ul > li:hover,
	.submenu nav > ul > li.active {
		transform: translateX(8px);
	}

	.submenu nav > ul:hover > li:not(:hover) > a,
	header #main_menu nav > ul:hover > li:not(:hover):not(.active) > a {
		opacity: 0.6;
	}
}

@media (prefers-reduced-motion: reduce) {
	header,
	header *,
	.submenu,
	.submenu *,
	.kijo-bg-fade {
		transition-duration: 0.01ms !important;
		transition-delay: 0s !important;
	}

	.submenu nav > ul > li:hover,
	.submenu nav > ul > li.active {
		transform: none;
	}
}
