/* ==========================================================================
   gnb.css — 글로벌 내비게이션 바 (GNB)
   inc_gnb.asp HTML 구조에 맞춘 스타일
   ========================================================================== */

/* ------------------------------------------------------------------
   헤더 (#header)
   ------------------------------------------------------------------ */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.08);
    z-index: var(--wyd-z-header, 300);
    transition: top var(--wyd-transition-base);
}

/* ------------------------------------------------------------------
   GNB 내부 레이아웃 (.gnb-wrap) — 3열 구조
   ------------------------------------------------------------------ */
.gnb-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    height: 64px;
}

/* ------------------------------------------------------------------
   로고 (.gnb-logo)
   ------------------------------------------------------------------ */
.gnb-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.gnb-logo .logo {
    margin: 0;
    padding: 0;
    line-height: 1;
}
.gnb-logo .logo a {
    display: block;
}
.gnb-logo .logo img {
    height: 36px;
    width: auto;
}
.gnb-wyd-logo {
    display: block;
    line-height: 1;
    overflow: hidden;
    height: 36px;
}
.gnb-wyd-logo img {
    height: 90px;
    width: auto;
    margin-top: -26px;
    padding-top: 3px;
}

/* ------------------------------------------------------------------
   데스크톱 네비게이션 (.gnb-nav > .gnb-menu)
   ------------------------------------------------------------------ */
.gnb-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}
.gnb-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.gnb-menu__item a {
    display: block;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}
.gnb-menu__item a:hover {
    color: var(--wyd-primary);
    background: rgba(var(--wyd-primary-rgb), 0.06);
}
.gnb-menu__item.active a {
    color: var(--wyd-primary);
    font-weight: 600;
    position: relative;
}
.gnb-menu__item.active a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 14px;
    right: 14px;
    height: 3px;
    background: var(--wyd-primary);
    border-radius: 2px;
}

/* ------------------------------------------------------------------
   인증 영역 (.gnb-auth)
   ------------------------------------------------------------------ */
.gnb-auth {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 비로그인: .gnb-guest */
.gnb-guest {
    display: flex;
    align-items: center;
    gap: 8px;
}
.gnb-login-btn {
    font-size: 0.85rem;
}
.gnb-join-btn {
    font-size: 0.85rem;
}

/* 로그인: .gnb-user (Bootstrap dropdown 사용) */
.gnb-user__btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    background: #fff;
    font-size: 0.85rem;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s;
}
.gnb-user__btn:hover {
    border-color: var(--wyd-primary);
}
.gnb-user__btn i {
    font-size: 1.2rem;
    color: var(--wyd-primary);
}
.gnb-user__name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ------------------------------------------------------------------
   햄버거 버튼 (.gnb-hamburger) — 모바일 전용
   ------------------------------------------------------------------ */
