/**
 * Custom site header (inc/header/header-nav.php). Hand-written to match the Next.js
 * reference — no dependency on the compiled Tailwind build. Navy/gold, sticky, an
 * 84px bar; desktop nav with hover dropdowns; a full-width mobile drawer under xl.
 */

:root {
	--kbit-hd-navy: #151c2c;
	--kbit-hd-gold: #C5A15A;
}

/* Safety net: if wpautop ever leaves an empty <p> around the header shortcode
   inside the template-part wrapper, don't let it add vertical space. */
.wp-block-template-part > p:empty,
.wp-block-template-part > p { margin: 0; }

.kbit-hd {
	position: sticky;
	top: 0;
	z-index: 50;
	color: #fff;
	background: rgba(21, 28, 44, 0.85);
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
}

.kbit-hd__bar {
	display: flex;
	height: 84px;
	align-items: center;
	gap: 0.75rem;
}

.kbit-hd__logo { display: inline-flex; flex-shrink: 0; align-items: center; }
.kbit-hd__logo img,
.kbit-hd__logo .custom-logo { height: 56px; width: auto; object-fit: contain; }

/* ---- desktop nav (shown ≥1280px) ---- */
.kbit-hd__nav { display: none; }

.kbit-hd__link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	white-space: nowrap;
	border-radius: 6px;
	padding: 0.5rem 0.625rem;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	color: rgba(255, 255, 255, 0.8);
	text-decoration: none;
	transition: background-color 0.18s ease, color 0.18s ease;
}
.kbit-hd__link:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.kbit-hd__link.is-active { color: var(--kbit-hd-gold); }
.kbit-hd__link.is-active::after {
	content: "";
	position: absolute;
	left: 0.75rem;
	right: 0.75rem;
	bottom: -0.25rem;
	height: 2px;
	border-radius: 9999px;
	background: var(--kbit-hd-gold);
}
.kbit-hd__chev { transition: transform 0.2s ease; }

.kbit-hd__item { position: relative; display: inline-flex; }

/* dropdown panel */
.kbit-hd__dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 230px;
	margin-top: 0.4rem;
	padding: 0.5rem;
	border-radius: 0.75rem;
	background: var(--kbit-hd-navy);
	border: 1px solid rgba(255, 255, 255, 0.1);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
	z-index: 20;
}
/* Menu labels can arrive wrapped in a paragraph (editor content); the theme's
   default paragraph spacing would then push the dropdown rows apart. */
.kbit-hd__dropdown p {
	margin: 0;
}
/* child combinator ">" so hovering the top item opens ONLY its direct panel,
   not the nested level-3 flyout (which has its own hover trigger below). */
.kbit-hd__item--has:hover > .kbit-hd__dropdown,
.kbit-hd__item--has:focus-within > .kbit-hd__dropdown,
.kbit-hd__item--has.is-open > .kbit-hd__dropdown {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.kbit-hd__item--has:hover > .kbit-hd__link .kbit-hd__chev,
.kbit-hd__item--has.is-open > .kbit-hd__link .kbit-hd__chev { transform: rotate(180deg); }

.kbit-hd__dd-link {
	display: block;
	padding: 0.5rem 0.7rem;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.78);
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.15s ease, color 0.15s ease;
}
.kbit-hd__dd-link:hover { background: rgba(255, 255, 255, 0.08); color: var(--kbit-hd-gold); }

