/*
 * Header Styles (ARIAWELL_THEME 기반)
 * PC / MOBILE 스타일 완전 동일하게 적용
 * 
 * 반응형 브레이크포인트:
 * - PC: 1280px 이상
 * - 태블릿: 768px ~ 1279px
 * - 모바일: 768px 미만
 */

/* ========================================
   Header Base
   ======================================== */

.site-header {
	position: relative;
	width: 100%;
	background-color: #fff;
	z-index: 1000;
	transition: all 0.3s ease;
}

.header-inner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	margin: 0 auto;
	padding: 0 80px;
}

/* ========================================
   Site Branding (Logo)
   ======================================== */

.site-branding {
	flex-shrink: 0;
}

.custom-logo-link {
	display: block;
	position: relative;
	text-decoration: none;
	line-height: 0;
}

.custom-logo {
	width: 100%;
	height: auto;
	max-height: 60px;
	transition: opacity 0.3s ease;
}

.custom-logo:hover {
	opacity: 0.8;
}

.site-title {
	margin: 0;
	font-size: 24px;
	font-weight: 700;
	color: #333;
	text-decoration: none;
}

.site-title a {
	color: inherit;
	text-decoration: none;
	transition: opacity 0.3s ease;
}

.site-title a:hover {
	opacity: 0.8;
}

.site-description {
	margin: 5px 0 0;
	font-size: 14px;
	color: #666;
	font-weight: 400;
}

/* ========================================
   Navigation Wrapper (네비게이션 + CTA 그룹)
   ======================================== */

.header-nav-wrapper {
	display: flex;
	align-items: center;
	gap: 60px;
}

/* ========================================
   Navigation
   ======================================== */

.main-navigation {
	display: flex;
	align-items: center;
}

.main-navigation .nav-menu {
	display: flex;
	list-style: none;
	gap: 68px;
	margin: 0;
	padding: 0;
}

.main-navigation .nav-menu li {
	position: relative;
}

/* PC 메뉴 링크 스타일 (ARIAWELL_THEME 동일) */
.main-navigation .nav-menu > li > a {
	display: flex;
	padding: 40px 0;
	font-weight: 600;
	font-size: 17px;
	color: #000;
	text-decoration: none;
	transition: color 0.3s ease;
}

/* ========================================
   서브메뉴 (드롭다운) - ARIAWELL_THEME 방식
   ======================================== */

/* 1단계 서브메뉴 */
.main-navigation .nav-menu .menu-item-has-children > .sub-menu {
	position: absolute;
	min-width: 200px;
	padding: 28px 0 8px;
	margin: 0;
	list-style: none;
	z-index: 1001;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: all 0.3s ease;
	top: 100%;
	left: -20px;
}

/* 서브메뉴 배경 (::before) */
.main-navigation .nav-menu .sub-menu::before {
	content: '';
	position: absolute;
	top: 20px;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #fff;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	border-radius: 4px;
	z-index: -1;
}

/* 마우스 오버 시 서브메뉴 표시 */
.main-navigation .nav-menu .menu-item-has-children:hover > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* 서브메뉴 아이템 */
.main-navigation .nav-menu .sub-menu li {
	position: relative;
}

.main-navigation .nav-menu .sub-menu a {
	display: block;
	padding: 12px 20px;
	font-size: 15px;
	font-weight: 500;
	color: #333;
	text-decoration: none;
	transition: all 0.3s ease;
	white-space: nowrap;
}

.main-navigation .nav-menu .sub-menu a:hover {
	background-color: #f8f9fa;
	color: #000;
}

/* 2단계 이상 서브메뉴 (우측으로 펼침) */
.main-navigation .nav-menu .sub-menu .menu-item-has-children > .sub-menu {
	position: absolute;
	min-width: 200px;
	padding: 28px 20px 8px 0;
	margin: 0;
	list-style: none;
	z-index: 1002;
	opacity: 0;
	visibility: hidden;
	transform: translateX(10px);
	transition: all 0.3s ease;
	top: 0;
	right: 100%;
	left: auto;
	margin-right: 0;
}

