@charset "UTF-8";

:root {
    --surface: #ffffff;
    --text: #000000;
    --muted: #5E5D5E;
    --line: #e5e7eb;
    --primary: #340EC1;
    --blue: #2563eb;
    --teal: #0f766e;
    --green: #16a34a;
    --orange: #f97316;
    --pink: #db2777;
    --gold: #ca8a04;
    --red: #F42A39;
    --gray: #F7F9FA;
    --border-radius: 10px;
    --border-color: #E7E8E9;
}

/* ===== 전역 리셋 ===== */
* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    font-size: 14px;
    font-family: 'NanumSquareAcr';
}

p, a, span, div, table, tr, td, th,
input, select, textarea, button,
label, h1, h2, h3, h4, h5, h6, ul, ol, li {
    color: #000000;
    line-height: 1.6;
    font-family: 'NanumSquareAcr';
}

body {
    overflow-x: hidden;
    background-color: #FAFAFA;
}

button  { cursor: pointer !important; }
a:focus,
a:hover { color: var(--text); text-decoration: none; }
b, .bold { font-weight: bold; }
input:focus { outline: none; }
input::placeholder { color: #aaaaaa; }

/* ===== 헤더 래퍼 ===== */
.wrap {
    width: 100%;
    background-color: #fff;
    position: relative; /* top_menu 기준점 */
}

/* ===== 내비게이션 ===== */
.navbar {
    position: relative;          /* drop_menu의 absolute 기준점 */
    min-height: 90px;
    padding: 0;
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    flex-wrap: nowrap;           /* drop_menu가 flex 줄바꿈에 끼지 않도록 */
}

/* navbar 내 container-fluid: 90% 너비 고정, 높이 90px */
.navbar > .container-fluid {
    width: 90%;
    max-width: 1300px;
    height: 90px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    align-items: center;
}

.navbar-nav {
    flex: 1;
    height: 90px;
    margin: 0;
    display: flex !important;
    align-items: stretch;  /* li가 90px 전체 높이를 채움 */
}

.navbar-nav > li {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.nav-link {
    color: #1c1c1c !important;
    font-weight: bold;
    font-size: 15px;
    padding: 0 !important;
    width: 100%;
    text-align: center;
}

.nav-link:hover {
    color: var(--primary) !important;
}

/* ===== 로고 ===== */
.site-logo {
    width: 160px;
    flex-shrink: 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    height: 80px;
    font-size: 20px;
    font-weight: bold;
    color: #1c1c1c !important;
    text-decoration: none !important;
}

/* ===== 현재 페이지 nav 강조 ===== */
.current-list-item > .nav-link {
    color: var(--primary) !important;
}

/* 언더라인: navbar border 위에 덮이도록 z-index 지정 */
.current-list-item::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 3px;
    background-color: var(--primary);
    z-index: 1;
}

/* ===== 상단 바: 로그아웃 ===== */
.top_menu {
    position: absolute;
    top: 10px;
    right: 5px;
    z-index: 99;
    display: flex;
    gap: 8px;
}

.top_menu > div {
    height: 24px;
    line-height: 22px;
    padding: 0 10px;
}

.logout {
    border: 1px solid #DCDCDC;
    border-radius: 5px;
}

.logout a {
    font-size: 14px;
    color: #555;
}

/* ===== 드롭다운 패널 =====
   .navbar 직접 자식 + position:absolute + top:100%
   → navbar 전체 너비(뷰포트)에 자연스럽게 맞음
   → slideDown() 애니메이션이 단일 요소에만 적용되어 조각남 없음
*/
.drop_menu {
    display: none;
    position: absolute;
    top: 100%;   /* navbar 하단에 정확히 붙음 */
    left: 0;
    width: 100%; /* navbar 너비 = 뷰포트 전체 */
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 10px 0;
    z-index: 999;
}

/* navbar의 container-fluid와 동일한 90% 너비로 정렬 */
.drop_wrap {
    width: 90%; 
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
}

/* 로고 너비만큼 공간 확보 → dm_box가 nav 항목과 열 정렬 */
.logo-spacer {
    width: 160px;
    flex-shrink: 0;
}

.dm_box {
    flex: 1;
    position: relative;
    text-align: center;
    padding: 6px 0 10px;
}

.dm_box a {
    display: block;
    padding: 2px 0;
    color: #1c1c1c;
    text-decoration: none !important;
}

.dm_box a:hover .dm_text {
    color: var(--primary);
    font-weight: 900;
}

.dm_text {
    display: inline-block;
    height: 34px;
    line-height: 34px;
    font-size: 14px;
    color: #1c1c1c;
}

/* ===== 활성 서브메뉴 강조 ===== */
.dm_box a.on .dm_text {
    color: var(--primary);
    font-weight: bold;
}

/* ===== 모바일 서브메뉴 화살표 (데스크톱에서 숨김) ===== */
.nav-arrow {
    display: none;
    font-size: 13px;
    margin-left: 4px;
    transition: transform 0.2s ease;
    line-height: 1;
}

/* ===== 모바일 전용 서브메뉴 (데스크톱에서 숨김) ===== */
.mobile-submenu {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ===== 햄버거 버튼: * 전역 리셋(padding:0)으로 망가진 Bootstrap 스타일 복원 ===== */
.navbar-toggler {
    display: none;
    padding: 6px 10px !important;
    margin-left: auto;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.navbar-toggler-icon {
    display: block;
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280%2C0%2C0%2C0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

/* ===== 반응형 ===== */

/*
 * Bootstrap의 navbar-expand-lg 기본 브레이크포인트(992px)를 720px로 당김.
 * 720px 이상: 데스크톱 레이아웃 강제 적용
 */
@media (min-width: 720px) {
    .navbar-expand-lg .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
    }
    .navbar-expand-lg .navbar-nav {
        flex-direction: row;
    }
    .navbar-expand-lg .navbar-toggler {
        display: none !important;
    }
    /* 데스크톱: 모바일 전용 요소 강제 숨김 (!important로 jQuery 인라인 스타일 덮어씀) */
    .mobile-submenu { display: none !important; }
    .nav-arrow      { display: none !important; }
}

/* 720px 미만: 모바일 레이아웃 */
@media (max-width: 719px) {
    /* 드롭다운 호버 비활성 */
    .drop_menu { display: none !important; }

    /* 로그아웃 버튼 위치 조정 */
    .top_menu { right: 5%; }

    /* 컨테이너: 고정 높이 해제 → 펼쳐진 메뉴를 수용 */
    .navbar > .container-fluid {
        height: auto;
        min-height: 60px;
        flex-wrap: wrap;        /* navbar-collapse가 다음 줄로 내려올 수 있도록 */
        align-items: center;
        padding: 8px 15px;
    }

    /* 햄버거 버튼 표시 */
    .navbar-toggler {
        display: block !important;
    }

    /* 펼쳐진 메뉴: 전체 너비 차지 */
    .navbar-collapse {
        flex-basis: 100%;
        flex-grow: 1;
        padding-bottom: 8px;
    }

    /* 메뉴 항목 세로 정렬 */
    .navbar-nav {
        flex-direction: column !important;
        height: auto;
        align-items: stretch;
    }

    /* nav 항목: 패딩 제거, li 자체 구분선 없음 (서브메뉴 포함한 흐름으로) */
    .navbar-nav > li {
        height: auto;
        justify-content: flex-start;
        padding: 0;
        border-bottom: 1px solid #e8e8e8;
        flex-direction: column;    /* nav-link + mobile-submenu 세로 배치 */
        align-items: stretch;
    }

    .navbar-nav > li:last-child {
        border-bottom: none;
    }

    /* nav-link: 좌측 정렬, 적절한 패딩 */
    .nav-link {
        text-align: left !important;
        width: 100% !important;
        padding: 14px 20px !important;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
    }

    /* 모바일에서 언더라인 제거 */
    .current-list-item::after { display: none; }

    /* 화살표 표시 */
    .nav-arrow {
        display: inline-block;
        transition: transform 0.25s ease;
    }

    /* 서브메뉴 열린 상태: 화살표 위로 회전 */
    .nav-item.mob-open > .nav-link .nav-arrow {
        transform: rotate(180deg);
    }

    /* 모바일 서브메뉴: 흰 배경, nav-link 바로 아래에 위치 */
    .mobile-submenu {
        background: #fff;
        border-top: 1px solid #e8e8e8;
        margin: 0;
    }

    .mobile-submenu li {
        height: auto;
        padding: 0;
        border: none;
        border-bottom: 1px solid #f0f0f0;
        justify-content: flex-start;
        flex-direction: row;
    }

    .mobile-submenu li:last-child {
        border-bottom: none;
    }

    .mobile-submenu a {
        display: block;
        width: 100%;
        padding: 13px 32px;
        font-size: 14px;
        color: #444;
        text-decoration: none !important;
    }

    .mobile-submenu a:hover {
        color: #002f7b;
    }

    /* 현재 페이지 서브메뉴 항목 강조 */
    .mobile-submenu a.on {
        color: #002f7b;
        font-weight: bold;
    }
}
