/* =========================================================
   햇바람발전소 헤더 (sticky / 반응형 375px ~ 폴드 펼침)
   ========================================================= */

/* base.html 구조상 <header>가 #base_wrap 직계 자식 → 여기에 sticky 적용 */
#base_wrap>header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

#www-header {
    background: #fff;
    border-bottom: 1px solid #e6eaec;
    box-shadow: 0 6px 3px rgba(0, 0, 0, .04);
    font-family: "Noto Sans KR", sans-serif;
    padding: 0 clamp(20px, 5vw, 80px);
}

.hh-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    max-width: 1132px;
    height: 75px;
    margin: 0 auto;
}

/* 로고 */
.hh-logo {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.hh-logo img {
    width: auto;
    height: clamp(40px, 6vw, 50px);
    display: block;
}

/* 데스크톱 네비게이션 */
.hh-nav {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vw, 24px);
}

.hh-nav__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: clamp(15px, 1.6vw, 16px);
    font-weight: 500;
    line-height: 1.5;
    color: #222;
    border-radius: 6px;
    white-space: nowrap;
    transition: color .15s ease, background-color .15s ease;
}

.hh-nav__link:hover {
    color: #1b3a48;
    background: #f3f6f7;
}

/* 모바일 햄버거 버튼 (기본 숨김) */
.hh-toggle {
    display: none;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border-radius: 8px;
}

.hh-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #1a232a;
    border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
}

/* =========================================================
   반응형 - 태블릿/모바일 (≤ 768px)
   ========================================================= */
@media (max-width: 768px) {
    .hh-toggle {
        display: flex;
    }

    /* 네비게이션을 헤더 아래 드롭다운으로 */
    .hh-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 6px clamp(20px, 5vw, 80px) 12px;
        background: #fff;
        border-bottom: 1px solid #e6eaec;
        box-shadow: 0 8px 12px rgba(0, 0, 0, .06);

        /* 닫힘 상태: 접힘 */
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-6px);
        transition: max-height .28s ease, opacity .2s ease, transform .25s ease, visibility .28s;
    }

    #www-header.is-open .hh-nav {
        max-height: 320px;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .hh-nav__link {
        justify-content: flex-start;
        width: 100%;
        padding: 14px 8px;
        font-size: 16px;
        border-radius: 0;
        border-bottom: 1px solid #f0f2f3;
    }

    .hh-nav__link:hover {
        background: #f7f9fa;
    }

    .hh-nav__link:last-child {
        border-bottom: 0;
    }

    /* 햄버거 → X 변형 */
    #www-header.is-open .hh-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    #www-header.is-open .hh-toggle span:nth-child(2) {
        opacity: 0;
    }

    #www-header.is-open .hh-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}