.main-navigation .nav-menu .sub-menu .sub-menu::before {
	width: calc(100% - 20px);
}

.main-navigation .nav-menu .sub-menu .menu-item-has-children:hover > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateX(0);
}

/* 마지막 메뉴 아이템의 서브메뉴는 우측 정렬 */
.main-navigation .nav-menu > .menu-item-has-children:last-child > .sub-menu {
	right: -20px;
	left: auto;
}

/* ========================================
   CTA 버튼
   ======================================== */

.header-cta {
	flex-shrink: 0;
}

.cta-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 20px;
	color: #ffffff;
	text-decoration: none;
	border-radius: 4px;
	font-weight: 500;
	font-size: 15px;
	line-height: 1.4;
	transition: all 0.3s ease;
	white-space: nowrap;
	background: #007cba;
}

/* ========================================
   투명 헤더
   ======================================== */

.site-header.transparent-header {
	background-color: transparent;
	box-shadow: none;
}

.site-header.transparent-header .main-navigation .nav-menu a {
	color: #fff;
}

.site-header.transparent-header .mobile-menu-toggle .hamburger-line {
	background-color: #fff;
}

/* 스크롤 시 또는 호버 시 일반 헤더로 전환 */
.site-header.transparent-header.scrolled,
.site-header.transparent-header:hover {
	background-color: #fff;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.site-header.transparent-header.scrolled .main-navigation .nav-menu a,
.site-header.transparent-header:hover .main-navigation .nav-menu a {
	color: #000;
}

.site-header.transparent-header.scrolled .mobile-menu-toggle .hamburger-line,
.site-header.transparent-header:hover .mobile-menu-toggle .hamburger-line {
	background-color: #000;
}

/* ========================================
   고정 헤더
   ======================================== */

.site-header.sticky-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
}

body.sticky-header-active {
	padding-top: 80px;
}

/* 스크롤 방향별 제어 */
.site-header.scroll-direction-control {
	transform: translateY(0);
	transition: transform 0.3s ease;
}

.site-header.scroll-direction-control.hide {
	transform: translateY(-100%);
}

/* ========================================
   Mobile Menu Toggle
   ======================================== */

.mobile-menu-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	width: 40px;
	height: 40px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	z-index: 999;
	transition: all 0.3s ease;
}

.hamburger {
	display: flex;
	flex-direction: column;
	width: 24px;
}

.hamburger-line {
	width: 24px;
	height: 2px;
	background-color: #000;
	margin: 2px 0;
	border-radius: 1px;
	transition: all 0.3s ease;
}

/* 햄버거 애니메이션 (열림) */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
	transform: translateY(6px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
	opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
	transform: translateY(-6px) rotate(-45deg);
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* ========================================
   Mobile Menu Overlay
   ======================================== */

.mobile-menu-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	background-color: rgba(0, 0, 0, 0.8);
	z-index: 1000;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
	opacity: 1;
	visibility: visible;
}

/* ========================================
   반응형 (PC: 1280px 이상)
   ======================================== */

@media (min-width: 1280px) {
	.mobile-menu-toggle {
		display: none !important;
	}
	
	.header-nav-wrapper {
		display: flex;
	}
}

/* ========================================
   모바일 메뉴 컨텐츠 (ARIAWELL_THEME 방식)
   ======================================== */

.mobile-menu-content {
	position: absolute;
	top: 0;
	right: 0;
	width: 300px;
	height: 100vh;
	background-color: #ffffff;
	padding: 80px 30px 30px;
	transform: translateX(100%);
	transition: transform 0.3s ease;
	overflow-y: auto;
}

.mobile-menu-overlay.active .mobile-menu-content {
	transform: translateX(0);
}

.mobile-menu-close {
	display: flex;
	align-items: center;
	justify-content: center;
	position: absolute;
	top: 20px;
	right: 20px;
	width: 40px;
	height: 40px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	z-index: 1002;
}

