/**
 * MN Corporate — header models & overlay menu.
 *
 * Base bar styles (.mnc-header, .mnc-nav, .mnc-header__cta) live in
 * main.css. This file adds:
 *   - dual logo cross-fade (dark / light variant)
 *   - actions row + burger
 *   - models: transparent, solid-dark, centered, overlay-burger
 *   - fullscreen overlay menu (mobile + overlay-burger model)
 *   - sub-menu dropdowns
 */

/* -------------------------------------------------------------------- */
/* Dual logo (Customizer → Site Identity → "Logo — light version")       */
/* -------------------------------------------------------------------- */

.mnc-header__brand { position: relative; }

.mnc-logo__img--dark { transition: opacity 0.3s ease; }

.mnc-logo__img--light {
	position: absolute;
	top: 0;
	left: 0;
	max-width: var(--mnc-logo-max-w, 160px);
	max-height: var(--mnc-logo-max-h, 40px);
	width: auto;
	height: auto;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

/* Light-on-dark header states → show the light logo. */
.mnc-header--transparent:not(.is-scrolled) .mnc-logo__img--dark,
.mnc-header--solid-dark .mnc-logo__img--dark,
.mnc-header--overlay-burger .mnc-logo__img--dark { opacity: 0; }

.mnc-header--transparent:not(.is-scrolled) .mnc-logo__img--light,
.mnc-header--solid-dark .mnc-logo__img--light,
.mnc-header--overlay-burger .mnc-logo__img--light { opacity: 1; }

/* -------------------------------------------------------------------- */
/* Sub-menu dropdowns (bar models, depth 2)                              */
/* -------------------------------------------------------------------- */

.mnc-nav .menu-item-has-children { position: relative; }

/* Indikator angle-down pada item level-atas yang punya submenu —
   berputar ke angle-up saat dropdown terbuka. currentColor agar ikut
   warna link (termasuk hover orange / item aktif). */
.mnc-nav > ul > li.menu-item-has-children > a { position: relative; padding-right: 14px; }

.mnc-nav > ul > li.menu-item-has-children > a::after {
	content: "";
	position: absolute;
	right: 0;
	top: 50%;
	width: 6px;
	height: 6px;
	border-right: 1.6px solid currentColor;
	border-bottom: 1.6px solid currentColor;
	transform: translateY(-65%) rotate(45deg);
	transition: transform 0.25s ease;
}

.mnc-nav > ul > li.menu-item-has-children:hover > a::after,
.mnc-nav > ul > li.menu-item-has-children:focus-within > a::after { transform: translateY(-35%) rotate(225deg); }

.mnc-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: -16px;
	z-index: 60;
	display: block;
	min-width: 264px;
	padding: 10px;
	background: var(--mnc-green);
	border-radius: var(--mnc-radius-sm);
	box-shadow: 0 18px 44px rgba(12, 36, 25, 0.35);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.mnc-nav .menu-item-has-children:hover > .sub-menu,
.mnc-nav .menu-item-has-children:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* Rich item: icon oranye + judul + deskripsi (mockup dropdown gelap). */
.mnc-nav .sub-menu a {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 11px 14px;
	color: rgba(244, 246, 244, 0.92);
	border-bottom: 0;
	border-radius: 8px;
	white-space: nowrap;
}

.mnc-nav .sub-menu a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }

.mnc-sub__icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	/* Optically centre the 22px icon on the title's first line (~18px),
	   so it sits flush with the label instead of the item's midline. */
	margin-top: -2px;
	color: var(--mnc-orange);
}

.mnc-sub__icon svg { width: 100%; height: 100%; }
.mnc-sub__icon i { font-size: 18px; }

.mnc-sub__label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mnc-sub__title { font-size: 14px; font-weight: 700; line-height: 1.3; }
.mnc-sub__desc { font-size: 11.5px; font-weight: 400; line-height: 1.35; color: rgba(244, 246, 244, 0.55); white-space: normal; }

/* -------------------------------------------------------------------- */
/* Actions row + burger                                                  */
/* -------------------------------------------------------------------- */

.mnc-header__actions {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-left: auto;
	flex-shrink: 0;
}

.mnc-nav + .mnc-header__actions { margin-left: 0; }

/* Burger as a direct child of the bar (overlay-burger model, centered
   model on mobile) still docks right. */
.mnc-header__inner > .mnc-burger { margin-left: auto; }

.mnc-burger {
	position: relative;
	z-index: 1001;
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	gap: 6px;
	width: 42px;
	height: 42px;
	padding: 10px;
	background: transparent;
	border: 1px solid currentColor;
	border-radius: 6px;
	color: inherit;
	cursor: pointer;
}

