header{
    position: fixed;
    width: 100%;
    height: 8rem;
    z-index: 991016;
    background-color: #fff;
}

.header_in_wrap{
    width: 95%;
    max-width: 162rem;
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.h_logo{
    max-width: 220px;
    transition: max-width 0.45s ease;
}
.h_logo img{
    width: 100%;
    height: auto;
    display: block;
}

.header_in_wrap nav{
    margin-left: auto;
}

.gnb{
    display: flex;
    align-items: center;
    gap: 1.8rem;
    transition: gap 0.45s ease;
}

.gnb a{
    font-family: 'Paperlogy', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: #656D71;
    cursor: pointer;
    transition: color 0.3s ease, font-size 0.45s ease;
}

.gnb a:hover,
.gnb a:focus-visible,
.gnb a.is-active{
    color: #1E2B6D;
    
}

/* 1400px 이상: 넓은 화면에서만 로고·GNB 확대 */
@media (min-width: 1400px) {
    .h_logo {
        max-width: 260px;
    }
    .gnb {
        gap: 3rem;
    }
    .gnb a {
        font-size: 2rem;
    }
}

.header_link{
    display: flex;
    align-items: center;
}

/* 모바일 구현 시 display수정 */
.menu-wrap{
    display: none;
    align-items: center;
    justify-content: center;
}

.ham{
    position: relative;
    width: 4.4rem;
    height: 4.4rem;
    cursor: pointer;
    border-radius: 0.3rem;
}

.ham .bar{
    display: block;
    width: 0;
    height: 0.3rem;
    border-radius: 0.3rem;
    background-color: #1E2B6D;
    margin-top: 2.05rem;
    margin-left: 0.7rem;
    position: relative;
}

.ham .bar::before,
.ham .bar::after{
    content: '';
    width: 3rem;
    height: 0.3rem;
    border-radius: 0.3rem;
    background-color: #1E2B6D;
    position: absolute;
    left: 0;
    bottom: 0;
    transition: transform 0.3s;
}

.ham::before,
.ham::after{
    content: '';
    width: 3rem;
    height: 0.3rem;
    background-color: #1E2B6D;
    border-radius: 0.3rem;
    position: absolute;
    transition: width 0.3s 0.4s;
}

.ham::before{
    right: 0.7rem;
    bottom: 1.2rem;
}

.ham::after{
    left: 0.7rem;
    top: 1.2rem;
}

.ham.active .bar::before{
    transform: rotate(45deg);
    transition: transform 0.3s 0.8s;
}

.ham.active .bar::after{
    transform: rotate(-45deg);
    transition: transform 0.3s 0.8s;
}

.ham.active::before,
.ham.active::after{
    width: 0;
}

.ham:focus-visible{
    outline: 0.2rem solid #1E2B6D;
    outline-offset: 0.2rem;
}

@media (max-width: 1080px) {
    header {
        overflow: visible;
    }
    .header_in_wrap {
        position: relative;
    }
    .header_in_wrap nav {
        margin-left: 0;
        position: fixed;
        top: 8rem;
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        background-color: #fff;
        box-shadow: 0 12px 28px rgba(30, 30, 30, 0.12);
        z-index: 991015;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: max-height 0.35s ease, opacity 0.28s ease, visibility 0.28s ease;
        pointer-events: none;
        box-sizing: border-box;
    }
    .header_in_wrap nav.menu_open {
        max-height: min(70vh, 520px);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .h_logo{
        max-width: 210px;
    }
    .gnb {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .gnb li {
        border-bottom: 1px solid #eceff1;
    }
    .gnb li:last-child {
        border-bottom: none;
    }
    .gnb a {
        display: block;
        padding: 1.4rem 2rem;
        font-size: 1.8rem;
        transition: background-color 0.28s ease, color 0.28s ease;
    }
    /* 활성: scroll.js에서 a.is-active + li.active 동시 부여 (단일 섹션만) */
    .gnb a.is-active,
    .gnb li.active > a {
        background-color: #1E2B6D;
        color: #fff;
    }
    .gnb a.is-active:hover,
    .gnb a.is-active:focus-visible,
    .gnb li.active > a:hover,
    .gnb li.active > a:focus-visible {
        background-color: #1E2B6D;
        color: #fff;
    }
    .header_link {
        margin-left: auto;
        flex-shrink: 0;
    }
    .menu-wrap {
        display: flex !important;
    }
}

@media (max-width: 1080px){
    .h_logo{
        max-width: 180px;
    }
    .gnb a{
        padding: 1.2rem 1.6rem;
        font-size: min(1.8rem, 5.4vw);
    }
}

/* 햄버거 열림: 본문·퀵메뉴 위에 어두운 오버레이 (헤더·GNB 패널보다 아래 레이어) */
.gnb-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 991010;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
}
@media (max-width: 1079px) {
    body.nav-open .gnb-backdrop {
        display: block;
        pointer-events: auto;
    }
}

body.nav-open {
    overflow: hidden;
    touch-action: none;
}

@media (min-width: 1080px) {
    body.nav-open {
        overflow: visible;
        touch-action: auto;
    }
}