.mobile-menu-close img {
	width: 18px;
	height: 18px;
	transition: opacity 0.3s ease;
}

/* 모바일 메뉴 리스트 */
.mobile-nav-menu {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mobile-nav-menu li {
	border-bottom: 1px solid #eee;
}

.mobile-nav-menu li:last-child {
	border-bottom: none;
}

/* 서브메뉴가 없는 일반 링크 */
.mobile-nav-menu li:not(.menu-item-has-children) a {
	display: block;
	padding: 16px 30px;
	font-size: 16px;
	font-weight: 500;
	color: #333;
	text-decoration: none;
	transition: color 0.3s ease;
}

.mobile-nav-menu li:not(.menu-item-has-children) a:hover {
	color: #007cba;
}

/* 서브메뉴가 있는 아이템 - 1단계 */
.mobile-nav-menu li.menu-item-has-children .mobile-menu-item-wrapper {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0;
}

.mobile-nav-menu li.menu-item-has-children .mobile-menu-item-wrapper a {
	flex: 1;
	padding: 16px 30px;
	font-size: 16px;
	font-weight: 500;
	color: #333;
	text-decoration: none;
	cursor: pointer;
}

.mobile-nav-menu li.menu-item-has-children .mobile-menu-item-wrapper .submenu-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin-right: 15px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	transition: transform 0.3s ease;
	flex-shrink: 0;
}

.mobile-nav-menu li.menu-item-has-children .mobile-menu-item-wrapper .submenu-toggle img {
	width: 16px;
	height: 16px;
	transition: transform 0.3s ease;
}

.mobile-nav-menu li.menu-item-has-children .mobile-menu-item-wrapper .submenu-toggle.expanded img {
	transform: rotate(180deg);
}

/* 1단계 서브메뉴 */
.mobile-nav-menu li.menu-item-has-children .sub-menu {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mobile-nav-menu li.menu-item-has-children .sub-menu::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #f8f9fa;
	border-top: 1px solid #e9ecef;
	box-shadow: none;
	border-radius: 4px;
	z-index: -1;
}

.mobile-nav-menu li.menu-item-has-children .sub-menu li {
	border-bottom: 1px solid #e9ecef;
}

.mobile-nav-menu li.menu-item-has-children .sub-menu li:last-child {
	border-bottom: none;
}

/* 서브메뉴 링크 - 2단계 */
.mobile-nav-menu li.menu-item-has-children .sub-menu li a:not(.mobile-menu-item-wrapper a) {
	display: block;
	padding: 12px 30px 12px 40px;
	font-size: 15px;
	font-weight: 400;
	color: #555;
	text-decoration: none;
	transition: all 0.3s ease;
	cursor: pointer;
}

.mobile-nav-menu li.menu-item-has-children .sub-menu li a:not(.mobile-menu-item-wrapper a):hover {
	color: #007cba;
	background-color: #e9ecef;
}

/* 서브메뉴가 있는 아이템 - 2단계 */
.mobile-nav-menu li.menu-item-has-children .sub-menu li.menu-item-has-children .mobile-menu-item-wrapper {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0;
}

.mobile-nav-menu li.menu-item-has-children .sub-menu li.menu-item-has-children .mobile-menu-item-wrapper a {
	flex: 1;
	padding: 12px 30px 12px 70px;
	font-size: 15px;
	font-weight: 400;
	color: #555;
	cursor: pointer;
}

.mobile-nav-menu li.menu-item-has-children .sub-menu li.menu-item-has-children .mobile-menu-item-wrapper .submenu-toggle {
	width: 44px;
	height: 44px;
	margin-right: 10px;
	flex-shrink: 0;
}

.mobile-nav-menu li.menu-item-has-children .sub-menu li.menu-item-has-children .mobile-menu-item-wrapper .submenu-toggle img {
	width: 14px;
	height: 14px;
}

/* 2단계 서브메뉴 */
.mobile-nav-menu li.menu-item-has-children .sub-menu li.menu-item-has-children .sub-menu::before {
	background-color: #eff2f5;
	border-top: 1px solid #dee2e6;
}