.gnb-hamburger {
    display: none;  /* 데스크톱에서 숨김 */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    gap: 5px;
}
.gnb-hamburger__line {
    display: block;
    width: 22px;
    height: 2px;
    background: #333;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
/* 열린 상태 X 모양 */
.gnb-hamburger.active .gnb-hamburger__line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.gnb-hamburger.active .gnb-hamburger__line:nth-child(2) {
    opacity: 0;
}
.gnb-hamburger.active .gnb-hamburger__line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ------------------------------------------------------------------
   모바일 메뉴 (.gnb-mobile) — 오른쪽 슬라이드
   ------------------------------------------------------------------ */
.gnb-mobile {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 80vw;
    height: auto;
    max-height: 100vh;
    background: linear-gradient(180deg, #fff 0%, #f8f9fb 100%);
    z-index: 400;
    padding: 26px 16px 24px;
    overflow-y: auto;
    border-radius: 0 0 0 20px;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 30px rgba(0,0,0,0.12);
    visibility: hidden;
}
.gnb-mobile.open {
    transform: translateX(0);
    visibility: visible;
}

/* 모바일 메뉴 배경 오버레이 */
.gnb-mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 350;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.gnb-mobile-overlay.open {
    display: block;
    opacity: 1;
}

/* 모바일 메뉴 상단 (브랜드 + 닫기) */
.gnb-mobile__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--wyd-border-light, #e9ecef);
}
.gnb-mobile__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--wyd-text-secondary, #888);
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--wyd-transition-base);
}
.gnb-mobile__close:hover {
    background: rgba(0,0,0,0.06);
    color: var(--wyd-text, #333);
}

/* 모바일 메뉴 브랜드 */
.gnb-mobile__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.gnb-mobile__brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.gnb-mobile__brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.gnb-mobile__brand-text strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--wyd-primary);
}
.gnb-mobile__brand-text span {
    font-size: 0.75rem;
    color: var(--wyd-text-secondary, #888);
}

/* 모바일 인증 영역 */
.gnb-mobile__auth {
    padding: 0 4px 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--wyd-border-light, #e9ecef);
}
.gnb-mobile__guest {
    display: flex;
    gap: 8px;
}
.gnb-mobile__guest .btn {
    flex: 1;
    text-align: center;
    font-size: 0.85rem;
    padding: 8px 0;
    border-radius: 8px;
}
.gnb-mobile__user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 10px;
}
.gnb-mobile__user i {
    font-size: 1.6rem;
    color: var(--wyd-primary);
}
.gnb-mobile__user-links {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
}
.gnb-mobile__user-links a {
    color: var(--wyd-text-secondary, #666);
    text-decoration: none;
    transition: color var(--wyd-transition-base);
}
.gnb-mobile__user-links a:hover {
    color: var(--wyd-primary);
}

/* 모바일 네비게이션 — 아이콘 + 텍스트 리스트 */
.gnb-mobile__menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.gnb-mobile__menu-list li a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 12px;
    color: var(--wyd-text, #333);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all var(--wyd-transition-base);
}
.gnb-mobile__menu-list li a i {
    width: 20px;
    text-align: center;
    font-size: 1.05rem;
    color: var(--wyd-text-secondary, #888);
    transition: color var(--wyd-transition-base);
}
.gnb-mobile__menu-list li a span {
    flex: 1;
}
.gnb-mobile__menu-list li a:hover {
    background: rgba(var(--wyd-primary-rgb, 29,72,161), 0.06);
    color: var(--wyd-primary);
}
.gnb-mobile__menu-list li a:hover i {
    color: var(--wyd-primary);
}

/* 활성 메뉴 항목 */
.gnb-mobile__menu-list li a.active {
    background: rgba(var(--wyd-primary-rgb, 29,72,161), 0.08);
    color: var(--wyd-primary);
    font-weight: 600;
}
.gnb-mobile__menu-list li a.active i {
    color: var(--wyd-primary);
}
.gnb-mobile__menu-list li a.active::after {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--wyd-primary);
    border-radius: 50%;
    flex-shrink: 0;
}

/* ------------------------------------------------------------------
   D-Day 위젯 (.dday-widget) — 헤더 아래
   ------------------------------------------------------------------ */
.dday-widget {
    background: linear-gradient(135deg, var(--wyd-primary), var(--wyd-primary-dark));
    color: #fff;
    text-align: center;
    padding: 6px 16px;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}
.dday-widget__label {
    margin-right: 8px;
    opacity: 0.9;
}
.dday-widget__counter {
    font-weight: 600;
}
.dday-widget strong {
    color: var(--wyd-accent);
    font-weight: 700;
}

/* ------------------------------------------------------------------
   body 여백 (fixed 헤더 높이만큼)
   ------------------------------------------------------------------ */
body {
    padding-top: 64px;
}

/* ------------------------------------------------------------------
   반응형: 모바일 (768px 미만)
   ------------------------------------------------------------------ */
@media (max-width: 767px) {
    .gnb-wrap {
        height: 56px;
        padding: 0 12px;
    }

    /* 데스크톱 메뉴/인증 숨김 */
    .gnb-nav {
        display: none;
    }
    .gnb-auth {
        display: none;
    }

    /* 햄버거 버튼 표시 */
    .gnb-hamburger {
        display: flex;
        z-index: 450; /* 오버레이 위에 표시 */
        position: relative;
    }

    .gnb-logo .logo img {
        height: 28px;
    }
    .gnb-wyd-logo img {
        height: 78px;
        margin-top: -24px;
        padding-top: 8px;
    }

    .dday-widget {
        font-size: 0.78rem;
        padding: 5px 12px;
    }

    body {
        padding-top: 56px;
    }
}

/* ------------------------------------------------------------------
   반응형: 태블릿 (768px ~ 1023px)
   ------------------------------------------------------------------ */
@media (min-width: 768px) and (max-width: 1023px) {
    .gnb-menu__item a {
        padding: 8px 8px;
        font-size: 0.8rem;
    }
    .gnb-user__name {
        display: none;
    }
}
