/* ==========================================================================
   IvyPanda — header.css
   Site header: logo, navigation, hamburger menu and dropdowns.
   ========================================================================== */


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

.site-header {
	background: var(--color-header-bg);
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0);
	transition:
		background-color 0.3s ease,
		box-shadow 0.3s ease,
		backdrop-filter 0.3s ease;
}

.site-header.is-scrolled {
	background: var(--color-header-bg-scrolled);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}


/* ---------- Header Layout ---------- */

.site-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: var(--header-height, 0px);
	padding: var(--header-padding, 16px) 20px;
	gap: 40px;
	flex-wrap: nowrap;
}


/* ---------- Logo / Branding ---------- */

.site-branding {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	text-align: left;
	line-height: 1.3;
	min-width: 0;
	flex-shrink: 0;
}

.site-branding a,
.site-branding .custom-logo-link {
	color: var(--color-header-text);
}

.site-title {
	font-family: var(--font-heading);
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--color-header-text);
}

.site-tagline {
	font-size: 0.8rem;
	color: var(--color-header-text);
	opacity: 0.8;
}

.custom-logo,
.site-branding img {
	max-height: 72px;
	width: auto;
	max-width: 240px;
}


/* ---------- Navigation ---------- */

.primary-nav {
	min-width: 0;
	margin-left: 0;
	flex: 1;
	display: flex;
	justify-content: center;
}

.primary-nav > ul {
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 42px;
	margin: 0;
	padding: 0;
	flex-wrap: nowrap;
}

.primary-nav li {
	position: relative;
}


/* ---------- Main Navigation Links ---------- */

.primary-nav > ul > li > a {
	color: var(--color-header-text);
	font-weight: 500;
	white-space: nowrap;
	text-decoration: none;
	opacity: 0.9;

	transition:
		opacity 0.2s ease,
		color 0.2s ease;
}


/* Underline on hover */

.primary-nav > ul > li > a:hover,
.primary-nav > ul > li > a:focus-visible {
	opacity: 1;
	text-decoration: underline;
	text-decoration-thickness: 1.5px;
	text-underline-offset: 5px;
}


/* ---------- Dropdown Arrow Button ---------- */

/*
   JavaScript creates this button beside menu items
   that contain children.

   Example:

   Services  ▼

   Clicking "Services" = Services page
   Clicking "▼" = open dropdown
*/

.dropdown-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	margin-left: 5px;
	padding: 4px;

	background: transparent;
	border: none;

	color: var(--color-header-text);

	cursor: pointer;

	line-height: 1;
	vertical-align: middle;

	opacity: 0.7;

	transition:
		opacity 0.2s ease,
		transform 0.2s ease;
}


/* Small arrow */

.dropdown-toggle::before {
	content: "";

	display: block;

	width: 6px;
	height: 6px;

	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;

	transform: rotate(45deg);

	transition: transform 0.2s ease;
}


/* Arrow hover */

.dropdown-toggle:hover,
.dropdown-toggle:focus-visible {
	opacity: 1;
	outline: none;
}


/* Rotate arrow when dropdown is open */

.menu-item-has-children.is-open > .dropdown-toggle::before {
	transform: rotate(225deg);
}


/* ---------- Desktop Dropdown ---------- */

/*
   Hidden by default.

   IMPORTANT:
   There is NO :hover rule here.

   The dropdown only appears when JavaScript adds
   .is-open to the parent menu item.
*/

.primary-nav .sub-menu {
	list-style: none;

	margin: 0;
	padding: 8px 0;

	position: absolute;

	top: calc(100% + 10px);
	left: 0;

	min-width: 210px;

	background: var(--color-surface);

	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 8px;

	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);

	display: block;

	opacity: 0;
	visibility: hidden;

	transform: translateY(-5px);

	transition:
		opacity 0.18s ease,
		transform 0.18s ease,
		visibility 0.18s ease;

	z-index: 100;
}


/* Show only when clicked */

.primary-nav li.menu-item-has-children.is-open > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}


/* ---------- Dropdown Items ---------- */

.primary-nav .sub-menu li {
	width: 100%;
}

.primary-nav .sub-menu a {
	display: block;

	padding: 8px 16px;

	color: var(--color-text);

	font-size: 0.88rem;
	font-weight: 400;

	white-space: nowrap;

	text-decoration: none;

	opacity: 1;

	transition:
		color 0.2s ease,
		text-decoration 0.2s ease;
}


/* Submenu hover = underline only, no color/background change
   (a mint-tinted or mint-colored hover state read poorly against
   this light cream dropdown, so hover is underline-only here too,
   matching the top-level nav links). */

.primary-nav .sub-menu a:hover,
.primary-nav .sub-menu a:focus-visible {
	background: transparent;

	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}


/* ---------- Remove Arrow From CSS Pseudo Element ---------- */

/*
   The arrow is now a real button created by JavaScript,
   so the old CSS arrow is no longer needed.
*/

.primary-nav li.menu-item-has-children > a::after {
	display: none;
}


/* ---------- Mobile Menu Button ---------- */

.menu-toggle {
	display: none;

	flex-direction: column;
	gap: 4px;

	background: none;
	border: none;

	cursor: pointer;

	padding: 8px;
}

.menu-toggle-bar {
	width: 24px;
	height: 2px;
	background: var(--color-header-text);
}


/* ---------- Header CTA ---------- */

.header-cta {
	display: flex;
	align-items: center;
}

.header-cta-mobile {
	display: none;
}