.mobile-nav-menu li.menu-item-has-children .sub-menu li.menu-item-has-children .sub-menu li {
	border-bottom: 1px solid #dee2e6;
}

.mobile-nav-menu li.menu-item-has-children .sub-menu li.menu-item-has-children .sub-menu li a:not(.mobile-menu-item-wrapper a) {
	padding-left: 90px;
}

/* 3단계 서브메뉴 */
.mobile-nav-menu li.menu-item-has-children .sub-menu li.menu-item-has-children .sub-menu li.menu-item-has-children .mobile-menu-item-wrapper .submenu-toggle img {
	width: 12px;
	height: 12px;
}

.mobile-nav-menu li.menu-item-has-children .sub-menu li.menu-item-has-children .sub-menu li.menu-item-has-children .sub-menu::before {
	background-color: #e6eaf0;
}

.mobile-nav-menu li.menu-item-has-children .sub-menu li.menu-item-has-children .sub-menu li.menu-item-has-children .sub-menu li a:not(.mobile-menu-item-wrapper a) {
	padding-left: 110px;
}

/* 모바일 CTA */
.mobile-cta {
	margin-top: 40px;
	padding: 0 20px;
}

.mobile-cta .cta-button {
	width: 100%;
	margin: 0 auto;
	text-align: center;
	justify-content: center;
}

/* ========================================
   반응형 (태블릿/모바일: 1279px 이하)
   ======================================== */

@media (max-width: 1279px) {
	.mobile-menu-toggle {
		display: flex;
	}
	
	.header-nav-wrapper {
		display: none;
	}
	
	.header-inner {
		padding: 40px 30px;
	}
}

/* 태블릿 전용 (768px ~ 1279px) */
@media (min-width: 768px) and (max-width: 1279px) {
	.mobile-menu-content {
		width: 320px;
		padding: 80px 0 30px;
	}
}

/* ========================================
   반응형 (모바일: 768px 미만)
   ======================================== */

@media (max-width: 767px) {
	.header-inner {
		padding: 30px 20px;
	}
	
	.custom-logo {
		max-height: 45px;
	}
	
	.site-title {
		font-size: 20px;
	}
	
	.site-description {
		font-size: 12px;
	}
	
	.mobile-menu-content {
		width: 100%;
		padding: 70px 0 25px;
	}
	
	.mobile-nav-menu a {
		font-size: 15px;
		padding: 14px 30px;
	}
	
	.mobile-menu-close {
		top: 15px;
		right: 15px;
		width: 36px;
		height: 36px;
	}
	
	.mobile-menu-close img {
		width: 16px;
		height: 16px;
	}
	
	.mobile-nav-menu li:not(.menu-item-has-children) a {
		padding: 14px 30px;
	}
}

/* ========================================
   워드프레스 관리자 바 대응
   ======================================== */

/* 고정 헤더가 비활성화된 경우 - admin-bar 높이만큼 margin 추가 */
.admin-bar .site-header:not(.sticky-header) {
	margin-top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .site-header:not(.sticky-header) {
		margin-top: 46px;
	}
}

/* 고정 헤더가 활성화된 경우 - admin-bar 아래에 위치 */
.admin-bar .site-header.sticky-header {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .site-header.sticky-header {
		top: 46px;
	}
}

/* 고정 헤더 활성화 시 body padding 조정 (헤더 높이 80px + admin-bar 높이) */
body.admin-bar.sticky-header-active {
	padding-top: 112px; /* 80px + 32px */
}

@media (max-width: 782px) {
	body.admin-bar.sticky-header-active {
		padding-top: 126px; /* 80px + 46px */
	}
}

/* 모바일 메뉴 오버레이 - admin-bar 고려 (항상 적용) */
.admin-bar .mobile-menu-overlay {
	top: 32px;
	height: calc(100vh - 32px);
}

@media (max-width: 782px) {
	.admin-bar .mobile-menu-overlay {
		top: 46px;
		height: calc(100vh - 46px);
	}
}