.mnc-burger span {
	display: block;
	width: 100%;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform 0.35s ease, opacity 0.25s ease;
}

body.mnc-nav-open .mnc-burger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.mnc-nav-open .mnc-burger span:nth-child(2) { opacity: 0; }
body.mnc-nav-open .mnc-burger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* -------------------------------------------------------------------- */
/* Model: transparent (fixed over hero → solid on scroll)                */
/* -------------------------------------------------------------------- */

.mnc-header--transparent {
	position: fixed;
	inset: 0 0 auto 0;
	background: transparent;
	backdrop-filter: none;
	border-bottom-color: transparent;
	color: #fff;
	transition: background-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}

.mnc-header--transparent .mnc-header__brand { color: #fff; }

.mnc-header--transparent:not(.is-scrolled) .mnc-nav a { color: rgba(255, 255, 255, 0.88); }
.mnc-header--transparent:not(.is-scrolled) .mnc-nav a:hover,
.mnc-header--transparent:not(.is-scrolled) .mnc-nav .current-menu-item > a { color: #fff; border-bottom-color: #fff; }

.mnc-header--transparent.is-scrolled {
	background: rgba(248, 247, 246, 0.94);
	backdrop-filter: blur(14px);
	border-bottom-color: var(--mnc-border);
	color: var(--mnc-text);
	box-shadow: 0 8px 28px rgba(12, 36, 25, 0.08);
}

.mnc-header--transparent.is-scrolled .mnc-header__brand { color: var(--mnc-green); }

/* -------------------------------------------------------------------- */
/* Model: solid dark green                                               */
/* -------------------------------------------------------------------- */

.mnc-header--solid-dark {
	background: var(--mnc-green);
	border-bottom-color: rgba(255, 255, 255, 0.08);
	color: #fff;
}

.mnc-header--solid-dark .mnc-header__brand { color: #fff; }
.mnc-header--solid-dark .mnc-nav a { color: rgba(255, 255, 255, 0.85); }
.mnc-header--solid-dark .mnc-nav a:hover,
.mnc-header--solid-dark .mnc-nav .current-menu-item > a { color: #fff; border-bottom-color: var(--mnc-orange); }

.mnc-header--solid-dark .mnc-nav .sub-menu { background: var(--mnc-green-soft); }
.mnc-header--solid-dark .mnc-nav .sub-menu a { color: rgba(255, 255, 255, 0.85); }
.mnc-header--solid-dark .mnc-nav .sub-menu a:hover { color: #fff; }

/* CTA on the dark bar → bordered line style. */
.mnc-header--solid-dark .mnc-header__cta {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.55);
	color: #fff;
}

.mnc-header--solid-dark .mnc-header__cta:hover {
	background: var(--mnc-orange);
	border-color: var(--mnc-orange);
	color: #fff;
}

/* -------------------------------------------------------------------- */
/* Model: centered logo, nav below                                       */
/* -------------------------------------------------------------------- */

.mnc-header--centered .mnc-header__inner {
	flex-direction: column;
	gap: 10px;
	padding-top: 22px;
	padding-bottom: 0;
}

.mnc-header--centered .mnc-nav { margin-inline: 0; width: 100%; }
.mnc-header--centered .mnc-nav > ul {
	justify-content: center;
	border-top: 1px solid var(--mnc-border);
	padding: 12px 0;
}

.mnc-header--centered .mnc-header__actions {
	position: absolute;
	top: 26px;
	right: var(--mnc-gap);
	margin-left: 0;
}

.mnc-header--centered .mnc-header__inner { position: relative; }

/* -------------------------------------------------------------------- */
/* Model: overlay burger (minimal fixed bar)                             */
/* -------------------------------------------------------------------- */

.mnc-header--overlay-burger {
	position: fixed;
	inset: 0 0 auto 0;
	background: transparent;
	backdrop-filter: none;
	border-bottom-color: transparent;
	color: #fff;
}

.mnc-header--overlay-burger .mnc-header__brand { color: #fff; }
.mnc-header--overlay-burger .mnc-header__inner { min-height: 76px; }

body.mnc-nav-open .mnc-header--overlay-burger { color: #fff; }

/* -------------------------------------------------------------------- */
/* Search toggle + expandable search bar                                 */
/* -------------------------------------------------------------------- */

.mnc-search-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 9px;
	background: transparent;
	border: 0;
	border-radius: 6px;
	color: inherit;
	cursor: pointer;
	transition: color 0.25s ease, background-color 0.25s ease;
}

.mnc-search-toggle svg { width: 100%; height: 100%; display: block; }
.mnc-search-toggle:hover { color: var(--mnc-orange); }
.mnc-header--transparent:not(.is-scrolled) .mnc-search-toggle:hover,
.mnc-header--solid-dark .mnc-search-toggle:hover,
.mnc-header--overlay-burger .mnc-search-toggle:hover { color: #fff; }

/* Search bar — solid dark strip that drops below the header and
   overlays the page content (it does not push content down). Anchored
   to the header box via top:100%, so it follows sticky/fixed headers. */
.mnc-searchbar {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 45;
	overflow: hidden;
	max-height: 0;
	opacity: 0;
	visibility: hidden;
	background: var(--mnc-green);
	border-top: 1px solid transparent;
	box-shadow: 0 18px 40px rgba(12, 36, 25, 0.25);
	color: rgba(244, 246, 244, 0.92);
	transition: max-height 0.35s ease, opacity 0.3s ease, visibility 0.35s;
}

body.mnc-search-open .mnc-searchbar {
	max-height: 96px;
	opacity: 1;
	visibility: visible;
	border-top-color: rgba(255, 255, 255, 0.1);
}

.mnc-searchbar__inner {
	display: flex;
	align-items: center;
	gap: 16px;
	padding-top: 14px;
	padding-bottom: 14px;
	transform: translateY(-10px);
	transition: transform 0.3s ease;
}

body.mnc-search-open .mnc-searchbar__inner { transform: none; }

.mnc-searchbar__icon {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	color: rgba(244, 246, 244, 0.55);
}

.mnc-searchbar__form {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
	min-width: 0;
}

.mnc-searchbar__input {
	flex: 1;
	min-width: 0;
	height: 44px;
	padding: 0 16px;
	font: inherit;
	font-size: 15px;
	color: #fff;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 6px;
}

.mnc-searchbar__input:focus {
	outline: none;
	border-color: var(--mnc-orange);
	box-shadow: 0 0 0 3px rgba(232, 100, 28, 0.25);
}

.mnc-searchbar__input::placeholder { color: rgba(244, 246, 244, 0.45); }

.mnc-searchbar__submit {
	flex: 0 0 auto;
	height: 44px;
	padding: 0 22px;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	color: #fff;
	background: var(--mnc-orange);
	border: 0;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.25s ease;
}

.mnc-searchbar__submit:hover { background: var(--mnc-orange-dark); }

.mnc-searchbar__close {
	flex: 0 0 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 9px;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 6px;
	color: rgba(244, 246, 244, 0.75);
	cursor: pointer;
	transition: color 0.25s ease, background-color 0.25s ease;
}

.mnc-searchbar__close svg { width: 100%; height: 100%; display: block; }
.mnc-searchbar__close:hover { color: var(--mnc-orange); background: rgba(255, 255, 255, 0.14); }

/* -------------------------------------------------------------------- */
/* Fullscreen overlay menu                                               */
/* -------------------------------------------------------------------- */

.mnc-header-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000;
	overflow-y: auto;
	padding: 104px 24px 40px;
	background: var(--mnc-green);
	color: #fff;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease, visibility 0.35s;
}

body.mnc-nav-open .mnc-header-overlay {
	opacity: 1;
	visibility: visible;
}

/* The bar stays above the overlay: logo, search toggle and the burger
   (morphing into an X) remain visible and usable while the menu is open. */
body.mnc-nav-open .mnc-header { z-index: 1100; }

.mnc-header-overlay ul {
	display: flex;
	flex-direction: column;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.mnc-header-overlay li.menu-item-has-children {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

.mnc-header-overlay a {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	min-height: 46px;
	padding: 10px 14px;
	font-family: var(--mnc-font-display);
	font-size: 15px;
	font-weight: 600;
	color: rgba(244, 246, 244, 0.92);
	text-decoration: none;
	border-radius: 10px;
	opacity: 0;
	transform: translateY(12px);
	transition: opacity 0.4s ease, transform 0.4s ease, color 0.25s ease, background-color 0.25s ease;
}

.mnc-header-overlay a:hover { color: var(--mnc-orange); }
.mnc-header-overlay .current-menu-item > a { color: var(--mnc-orange); }
.mnc-header-overlay li.is-open > a { background: rgba(255, 255, 255, 0.06); color: #fff; }

/* Caret button appended by MNC_Header::overlay_submenu_toggle(). */
.mnc-ovl-sub-toggle {
	flex: 0 0 44px;
	height: 46px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	border-radius: 10px;
	color: rgba(244, 246, 244, 0.7);
	cursor: pointer;
}

.mnc-ovl-sub-toggle:hover { color: #fff; }
.mnc-ovl-sub-toggle svg { width: 18px; height: 18px; transition: transform 0.3s ease; }
.mnc-header-overlay li.is-open > .mnc-ovl-sub-toggle { color: var(--mnc-orange); }
.mnc-header-overlay li.is-open > .mnc-ovl-sub-toggle svg { transform: rotate(180deg); }

/* Submenu renders as an inset card — the rich item markup (icon + label +
   description) comes from the shared MNC_Header::rich_submenu_title(). */
.mnc-header-overlay .sub-menu {
	flex-basis: 100%;
	display: none;
	margin: 4px 0 10px;
	padding: 8px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 14px;
	gap: 2px;
}

.mnc-header-overlay li.is-open > .sub-menu { display: flex; flex-direction: column; }

.mnc-header-overlay .sub-menu a {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	flex: none;
	min-height: 0;
	padding: 11px 12px;
	font-size: 14px;
	border-radius: 10px;
	opacity: 1;
	transform: none;
}

.mnc-header-overlay .sub-menu a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

body.mnc-nav-open .mnc-header-overlay > nav > ul > li > a {
	opacity: 1;
	transform: none;
}

body.mnc-nav-open .mnc-header-overlay > nav > ul > li:nth-child(1) > a { transition-delay: 0.08s; }
body.mnc-nav-open .mnc-header-overlay > nav > ul > li:nth-child(2) > a { transition-delay: 0.14s; }
body.mnc-nav-open .mnc-header-overlay > nav > ul > li:nth-child(3) > a { transition-delay: 0.2s; }
body.mnc-nav-open .mnc-header-overlay > nav > ul > li:nth-child(4) > a { transition-delay: 0.26s; }
body.mnc-nav-open .mnc-header-overlay > nav > ul > li:nth-child(5) > a { transition-delay: 0.32s; }
body.mnc-nav-open .mnc-header-overlay > nav > ul > li:nth-child(6) > a { transition-delay: 0.38s; }
body.mnc-nav-open .mnc-header-overlay > nav > ul > li:nth-child(7) > a { transition-delay: 0.44s; }
body.mnc-nav-open .mnc-header-overlay > nav > ul > li:nth-child(8) > a { transition-delay: 0.5s; }

.mnc-header-overlay__cta { margin: 28px 0 0; }

.mnc-header-overlay__cta .mnc-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 15px 24px;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 10px;
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.45s ease 0.5s, transform 0.45s ease 0.5s, background-color 0.25s ease, border-color 0.25s ease;
}

.mnc-header-overlay__cta .mnc-btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.45); color: #fff; }
body.mnc-nav-open .mnc-header-overlay__cta .mnc-btn { opacity: 1; transform: none; }

/* backdrop-filter on the bar creates a containing block for the fixed
   overlay — drop it while the menu is open so the overlay covers the
   viewport (the blur is invisible behind the overlay anyway). */
body.mnc-nav-open .mnc-header { backdrop-filter: none; }

body.mnc-nav-open { overflow: hidden; }

/* -------------------------------------------------------------------- */
/* Width variant (Customizer → Header → Header width)                    */
/* -------------------------------------------------------------------- */

.mnc-header--width-full .mnc-header__inner { max-width: none; }

/* -------------------------------------------------------------------- */
/* WordPress admin bar offset for fixed models                           */
/* -------------------------------------------------------------------- */

body.admin-bar .mnc-header--transparent,
body.admin-bar .mnc-header--overlay-burger { top: 32px; }

@media (max-width: 782px) {
	body.admin-bar .mnc-header--transparent,
	body.admin-bar .mnc-header--overlay-burger { top: 46px; }
}

/* -------------------------------------------------------------------- */
/* Responsive: bar models collapse to burger + overlay ≤ 900px           */
/* -------------------------------------------------------------------- */

@media (max-width: 900px) {
	/* Nav is display:none on mobile, but the `.mnc-nav + .mnc-header__actions`
	   sibling rule still matches hidden elements and would pin the actions
	   (search + burger) against the logo — restore the right dock here. */
	.mnc-nav + .mnc-header__actions { margin-left: auto; }

	.mnc-header--centered .mnc-header__inner {
		flex-direction: row;
		justify-content: space-between;
		padding-top: 0;
	}

	.mnc-header--centered .mnc-header__actions {
		position: static;
		margin-left: auto;
	}

	.mnc-header__cta { display: none; }
}

@media (max-width: 640px) {
	.mnc-searchbar__inner { gap: 10px; }
	.mnc-searchbar__icon { display: none; }
	.mnc-searchbar__submit { padding: 0 16px; }
}

@media (min-width: 901px) {
	.mnc-header:not(.mnc-header--overlay-burger) .mnc-burger { display: none; }
}
