/* 전체 헤더 스타일 */
@import url(https://cdn.jsdelivr.net/gh/moonspam/NanumSquare@1.0/nanumsquare.css);

.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    background: #f9fafb;
    color: #000;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 7.5vh; /* 화면 비율에 따라 높이 설정 */
    padding: 0;
    display: flex;
    align-items: center;
}

/* 컨테이너 */
.main-header .container {
    display: flex;
    justify-content: space-between; /* 로고와 네비게이션 양쪽 배치 */
    align-items: center; /* 네비게이션 아래 정렬 */
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
}

/* 로고 스타일 */
.main-header .logo {
    height: 100%;
    display: flex;
    align-items: center; /* 세로 가운데 정렬 */
}

.main-header .logo img {
    max-height: 5vh;
    width: auto;
    object-fit: contain; /* 이미지 왜곡 방지 */
    display: block;
    padding: 0; /* 추가 여백 제거 */
    margin: 0; /* 여백 제거 */
}

/* 내비게이션 스타일 */
.nav-menu {
    display: flex;
    align-items: flex-end; /* 네비게이션 아래 정렬 */
    gap: 20px;
    height: 100%;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: flex-end; /* 네비게이션 아래 정렬 */
    gap: 20px;
    margin: 0;
    padding: 10px;
}

.nav-links li a {
    text-decoration: none;
    font-size: clamp(0.8rem, 2.5vw, 1rem); /* 반응형 폰트 크기 */
    color: #545454;
    transition: color 0.3s ease;
}

.nav-links li a:hover {
    font-weight: bold;
    color: #000;
}

/* 햄버거 버튼 스타일 */
.nav-toggle {
    display: none; /* 기본적으로 숨김 */
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    outline: none; /* 포커스 아웃라인 제거 */
}

.nav-toggle:focus {
    outline: none;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent; /* 모바일 터치 하이라이트 제거 */
}


@media (max-width: 768px) {
    body {
        overflow-x: hidden; /* 가로 스크롤 방지 */
    }

    .nav-menu {
        opacity: 0; /* 기본적으로 보이지 않음 */
        position: fixed;
        top: 7.5vh; /* 헤더 아래 위치 */
        right: 0;
        width: 100%; /* 메뉴가 화면 너비를 초과하지 않음 */
        max-width: 100%;
        background: #f9fafb;
        flex-direction: column;
        gap: 10px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        padding: 0;
        z-index: 1000;
        overflow: hidden;
        max-height: 0; /* 기본 상태에서 높이를 0으로 */
        transition: max-height 0.4s ease-in-out, opacity 0.4s ease-in-out;
    }

    .nav-menu.open {
        opacity: 1;
        max-height: 300px; /* 메뉴 펼칠 때의 최대 높이 */
    }

    .nav-links {
        list-style: none;
        margin: 0;
        padding: 0;
        width: 100%; /* 링크가 화면 너비를 초과하지 않음 */
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        transition: all 0.3s ease-in-out;
    }

    .nav-links li {
        width: 100%; /* 항목이 메뉴 전체 너비를 차지 */
        padding: 10px 15px;
        border-bottom: 1px solid #e0e0e0;
        box-sizing: border-box; /* 패딩 포함 너비 계산 */
        text-align: left;
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links li a {
        text-decoration: none;
        font-size: 1rem;
        color: #333;
        display: block;
        width: 100%;
        transition: all 0.3s ease;
    }

    .nav-links li a:hover {
        background: #f0f0f0;
        color: #000;
        padding-left: 25px;
        border-radius: 5px;
    }

    .nav-toggle {
        display: block;
        font-size: 1.8rem;
        cursor: pointer;
        z-index: 1001;
        color: #333;
    }

    .nav-toggle:focus {
        outline: none;
        box-shadow: none;
    }

    .main-header .container {
        align-items: center; /* 로고와 햄버거 버튼 중앙 정렬 */
    }
}
