/* ============================================
   header
============================================ */
#header{
    position: relative;
    z-index: 100;
    background: #fff;
}


/* ============================
   상단바
============================= */
.hd_top{
    background: #F8F8F8;
}

.hd_top_inner{
    display: flex;
    justify-content: space-between;
    height: 50px;
}

.hd_hall{
    display: flex;
    height: 100%;
}

.hd_hall li{
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 130px;
    height: 100%;
    color: #999999;
    cursor: pointer;
}

.hd_hall li.on{
    background: #FFFFFF;
    color: #222222;
}

.hd_hall li.hd_dday{
    min-width: auto;
    padding: 0 40px;
    cursor: default;
}

.hd_util{
    display: flex;
    align-items: center;
}

.hd_util li{
    position: relative;
    padding: 0 20px;
    color: #999999;
    cursor: pointer;
    transition: color 0.3s;
}

.hd_util li:last-child{
    padding-right: 0;
}

.hd_util li + li::before{
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 14px;
    background: #CCCCCC;
}

.hd_util li:hover{
    color: #222222;
}


/* ============================
   메인바
============================= */
.hd_main{
    position: relative;
}

.hd_main_inner{
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100px;
}

/* 로고 영역 width = 드롭다운 .dd_left width (하위메뉴 시작점을 GNB 시작점에 맞춤) */
.hd_logo_area{
    flex-shrink: 0;
    padding-left: 25px;
}

.hd_logo{
    display: inline-block;
}

.hd_logo img{
    display: block;
    width: 205px;
}

.gnb{
    display: flex;
    gap: 50px;
    height: 100%;
    overflow-x: auto;
}


.gnb > li{
    display: flex;
    align-items: center;
    height: 100%;
}

/* 볼드 전환 시 글자 폭 변화로 옆 메뉴가 밀리지 않도록 ghost로 폭 고정 */
.gnb > li > a{
    display: inline-grid;
    justify-items: center;
    color: #222222;
    transition: color 0.3s;
}

.gnb_txt,
.gnb_ghost{
    grid-area: 1 / 1;
    white-space: nowrap;
}

.gnb_ghost{
    visibility: hidden;
}

.gnb > li.on > a{
    color: var(--red);
}

/* 햄버거 */
.hd_ham{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    width: 34px;
    height: 22px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
}

.hd_ham span{
    display: block;
    width: 100%;
    height: 2px;
    background: #222222;
}


/* ============================
   드롭다운
   - grid-template-rows 0fr → 1fr 로 높이 자동 슬라이드
============================= */
.hd_dd{
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    display: grid;
    grid-template-rows: 0fr;
    background: #fff;
    transition: grid-template-rows 0.3s ease;
}

.hd_dd.open{
    grid-template-rows: 1fr;
}

.hd_dd_inner{
    min-height: 0;
    overflow: hidden;
}

.hd_dd.open .hd_dd_inner{
    border-top: 1px solid #DDDDDD;
    border-bottom: 1px solid #dddddd;
}

.dd_panel{
    display: none;
    padding: 70px 60px 90px;
}

.dd_panel.on{
    display: flex;
    gap: 2vw;
}

.dd_left{
    flex-shrink: 0;
    gap: 1vw;
}

.dd_title{
    color: #222222;
    line-height: 1.3;
}

.dd_desc{
    margin-top: 30px;
    color: #555555;
    line-height: 1.65;
    display: none;
}

/* 드롭다운 2차 메뉴 (3차 있으면 제목 + 세로 목록) */
.dd_sub{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px 90px;
    border-left: 2px solid #dddddd;
    padding-left: 2vw;
}

.dd_sub_tit{
    color: #222222;
    transition: color 0.3s;
}

.dd_sub_tit:hover{
    color: var(--red);
}

/* 3차 메뉴 */
.dd_dep3{
    margin-top: 25px;
    display: none;
}

.dd_dep3 li + li{
    margin-top: 14px;
}

.dd_dep3 a{
    color: #555555;
    transition: color 0.3s;
}

.dd_dep3 a:hover{
    color: var(--red);
}

/* ============================
   사이트맵
============================= */
.sitemap{
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
}

.sm_box{
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 120px);
    max-width: 1800px;
    max-height: calc(100% - 80px);
    overflow-y: auto;
    background: #fff;
}

.sm_head{
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    background: var(--red);
    color: #fff;
}

.sm_close{
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
    background: none;
    border: 0;
    color: #fff;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
}

.sm_body{
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    padding: 70px 85px 80px;
}

.sm_title{
    display: block;
    padding-right: 10px;
    color: #222222;
    line-height: 1.4;
}

/* 컬럼 사이 gap이 없어서 선이 가로로 이어짐 */
.sm_line{
    position: relative;
    display: block;
    height: 1px;
    margin: 30px 0 35px;
    background: #DDDDDD;
}

/* 마름모 : 시안 색상 유지 (확인 필요) */
.sm_line::before{
    content: '';
    position: absolute;
    left: 1px;
    top: 50%;
    width: 8px;
    height: 8px;
    background: #F5B400;
    transform: translateY(-50%) rotate(45deg);
}

.sm_sub li + li{
    margin-top: 20px;
}

.sm_sub a{
    color: #555555;
    transition: color 0.3s;
}

.sm_sub a:hover{
    color: var(--red);
}

body.sm_open{
    overflow: hidden;
}


/* ============================================
   반응형
============================================ */
@media (max-width: 1600px){
    .dd_left{
    }
    .gnb{
        gap: 30px;
    }
    .dd_sub{
        column-gap: 60px;
    }
    .sm_body{
        padding: 60px 50px 70px;
    }
}

@media (max-width: 1280px){
    .dd_panel{
        padding-left: 30px;
        padding-right: 30px;
    }
    .dd_left{
        padding-left: 0;
    }
    .hd_logo img{
        width: 170px;
    }
    .gnb{
        gap: 20px;
    }
}

@media (max-width: 1024px){
    .hd_util,
    .gnb,
    .hd_dd{
        display: none;
    }
    .hd_main_inner{
        height: 80px;
    }
    .hd_logo_area{
        width: auto;
    }
    .hd_logo img{
        width: 160px;
    }
    .sm_box{
        width: calc(100% - 40px);
    }
    .sm_body{
        grid-template-columns: repeat(4, 1fr);
        row-gap: 50px;
        padding: 50px 40px;
    }
}

@media (max-width: 767px){
    .hd_top_inner{
        height: 44px;
    }
    .hd_hall li{
        min-width: auto;
        padding: 0 15px;
    }
    .hd_hall li.hd_dday{
        padding: 0 15px;
    }
    .hd_main_inner{
        height: 70px;
    }
    .hd_logo img{
        width: 130px;
    }
    .sm_head{
        height: 70px;
    }
    .sm_close{
        right: 20px;
        font-size: 30px;
    }
    .sm_body{
        grid-template-columns: repeat(2, 1fr);
        row-gap: 40px;
        padding: 40px 20px;
    }
    .sm_line{
        margin: 20px 0 25px;
    }
    .sm_sub li + li{
        margin-top: 14px;
    }
}