/* nested (3rd-level) flyout: opens to the side of its parent dropdown item */
.kbit-hd__dd-item { position: relative; }
.kbit-hd__dd-item--has > .kbit-hd__dd-link { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.kbit-hd__dd-item--has > .kbit-hd__dd-link .kbit-hd__chev { transform: rotate(-90deg); }
.kbit-hd__dropdown--sub { top: -0.5rem; left: 100%; margin: 0 0 0 0.4rem; }
.kbit-hd__dd-item--has:hover > .kbit-hd__dropdown--sub,
.kbit-hd__dd-item--has:focus-within > .kbit-hd__dropdown--sub {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* ---- right cluster (lang + CTAs) ---- */
.kbit-hd__right { display: none; margin-left: auto; align-items: center; gap: 0.5rem; }

.kbit-hd__lang {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 4px;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.05);
}
.kbit-hd__lang-item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 28px;
	min-width: 32px;
	padding: 0 8px;
	border: 1px solid transparent;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.7);
	text-decoration: none;
	transition: color 0.15s ease;
}
.kbit-hd__lang-item:hover { color: #fff; }
.kbit-hd__lang-item.is-active {
	border-color: rgba(197, 161, 90, 0.6);
	background: var(--kbit-hd-navy);
	color: var(--kbit-hd-gold);
}

/* CTA wrapper (also shields the buttons from wpautop's stray <p>) */
.kbit-hd__cta { display: flex; align-items: center; gap: 0.5rem; }
.kbit-hd__cta--mobile { flex-direction: column; gap: 0.75rem; }

.kbit-hd__btn {
	display: inline-flex;
	height: 40px;
	align-items: center;
	justify-content: center;
	padding: 0 0.85rem;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none;
	transition: background-color 0.18s ease, color 0.18s ease;
}
.kbit-hd__btn--outline { border: 1px solid var(--kbit-hd-gold); color: var(--kbit-hd-gold); }
.kbit-hd__btn--outline:hover { background: var(--kbit-hd-gold); color: var(--kbit-hd-navy); }
.kbit-hd__btn--solid { background: var(--kbit-hd-gold); color: var(--kbit-hd-navy); font-weight: 700; }
.kbit-hd__btn--solid:hover { background: #e3c879; }

/* ---- mobile toggle + drawer (below 1280px) ---- */
.kbit-hd__toggle-slot { margin-left: auto; display: inline-flex; align-items: center; }
.kbit-hd__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 6px;
	background: transparent;
	color: #fff;
	cursor: pointer;
}

.kbit-hd__drawer { border-top: 1px solid rgba(255, 255, 255, 0.1); background: var(--kbit-hd-navy); }
.kbit-hd__drawer[hidden] { display: none; }
.kbit-hd__m-nav { display: flex; flex-direction: column; gap: 0.25rem; max-width: 40rem; margin: 0 auto; padding: 1rem 1rem 0; }

.kbit-hd__m-link {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.75rem 0.85rem;
	border: 0;
	border-radius: 6px;
	background: transparent;
	font-size: 14px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.8);
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	font-family: inherit;
}
.kbit-hd__m-link.is-active { color: var(--kbit-hd-gold); background: rgba(255, 255, 255, 0.06); }
.kbit-hd__m-link[aria-expanded="true"] { color: var(--kbit-hd-gold); }
.kbit-hd__m-link[aria-expanded="true"] .kbit-hd__chev { transform: rotate(180deg); }

