@charset "utf-8";

/* Header Container */
header {
    width: 100%;
    z-index: 1000;
}

/* Main Page Header (Overlay) */
header.header-main-page {
    position: absolute;
    top: 0;
    left: 0;
    background: transparent;
}

/* Fix: Center GNB on Main Page */
header.header-main-page .content-center {
    justify-content: center;
}
header.header-main-page .gnb ul {
    justify-content: center;
}

/* Sub Page Header (Background Image) */
header.header-sub-page {
    position: relative;
    background: url('../images/common/top-bg.png') no-repeat center top / 100% 100%;
    height: 130px;
}

.header-inner {
    width: 100%;
}

.inner-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px; /* PC 여백 확보 */
    display: flex;
    align-items: center;
    height: 100%;
}

/* Row 1: Top Utility */
.top-util {
    height: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header.header-sub-page .top-util {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.util-menu {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 30px;
}

.util-menu a, .util-menu span {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 14px;
    color: #FFF;
    font-weight: 400;
}

header.header-sub-page .util-menu a, 
header.header-sub-page .util-menu span {
    color: #333;
}

.util-menu a img {
    height: 18px;
    margin-right: 8px; /* SPEC보다 실용적 간격 조정, 25px은 너무 멀어 보일 수 있음. 디자인 문서는 25px 명시되어 있으나 시각적으로 조정 필요시 확인 */
}

/* Row 2: Header Content */
.header-content {
    height: 85px;
}

.header-content .inner-container {
    justify-content: space-between;
    gap: 20px;
}

.logo {
    flex-shrink: 0; /* 로고 크기 유지 */
}

.logo a {
    display: block;
}

.logo img {
    width: auto;
    height: 40px;
    object-fit: contain;
    vertical-align: middle;
}

.content-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.gnb {
    height: 100%;
}

.gnb ul {
    display: flex;
    gap: 60px; /* 1440px 기준 gap 조정 (80px은 너무 넓어 레이아웃 깨짐 발생 가능) */
    height: 100%;
}

/* Dep1 Menu Item */
.dep1 {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.dep1 > a {
    display: block;
    padding: 10px 0;
    font-size: 20px;
    font-weight: 600; /* 좀 더 선명하게 */
    color: #FFF;
    text-decoration: none;
    transition: color 0.3s;
    white-space: nowrap;
}

header.header-sub-page .dep1 > a {
    color: #FFF;
}

/* GNB Hover Effect */
.dep1:hover > a {
    color: #442c93 !important;
}

.dep1 > a::after {
    content: '';
    position: absolute;
    bottom: 0px; /* 초기 위치 */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: #442c93;
    transition: all 0.3s;
}

.dep1:hover > a::after {
    /* SPEC: 언더라인은 메인 메뉴의 가로 길이보다 4px이 김 */
    width: calc(100% + 4px);
    /* SPEC: 메인 메뉴와 언더라인의 간격 12px -> 텍스트 하단 여백 감안하여 조정 */
    bottom: -2px; 
}

/* Submenu Dropdown */
.submenu-wrap {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 180px;
    background: #FFF;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 20px 0;
    z-index: 1001;
    border-top: 2px solid #442c93;
}

.dep1:hover .submenu-wrap {
    display: block;
}

.dep2-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dep2-list li a {
    display: block;
    padding: 12px 30px;
    font-size: 16px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.dep2-list li a:hover {
    color: #442c93;
    background: #F8F9FF;
    font-weight: 600;
}

/* Header Icons */
.content-right {
    flex-shrink: 0;
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-icons button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.header-icons button img {
    width: 28px;
    height: 28px;
    vertical-align: middle;
}

header.header-main-page .header-icons button img {
    /*filter: brightness(0) invert(1);*/
}

/* Responsive Styles */

/* 1200px ~ 1440px: Gap & Size optimization */
@media screen and (max-width: 1440px) {
    .gnb ul { gap: 40px; }
    .dep1 > a { font-size: 18px; }
    .logo img { width: 200px; }
}

@media screen and (max-width: 1200px) {
    .gnb ul { gap: 25px; }
    .dep1 > a { font-size: 17px; }
    .logo img { width: 180px; }
    .inner-container { padding: 0 20px; }
}

/* Tablet & Mobile (Below 1024px) */
@media screen and (max-width: 1024px) {
    header.header-main-page {
        background: rgba(0,0,0,0.8); /* 모바일에서는 비주얼 위 가독성을 위해 배경 추가 고려 가능, 현재는 다크모드 대응 */
        position: fixed;
    }
    
    header.header-sub-page {
        height: 70px;
        background: #FFF; /* 모바일 배경 이미지 제거 또는 간소화 */
    }

    .top-util {
        display: none;
    }

    .header-content {
        height: 70px;
    }

    .gnb {
        display: none; /* 모바일 메뉴는 햄버거 버튼으로 대응 */
    }

    .logo img {
        width: 140px;
        height: auto;
    }

    .header-icons button img {
        width: 24px;
        height: 24px;
    }
    
    header.header-sub-page .header-icons button img {
        filter: none;
    }
}