@charset "utf-8";

header {
    display: block;
    position: relative;
    width: 100%;
    z-index: 100;
    background-color: white;
    transition: background-color 0.5s ease-out, transform 0.5s ease-out;
    transform: translateY(0);
}
header.fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transform: translateY(0);
    /* background-color: rgba(255, 255, 255, .9); */
}

/* #region top_bar */
header .top_bar {
    width: 100%;
    height: 30px;
    background-color: var(--blue);
    padding: 0 2%;

    display: flex;
    justify-content: end;
    align-items: center;
    overflow: hidden;
    transition: height 0.5s ease-out, opacity 0.5s ease-out;
    opacity: 1;
}

header.fixed:hover .top_bar {
    height: 30px;
    opacity: 1;
}

header .top_bar .lang_switch {
    font-weight: var(--semibold);
    height: 100%;
    display: flex;
}

header .top_bar .lang_switch a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    color: var(--white);
    font-weight: var(--regular);
}

header .top_bar .lang_switch a.active {
    background-color: white;
    color: var(--blue);
    font-weight: var(--semibold);
}

/* #endregion top_bar */

/* #region main_header */
header .main_header {
    width: 100%;
    height: 80px;
    padding: 0 2%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--dimmed);
    transition: height .3s ease;
}

header.fixed .top_bar {
    height: 0;
    opacity: 0;
}

header .main_header .logo {
    position: absolute;
    display: block;
    width: 158px;
    padding: 20px 0;
    z-index: 200;
}

header ul.main_nav {
    display: flex;
    height: 78px;
    flex-grow: 1;
    justify-content: end;
    align-items: center;
    gap: 2%;
}

header ul.main_nav li {
    height: 100%;
    flex-shrink: 0;
    font-size: 16px;
    font-weight: var(--semibold);
    position: relative;
}

header ul.main_nav li a {
    display: block;
    height: 100%;
    line-height: 78px;
}

header ul.main_nav li a::after {
    content: '';
    display: flex;
    justify-content: center;
    width: 0;
    height: 3px;
    background-color: var(--blue);
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

header ul.main_nav li:hover a::after {
    width: 100%;
}

header ul.main_nav li.active a::after {
    width: 100%;
}

@media screen and (max-width: 1000px) {
    header ul.main_nav {
        gap: 4%;
    }
}

@media screen and (max-width: 768px) {
    header .main_header {
        height: 50px;
    }

    header .top_bar {
        height: 20px;
    }

    header.fixed:hover .top_bar {
        height: 20px;
        opacity: 1;
    }

    header .top_bar .lang_switch a {
        font-size: 12px;
        width: 40px;
    }

    header .main_header .logo {
        display: block;
        width: 120px;
        padding: 12px 0;
    }

    header ul.main_nav {
        display: none;
    }

    header .menu_btn {
        position: absolute;
        right: 2%;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        gap: 5px;
        margin-right: 10px;
        z-index: 1001;
    }

    header ul.main_nav.active {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        display: flex;
        flex-direction: column;
        justify-content: start;
        align-items: center;
        z-index: 999;
        background: white;
        padding-top: 20px;
        gap: 0;
    }
    
    /* 메뉴가 열렸을 때 헤더 border-bottom 색상 변경 */
    header:has(ul.main_nav.active) .main_header {
        border-bottom-color: #FFF;
    }
    
    /* 메뉴가 열렸을 때 로고가 위에 보이도록 */
    header .main_header .logo {
        position: relative;
        z-index: 1001 !important;
    }

    header ul.main_nav li a::after {
        content: none;
    }

    header ul.main_nav li {
        width: 100%;
    }

    header ul.main_nav.active li {
        height: auto;
    }

    header ul.main_nav.active li:first-of-type a {
    }

    header ul.main_nav.active li a {
        height: auto;
        width: 90%;
        line-height: 1;
        padding: 24px 5%;
        margin: 0 auto;
        text-align: center;
    }

    header .menu_btn span.bar {
        display: block;
        width: 20px;
        height: 3px;
        background-color: var(--black);
        border-radius: 8px;
        transition: transform .3s ease-in-out; 
    }
    header .menu_btn.close span.bar:nth-of-type(1) {
        transform: translateY(8px) rotate(45deg);
    }
    header .menu_btn.close span.bar:nth-of-type(2) {
        background-color: transparent;
    }
    header .menu_btn.close span.bar:nth-of-type(3) {
        transform: translateY(-8px) rotate(135deg);
    }
}

/* #region main_header */