.kbit-hd__m-sub { display: none; margin: 0.1rem 0.9rem 0.35rem; padding-left: 0.6rem; border-left: 1px solid rgba(255, 255, 255, 0.14); }
.kbit-hd__m-link[aria-expanded="true"] ~ .kbit-hd__m-sub { display: block; }
.kbit-hd__m-sub-link { display: block; padding: 0.5rem 0.6rem; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.66); text-decoration: none; }
.kbit-hd__m-sub-link:hover { color: #fff; }
/* nested (3rd-level) accordion toggle inside a mobile submenu */
.kbit-hd__m-link--sub { padding: 0.5rem 0.6rem; font-size: 13px; color: rgba(255, 255, 255, 0.66); }

.kbit-hd__m-extras { max-width: 40rem; margin: 0 auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.kbit-hd__lang--block { width: 100%; justify-content: center; }
.kbit-hd__m-extras .kbit-hd__btn { width: 100%; height: 44px; }

/* ---- ≥1280px: swap to the desktop layout ---- */
@media (min-width: 1280px) {
	.kbit-hd__nav { display: flex; flex: 1 1 auto; min-width: 0; align-items: center; justify-content: center; gap: 2px; }
	.kbit-hd__right { display: flex; }
	.kbit-hd__toggle-slot { display: none; }
	.kbit-hd__drawer { display: none !important; }
}

/* ===================================================================
   Event sub-header ([amlab_kbit_event_header]) — mirrors the Next.js
   reference (kbit-association-website…/k-beauty-meets-2026/*). Sticky 60px
   navy bar; inline nav+CTA on desktop, a "Menu sự kiện" toggle + inline
   drawer under 1024px. The pale congress variant lives in events-congress.css.
   =================================================================== */
.kbit-ev {
	position: sticky;
	top: 0;
	z-index: 50;
	color: #fff;
	background: rgba(21, 28, 44, 0.95);
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
}
.kbit-ev__bar { display: flex; align-items: center; gap: 0.75rem; min-height: 60px; }

/* brand: home chip + program name */
.kbit-ev__home {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 6px;
	color: rgba(255, 255, 255, 0.8);
	transition: background-color 0.18s ease, color 0.18s ease;
}
.kbit-ev__home:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.kbit-ev__brand {
	flex-shrink: 0;
	text-decoration: none;
	font-size: 13px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: #fff;
	white-space: nowrap;
}

/* desktop nav */
.kbit-ev__nav { display: none; }
.kbit-ev__link {
	position: relative;
	white-space: nowrap;
	border-radius: 6px;
	padding: 0.5rem 0.75rem;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	color: rgba(255, 255, 255, 0.75);
	text-decoration: none;
	transition: background-color 0.18s ease, color 0.18s ease;
}
.kbit-ev__link:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.kbit-ev__link.is-active { color: var(--kbit-hd-gold); }
.kbit-ev__link.is-active::after {
	content: "";
	position: absolute;
	left: 0.75rem;
	right: 0.75rem;
	bottom: -0.25rem;
	height: 2px;
	border-radius: 9999px;
	background: var(--kbit-hd-gold);
}

.kbit-ev__right { display: none; align-items: center; gap: 0.5rem; }
.kbit-ev__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 36px;
	padding: 0 16px;
	border-radius: 6px;
	background: var(--kbit-hd-gold);
	color: var(--kbit-hd-navy);
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	transition: background-color 0.18s ease;
}
.kbit-ev__cta:hover { background: #e3c879; }

/* mobile toggle + drawer */
.kbit-ev__toggle-slot { margin-left: auto; display: inline-flex; align-items: center; }
.kbit-ev__toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	height: 36px;
	padding: 0 0.75rem;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 6px;
	background: transparent;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}
.kbit-ev__toggle .kbit-hd__chev { transition: transform 0.2s ease; }
.kbit-ev__toggle[aria-expanded="true"] .kbit-hd__chev { transform: rotate(180deg); }

.kbit-ev__drawer { border-top: 1px solid rgba(255, 255, 255, 0.1); background: var(--kbit-hd-navy); }
.kbit-ev__drawer[hidden] { display: none; }
.kbit-ev__m-nav { display: flex; flex-direction: column; gap: 0.25rem; max-width: 40rem; margin: 0 auto; padding: 0.75rem 1rem 0; }
.kbit-ev__m-link {
	display: block;
	padding: 0.75rem 0.85rem;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.8);
	text-decoration: none;
}
.kbit-ev__m-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.kbit-ev__m-link.is-active { color: var(--kbit-hd-gold); background: rgba(255, 255, 255, 0.06); }
.kbit-ev__m-extras { max-width: 40rem; margin: 0 auto; padding: 0.85rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.kbit-ev__m-extras .kbit-ev__cta { width: 100%; height: 44px; }

@media (min-width: 1024px) {
	.kbit-ev__nav { display: flex; margin-left: auto; align-items: center; gap: 2px; }
	.kbit-ev__right { display: flex; }
	.kbit-ev__toggle-slot { display: none; }
	.kbit-ev__drawer { display: none !important; }
}
