/* ==========================================================================
   KPCM Global Mega-Menu Header
   ========================================================================== */

:root {
	--kpcm-header-height: 100px;
	--kpcm-expanded-height: 350px;
	--kpcm-inner-width: 1560px;
	--kpcm-brown: #442b17;
	--kpcm-burgundy: #714a4d;
	--kpcm-divider: #e1d9da;
	--kpcm-white: #ffffff;
	--kpcm-transition: 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.kpcm-header *,
.kpcm-header *::before,
.kpcm-header *::after {
	box-sizing: border-box;
}


/* ==========================================================================
   Header
   ========================================================================== */

.kpcm-header {
	position: relative;
	width: 100%;
	height: var(--kpcm-header-height);
	color: var(--kpcm-brown);
	font-family: "Montserrat", "Pretendard Variable", sans-serif;
	overflow: visible;
	z-index: 9999;
}

.kpcm-header--overlay {
	position: absolute;
	top: 0;
	left: 0;
	background: transparent;
}

.kpcm-header--solid {
	position: sticky;
	top: 0;
	background: var(--kpcm-white);
	transform: translateY(0);
	transition: transform 0.35s ease;
	will-change: transform;
}

.kpcm-header--solid.kpcm-header--hidden {
	pointer-events: none;
	transform: translateY(-100%);
}

/* Remove the 100px sticky offset after the header slides away. */

.kpcm-subpage-title {
	transition: top 0.35s ease;
}

html.kpcm-header-is-hidden .kpcm-subpage-title {
	top: 0 !important;
}

.kpcm-header__inner {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: calc(100% - 60px);
	max-width: var(--kpcm-inner-width);
	height: var(--kpcm-header-height);
	margin: 0 auto;
	z-index: 3;
}


/* Full-width divider visible only when open */

.kpcm-header__inner::after {
	position: absolute;
	right: 50%;
	bottom: 0;
	width: 100vw;
	height: 1px;
	background: var(--kpcm-divider);
	content: "";
	opacity: 0;
	pointer-events: none;
	transform: translateX(50%);
	transition: opacity 0.3s ease;
}

.kpcm-header.mega-open .kpcm-header__inner::after {
	opacity: 1;
}


/* ==========================================================================
   Animated mega-menu background
   ========================================================================== */

.kpcm-mega-background {
	position: absolute;
	top: 0;
	left: 50%;
	width: 100vw;
	height: 0;
	background: rgba(255, 255, 255, 0.9);
	overflow: hidden;
	pointer-events: none;
	transform: translateX(-50%);
	transition: height var(--kpcm-transition);
	z-index: 1;
}

.kpcm-header.mega-open .kpcm-mega-background {
	height: var(--kpcm-expanded-height);
}


/* ==========================================================================
   Logo
   ========================================================================== */

.kpcm-header__brand {
	position: relative;
	display: flex;
	align-items: center;
	flex: 0 0 240px;
	height: 100%;
	z-index: 4;
}

.kpcm-logo {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

.kpcm-logo img {
	display: block;
	width: auto;
	height: 78px;
	max-width: 220px;
	object-fit: contain;
}


/* ==========================================================================
   Main navigation
   ========================================================================== */

.kpcm-navigation {
	height: 100%;
}

.kpcm-menu {
	display: flex;
	align-items: stretch;
	height: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}

.kpcm-menu > li {
	position: relative;
	display: block;
	width: 190px;
	height: var(--kpcm-header-height);
	margin: 0;
	padding: 0;
	list-style: none;
}


/* Animated burgundy column */

.kpcm-menu > li::before {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 0;
	background: var(--kpcm-burgundy);
	content: "";
	overflow: hidden;
	pointer-events: none;
	transition: height var(--kpcm-transition);
	z-index: 1;
}

.kpcm-header.mega-open .kpcm-menu > li:hover::before,
.kpcm-header.mega-open .kpcm-menu > li:focus-within::before {
	height: var(--kpcm-expanded-height);
}


/* Main links */

.kpcm-menu > li > a {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: var(--kpcm-header-height);
	padding: 0 10px;
	color: var(--kpcm-brown);
	font-size: 17px;
	font-weight: 500;
	line-height: 1.25;
	text-align: center;
	text-decoration: none;
	white-space: normal;
	transition: color 0.3s ease;
	z-index: 3;
}

.kpcm-menu > li:hover > a,
.kpcm-menu > li:focus-within > a {
	color: var(--kpcm-white);
}


/* ==========================================================================
   Submenus
   ========================================================================== */

.kpcm-menu > li > .sub-menu {
	position: absolute;
	top: var(--kpcm-header-height);
	left: 0;
	display: block;
	width: 100%;
	margin: 0;
	padding: 12px 0 0;
	background: transparent;
	border: 0;
	box-shadow: none;
	list-style: none;
	opacity: 0;
	pointer-events: none;
	transform: translateY(10px);
	visibility: hidden;
	transition:
		opacity 0.35s ease 0.08s,
		transform 0.35s ease 0.08s,
		visibility 0.35s ease 0.08s;
	z-index: 3;
}

.kpcm-header.mega-open .kpcm-menu > li > .sub-menu {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
	visibility: visible;
}

.kpcm-menu > li > .sub-menu > li {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}

.kpcm-menu > li > .sub-menu > li > a {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 58px;
	padding: 8px 10px;
	color: var(--kpcm-brown);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.25;
	text-align: center;
	text-decoration: none;
	transition: color 0.25s ease;
	z-index: 3;
}


/* Submenu text becomes white inside active column */

.kpcm-header.mega-open
	.kpcm-menu > li:hover > .sub-menu > li > a,
.kpcm-header.mega-open
	.kpcm-menu > li:focus-within > .sub-menu > li > a {
	color: var(--kpcm-white);
}


/* Hovered submenu item returns to the default brown */

.kpcm-header.mega-open
	.kpcm-menu > li:hover > .sub-menu > li > a:hover,
.kpcm-header.mega-open
	.kpcm-menu > li:focus-within > .sub-menu > li > a:focus {
	color: var(--kpcm-brown);
}


/* Prevent Astra submenu indicators and inherited styles */

.kpcm-menu .ast-menu-toggle,
.kpcm-menu .dropdown-menu-toggle {
	display: none !important;
}

.kpcm-menu .sub-menu {
	border-radius: 0;
}


/* ==========================================================================
   Cross and close control
   ========================================================================== */

.kpcm-header__actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex: 0 0 70px;
	height: 100%;
	z-index: 4;
}

.kpcm-menu-toggle {
	position: relative;
	display: block;
	width: 42px;
	min-width: 42px;
	height: 42px;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 2px solid var(--kpcm-brown);
	border-radius: 50%;
	box-shadow: none;
	color: var(--kpcm-brown);
	cursor: pointer;
	transition:
		border-color 0.3s ease,
		color 0.3s ease,
		transform 0.3s ease;
}

.kpcm-menu-toggle:hover,
.kpcm-menu-toggle:focus {
	background: transparent;
	border-color: var(--kpcm-brown);
	color: var(--kpcm-brown);
	outline: none;
	transform: scale(1.04);
}

.kpcm-cross-horizontal,
.kpcm-cross-vertical {
	position: absolute;
	top: 50%;
	left: 50%;
	display: block;
	background: currentColor;
	transform-origin: center;
	transition:
		width 0.3s ease,
		height 0.3s ease,
		transform 0.3s ease;
}

.kpcm-cross-horizontal {
	width: 22px;
	height: 2px;
	transform: translate(-50%, -50%);
}

.kpcm-cross-vertical {
	width: 2px;
	height: 27px;
	transform: translate(-50%, -44%);
}


/* Cross changes into an X */

.kpcm-header.mega-open .kpcm-cross-horizontal {
	width: 24px;
	transform: translate(-50%, -50%) rotate(45deg);
}

.kpcm-header.mega-open .kpcm-cross-vertical {
	width: 2px;
	height: 24px;
	transform: translate(-50%, -50%) rotate(45deg);
}


/* ==========================================================================
   WordPress admin bar
   ========================================================================== */

.admin-bar .kpcm-header--overlay {
	top: 32px;
}

.admin-bar .kpcm-header--solid {
	top: 32px;
}


/* ==========================================================================
   Smaller desktop and tablet
   ========================================================================== */

@media (max-width: 1500px) {

	.kpcm-header__brand {
		flex-basis: 210px;
	}

	.kpcm-menu > li {
		width: 165px;
	}

	.kpcm-menu > li > a {
		font-size: 15px;
	}

	.kpcm-header__actions {
		flex-basis: 55px;
	}
}

@media (max-width: 1279px) {

	.kpcm-header__inner {
		width: calc(100% - 40px);
	}

	.kpcm-header__brand {
		flex-basis: 185px;
	}

	.kpcm-logo img {
		height: 65px;
		max-width: 175px;
	}

	.kpcm-menu > li {
		width: 140px;
	}

	.kpcm-menu > li > a {
		padding: 0 6px;
		font-size: 14px;
	}

	.kpcm-menu > li > .sub-menu > li > a {
		font-size: 13px;
	}
}

@media (max-width: 1100px) {

	.kpcm-header__inner {
		width: calc(100% - 36px);
	}

	.kpcm-navigation {
		position: absolute;
		top: var(--kpcm-header-height);
		right: 18px;
		left: 18px;
		height: auto;
		max-height: calc(100vh - var(--kpcm-header-height) - 20px);
		background: transparent;
		overflow-y: auto;
		opacity: 0;
		pointer-events: none;
		transform: translateY(-10px);
		visibility: hidden;
		transition:
			opacity 0.3s ease,
			transform 0.3s ease,
			visibility 0.3s ease;
	}

	.kpcm-header.mega-open .kpcm-navigation {
		opacity: 1;
		pointer-events: auto;
		transform: translateY(0);
		visibility: visible;
	}

	.kpcm-menu {
		display: block;
		height: auto;
		padding: 20px;
	}

	.kpcm-menu > li {
		width: 100%;
		height: auto;
		border-bottom: 1px solid var(--kpcm-divider);
	}

	.kpcm-menu > li::before {
		display: none;
	}

	.kpcm-menu > li > a {
		justify-content: flex-start;
		height: 58px;
		padding: 0 10px;
		color: var(--kpcm-brown);
		text-align: left;
	}

	.kpcm-menu > li:hover > a,
	.kpcm-menu > li:focus-within > a {
		color: var(--kpcm-burgundy);
	}

	.kpcm-menu > li > .sub-menu {
		position: static;
		display: block;
		padding: 0 0 14px 20px;
		opacity: 1;
		pointer-events: auto;
		transform: none;
		visibility: visible;
	}

	.kpcm-menu > li > .sub-menu > li > a {
		justify-content: flex-start;
		min-height: 42px;
		padding: 5px 10px;
		color: var(--kpcm-brown) !important;
		text-align: left;
	}

	.kpcm-mega-background {
		background: rgba(255, 255, 255, 0.96);
	}

	.kpcm-header.mega-open .kpcm-mega-background {
		height: 100vh;
	}
}

@media (max-width: 782px) {

	.admin-bar .kpcm-header--overlay {
		top: 46px;
	}

	.admin-bar .kpcm-header--solid {
		top: 46px;
	}
}

/* ==========================================================================
   Bilingual menu labels
   ========================================================================== */

.kpcm-menu-label {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	text-align: center;
}

.kpcm-menu-label__english,
.kpcm-menu-label__korean {
	display: block;
	white-space: nowrap;
}

.kpcm-menu > li > a .kpcm-menu-label__english {
	font-family: "Montserrat", sans-serif;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	text-transform: uppercase;
}

.kpcm-menu > li > a .kpcm-menu-label__korean {
	margin-top: 2px;
	font-family: "Pretendard Variable", sans-serif;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
}

.kpcm-menu > li > .sub-menu > li > a .kpcm-menu-label__english {
	font-family: "Montserrat", sans-serif;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	text-transform: uppercase;
}

.kpcm-menu > li > .sub-menu > li > a .kpcm-menu-label__korean {
	margin-top: 2px;
	font-family: "Pretendard Variable", sans-serif;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
}


/* Christian cross proportions */

.kpcm-cross-horizontal {
	top: calc(50% - 3px);
}

.kpcm-header.mega-open .kpcm-cross-horizontal {
	top: 50%;
}


/* Mobile alignment */

@media (max-width: 1100px) {

	.kpcm-menu-label {
		align-items: flex-start;
		text-align: left;
	}
}

/* Homepage header: normal closed state */

.kpcm-header--overlay:not(.mega-open) {
	color: #ffffff;
}

.kpcm-header--overlay:not(.mega-open)
	.kpcm-menu > li > a {
	color: #ffffff;
}

.kpcm-header--overlay:not(.mega-open)
	.kpcm-menu-toggle {
	color: #ffffff;
	border-color: #ffffff;
}

.kpcm-header--overlay:not(.mega-open)
	.kpcm-menu-toggle:hover,
.kpcm-header--overlay:not(.mega-open)
	.kpcm-menu-toggle:focus {
	color: #ffffff;
	border-color: #ffffff;
}

/* Prevent closed mobile menu links from remaining clickable */

@media (max-width: 1100px) {

	.kpcm-header:not(.mega-open) .kpcm-navigation {
		opacity: 0 !important;
		visibility: hidden !important;
		pointer-events: none !important;
		z-index: -1;
	}

	.kpcm-header:not(.mega-open) .kpcm-navigation *,
	.kpcm-header:not(.mega-open) .kpcm-menu,
	.kpcm-header:not(.mega-open) .sub-menu,
	.kpcm-header:not(.mega-open) .sub-menu * {
		pointer-events: none !important;
	}

	.kpcm-header.mega-open .kpcm-navigation {
		visibility: visible !important;
		pointer-events: auto !important;
		z-index: 2;
	}

	.kpcm-header.mega-open .kpcm-navigation *,
	.kpcm-header.mega-open .kpcm-menu,
	.kpcm-header.mega-open .sub-menu,
	.kpcm-header.mega-open .sub-menu * {
		pointer-events: auto;
	}
}


/* ==========================================================================
   Mobile accordion menu with easing
   ========================================================================== */

@media (max-width: 1100px) {

	/*
	 * Keep SNB menus rendered so their height and movement can animate.
	 */
	.kpcm-header .kpcm-menu > li > .sub-menu {
		display: block !important;
		max-height: 0;
		margin: 0;
		padding: 0 0 0 20px;
		overflow: hidden;
		opacity: 0;
		visibility: hidden;
		pointer-events: none !important;
		transform: translateY(-10px);
		transition:
			max-height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
			padding 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
			opacity 0.3s ease,
			transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
			visibility 0s linear 0.5s;
	}

	/*
	 * Expand the selected SNB.
	 */
	.kpcm-header
		.kpcm-menu > li.mobile-submenu-open > .sub-menu {
		max-height: 500px;
		padding: 4px 0 18px 20px;
		opacity: 1;
		visibility: visible;
		pointer-events: auto !important;
		transform: translateY(0);
		transition:
			max-height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
			padding 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
			opacity 0.3s ease 0.08s,
			transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
			visibility 0s;
	}

	/*
	 * Individual SNB items slide downward into position.
	 */
	.kpcm-header
		.kpcm-menu > li > .sub-menu > li {
		opacity: 0;
		transform: translateY(-10px);
		transition:
			opacity 0.3s ease,
			transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	}

	.kpcm-header
		.kpcm-menu > li.mobile-submenu-open
		> .sub-menu
		> li {
		opacity: 1;
		transform: translateY(0);
	}

	/*
	 * Slight stagger between submenu items.
	 */
	.kpcm-header
		.kpcm-menu > li.mobile-submenu-open
		> .sub-menu
		> li:nth-child(1) {
		transition-delay: 0.06s;
	}

	.kpcm-header
		.kpcm-menu > li.mobile-submenu-open
		> .sub-menu
		> li:nth-child(2) {
		transition-delay: 0.11s;
	}

	.kpcm-header
		.kpcm-menu > li.mobile-submenu-open
		> .sub-menu
		> li:nth-child(3) {
		transition-delay: 0.16s;
	}

	.kpcm-header
		.kpcm-menu > li.mobile-submenu-open
		> .sub-menu
		> li:nth-child(4) {
		transition-delay: 0.21s;
	}

	.kpcm-header
		.kpcm-menu > li.mobile-submenu-open
		> .sub-menu
		> li:nth-child(5) {
		transition-delay: 0.26s;
	}

	/*
	 * Selected GNB styling.
	 */
	.kpcm-menu > li.mobile-submenu-open > a {
		color: var(--kpcm-burgundy);
	}

	/*
	 * SNB link spacing.
	 */
	.kpcm-menu
		> li.mobile-submenu-open
		> .sub-menu
		> li
		> a {
		min-height: 48px;
		padding: 7px 10px;
	}
}

/* Remove click focus outline from header menu items */

.kpcm-header a:focus:not(:focus-visible),
.kpcm-header button:focus:not(:focus-visible) {
	outline: none !important;
	box-shadow: none !important;
}

/* Preserve accessible keyboard focus */

.kpcm-header a:focus-visible,
.kpcm-header button:focus-visible {
	outline: 2px solid rgba(113, 74, 77, 0.65);
	outline-offset: 3px;
	box-shadow: none;
}
