/* bn-site-chrome.css — 사이트 공통 헤더(2행 레이아웃) 스타일
 *
 * Phase 2A: header.php 인라인 <style>에서 분리.
 * Phase 2B: 헤더/네비/드롭다운/브레드크럼 하드코딩 색상을 토큰으로 치환.
 *           - --bn-chrome-bg / --bn-chrome-bgDeep / --bn-chrome-fg (헤더 전용)
 *           - --bn-bg / --bn-ink2 / --bn-surface / --bn-line / --bn-muted / --bn-mutedSoft (공통)
 *           Daylight: 기존 #0f3460 톤 유지 / Vault: 자동으로 다크 헤더.
 *           멤버십 배지·BETA 배지의 의미색은 Phase 5 sweep에서 일괄 토큰화.
 * Phase 2C: TopBar 마크업이 핸드오프 구조로 재작성되면서 클래스 일부 정리 예정.
 */

/* ============================================================
   SITE HEADER — 2행 레이아웃 (1행: 로고+액션 / 2행: 네비게이션)
   ============================================================ */

body { font-family: 'Noto Sans KR', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; }
.header, .nav { display: none !important; }

/* ── 상단바 (로고+액션) — 스크롤 시 사라짐 ─────────── */
.sh-topbar {
    background: var(--bn-chrome-bg);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* ── 스티키 네비게이션 바 ─────────────────────────── */
.site-header {
    background: var(--bn-chrome-bg);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(15,52,96,0.4);
}
.sh-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
}

/* ── 1행: 로고 + 액션 ─────────────────────────────── */
.sh-top {
    height: 52px;
    display: flex;
    align-items: center;
    width: 100%;
}

/* ── 로고 ─────────────────────────────────────────── */
.sh-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: auto;
}
.sh-logo-img {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.92;
}

/* ── 햄버거 (모바일 전용) ─────────────────────────── */
.sh-hamburger {
    display: none !important;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px;
    position: relative;
    margin-left: 8px;
}
.sh-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: rgba(255,255,255,0.88);
    border-radius: 2px;
    transition: all 0.25s;
}
.sh-hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 7px); }
.sh-hamburger.active span:nth-child(2) { opacity: 0; }
.sh-hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -7px); }

/* ── 액션 영역 (1행 우측) ─────────────────────────── */
.sh-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sh-user-name { font-size: 0.82em; color: rgba(255,255,255,0.78); white-space: nowrap; }
.sh-greeting { display: flex; align-items: center; gap: 10px; }
.sh-greeting-date { font-size: 0.72em; color: rgba(255,255,255,0.45); white-space: nowrap; }
.sh-greeting-msg { font-size: 0.88em; font-weight: 700; color: #fff; white-space: nowrap; }
.sh-greeting-sub { font-size: 0.74em; color: rgba(255,255,255,0.55); white-space: nowrap; }
.sh-membership-badge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 9px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.88);
    border: 1px solid rgba(255,255,255,0.2);
    text-decoration: none;
}
.sh-membership-badge.basic  { background: rgba(251,191,36,0.2);  color: #fbbf24; border-color: rgba(251,191,36,0.3); }
.sh-membership-badge.premium{ background: rgba(99,102,241,0.2);  color: #a5b4fc; border-color: rgba(99,102,241,0.3); }
.sh-expiry-badge {
    display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
    border-radius: 10px; font-size: 10px; font-weight: 700; text-decoration: none;
}
.sh-expiry-badge.warning { background: rgba(251,191,36,0.25); color: #fbbf24; border: 1px solid rgba(251,191,36,0.4); }
.sh-expiry-badge.urgent  { background: rgba(239,68,68,0.25);  color: #fca5a5; border: 1px solid rgba(239,68,68,0.4); animation: blink 1.5s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.55} }
.sh-points-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 10px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.78);
    border: 1px solid rgba(255,255,255,0.18);
    text-decoration: none;
    transition: background 0.15s;
    font-family: 'DM Sans', sans-serif;
}
.sh-points-badge:hover { background: rgba(255,255,255,0.2); color: #fff; }
.sh-points-badge.empty { background: rgba(239,68,68,0.2); color: #fca5a5; border-color: rgba(239,68,68,0.35); }
.sh-points-badge.empty::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #ef4444; margin-right: 4px; animation: blink 1.5s ease-in-out infinite; }
.sh-upgrade-link { font-size: 10px; color: rgba(251,191,36,0.9); text-decoration: none; font-weight: 600; margin-left: 2px; }
.sh-upgrade-link:hover { color: #fbbf24; text-decoration: underline; }
.sh-user-links { display: flex; align-items: center; gap: 2px; }
.sh-user-links a {
    font-size: 0.8em;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    padding: 5px 8px;
    border-radius: 6px;
    transition: all 0.14s;
    white-space: nowrap;
}
.sh-user-links a:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ── 테마 토글 (헤더 우측, 헤더 톤에 맞게 반투명 흰 사용) ── */
.sh-theme-toggle {
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.85);
    border-radius: 7px; cursor: pointer;
    font-size: 13px; line-height: 1;
    transition: background .14s, border-color .14s, color .14s;
    flex-shrink: 0;
}
.sh-theme-toggle:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.4);
    color: #fff;
}
.sh-btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 0.845em;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.14s;
    white-space: nowrap;
    font-family: 'DM Sans', 'Noto Sans KR', sans-serif;
}
.sh-btn--ghost { border: 1.5px solid rgba(255,255,255,0.38); color: rgba(255,255,255,0.88); background: transparent; }
.sh-btn--ghost:hover { border-color: rgba(255,255,255,0.75); color: #fff; background: rgba(255,255,255,0.08); }
.sh-btn--solid { background: var(--bn-chrome-fg); color: var(--bn-chrome-bg); border: 1.5px solid var(--bn-chrome-fg); }
.sh-btn--solid:hover { background: #e4eef9; border-color: #e4eef9; }

/* ── 2행: 네비게이션 ─────────────────────────────── */
.sh-nav-row {
    display: flex;
    align-items: center;
    height: 42px;
}
.sh-nav { flex: 1; }
.sh-nav > ul {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}
.sh-nav > ul > li { position: relative; }
/* 첫 메뉴 항목의 좌측 padding 제거 — 로고/브레드크럼/페이지 타이틀과 좌측 정렬 */
.sh-nav > ul > li:first-child > a { padding-left: 0 !important; }
/* 메뉴 항목 사이 세로 구분선 */
.sh-nav > ul > li + li::before {
    content: '';
    display: inline-block;
    width: 1px;
    height: 14px;
    background: rgba(255,255,255,0.22);
    margin-right: 8px;
    vertical-align: middle;
}
.sh-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start !important;
    gap: 5px;
    color: rgba(255,255,255,0.78);
    text-decoration: none;
    padding: 8px 18px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    transition: background 0.14s, color 0.14s;
    white-space: nowrap;
}
.sh-nav a:hover,
.sh-nav li.active > a.dropdown-toggle { background: rgba(255,255,255,0.11); color: #fff; }
/* 메뉴 아이콘 숨김 — 텍스트만 노출 (cleaner look) */
.sh-nav .lucide-nav { display: none !important; }
.sh-nav .arrow { opacity: 0.5; font-weight: 300; font-size: 1.1em; }
.sh-nav .badge-beta {
    font-size: 9px; background: #e53e3e; color: #fff;
    padding: 1px 5px; border-radius: 8px; font-weight: 700; vertical-align: middle;
}

/* ── 드롭다운 ─────────────────────────────────────── */
.sh-nav li.has-dropdown { position: relative; }
.sh-nav .dropdown-menu {
    display: none !important;
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bn-bg);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(15,52,96,0.18);
    padding: 6px 0;
    min-width: max-content;
    z-index: 10000 !important;
    border: 1px solid var(--bn-line);
    flex-direction: column !important;
}
.sh-nav li.has-dropdown:hover > .dropdown-menu,
.sh-nav li.has-dropdown.open > .dropdown-menu { display: flex !important; }
.sh-nav li.has-dropdown::after {
    content: ''; position: absolute; top: 100%; left: 0; right: 0; height: 10px;
}
.sh-nav .dropdown-menu li { list-style: none; flex: none !important; }
.sh-nav .dropdown-menu li a {
    display: block !important; color: var(--bn-ink2) !important; background: transparent !important;
    border-left: 3px solid transparent; padding: 11px 22px !important;
    font-size: 15px; font-weight: 500; transition: all 0.14s;
    white-space: nowrap; text-align: left !important; border-radius: 0 !important;
}
.sh-nav .dropdown-menu li a:hover { background: var(--bn-surfaceHi) !important; border-left-color: var(--bn-primary); color: var(--bn-primary) !important; }
.sh-nav .dropdown-menu li a.active { color: var(--bn-primary) !important; font-weight: 700; border-left-color: var(--bn-primary); background: var(--bn-surfaceHi) !important; }

/* ── 모바일 ───────────────────────────────────────── */
.sh-mobile-links { display: none; }

@media (max-width: 768px) {
    /* 모바일: 상단바(topbar)가 sticky로 따라다님 */
    .sh-topbar { position: sticky; top: 0; z-index: 2003; }
    /* 모바일에선 .site-header 컨테이너의 빈 공간 제거.
       자식 .sh-nav-row는 fixed 드로어이므로 height:0 으로 영역만 없애면 됨. */
    .site-header {
        position: static; box-shadow: none;
        background: transparent; height: 0; overflow: visible;
    }
    .site-header > .sh-inner { height: 0; padding: 0; }
    .sh-topbar > .sh-inner { height: 54px; padding: 0 16px; }
    .sh-top { height: 100%; flex: 1; min-width: 0; }
    .sh-hamburger { display: flex !important; }
    .sh-actions { display: none; }

    /* 모바일 드로어 */
    .sh-nav-row {
        display: none;
        position: fixed;
        top: 54px;
        left: 0; right: 0; bottom: 0;
        background: var(--bn-chrome-bgDeep);
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        overflow-y: auto;
        z-index: 2000 !important;
    }
    .sh-nav-row.active { display: flex; }

    .sh-nav { width: 100%; }
    .sh-nav > ul { flex-direction: column; gap: 0; }
    .sh-nav > ul > li { width: 100%; }
    .sh-nav > ul > li + li::before { display: none; }
    .sh-nav a {
        color: rgba(255,255,255,0.8); padding: 13px 20px !important;
        border-radius: 0 !important; font-size: 0.94em !important;
        justify-content: flex-start !important;
        border-bottom: 1px solid rgba(255,255,255,0.07);
        width: 100%; box-sizing: border-box;
    }
    .sh-nav a:hover { background: rgba(255,255,255,0.07); color: #fff; }
    .sh-nav .dropdown-menu {
        position: static !important; transform: none !important;
        box-shadow: none !important; border: none !important;
        background: rgba(0,0,0,0.22) !important; border-radius: 0 !important;
        padding: 0 !important; min-width: 100% !important; display: none !important;
    }
    .sh-nav li.has-dropdown.open > .dropdown-menu { display: flex !important; }
    .sh-nav .dropdown-menu li a {
        color: rgba(255,255,255,0.68) !important;
        padding: 11px 20px 11px 36px !important;
        border-left: none !important;
        border-bottom: 1px solid rgba(255,255,255,0.05) !important;
        background: transparent !important; font-size: 0.88em !important;
    }
    .sh-nav .dropdown-menu li a:hover { background: rgba(255,255,255,0.08) !important; color: #fff !important; }
    .sh-nav .lucide-nav { color: rgba(255,255,255,0.45); }

    .sh-mobile-links {
        display: flex; flex-direction: column; width: 100%;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    .sh-mobile-links a {
        padding: 12px 20px; color: rgba(255,255,255,0.68); text-decoration: none;
        font-size: 0.9em; display: flex; align-items: center; gap: 8px;
        border-bottom: 1px solid rgba(255,255,255,0.06); transition: background 0.12s;
    }
    .sh-mobile-links a:hover { background: rgba(255,255,255,0.08); color: #fff; }
    .sh-mobile-links .lucide-nav { color: rgba(255,255,255,0.45); }
    .sh-mobile-theme-toggle {
        padding: 12px 20px; color: rgba(255,255,255,0.68);
        font-size: 0.9em; display: flex; align-items: center; gap: 8px;
        border: none; border-bottom: 1px solid rgba(255,255,255,0.06);
        background: transparent; cursor: pointer; width: 100%;
        font-family: inherit; text-align: left;
        transition: background 0.12s;
    }
    .sh-mobile-theme-toggle:hover { background: rgba(255,255,255,0.08); color: #fff; }
    .sh-mobile-theme-toggle [data-bn-theme-icon] { color: rgba(255,255,255,0.45); font-size: 14px; }
}

/* ── FlowStrip (핸드오프 layout.jsx 의 연속성 인디케이터) ─── */
.bn-flow-strip {
    background: var(--bn-surface);
    border-top: 1px solid var(--bn-line);
    border-bottom: 1px solid var(--bn-line);
    padding: 10px 24px;
    display: flex; align-items: center; gap: 0;
    overflow-x: auto;
}
.bn-flow-strip__label {
    font-family: var(--bn-font-mono);
    font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bn-mutedSoft);
    margin-right: 14px; flex-shrink: 0;
}
.bn-flow-strip__step {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: 7px;
    background: transparent; text-decoration: none;
    border: 1px solid transparent;
    transition: background .45s ease, border-color .45s ease, box-shadow .45s ease, transform .45s ease;
    flex-shrink: 0;
}
.bn-flow-strip__step:hover {
    background: var(--bn-surface2);
    border-color: var(--bn-line);
    text-decoration: none;
}
.bn-flow-strip__num {
    font-family: var(--bn-font-mono);
    font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
    color: var(--bn-mutedSoft);
    min-width: 18px;
    transition: color .45s ease;
}
.bn-flow-strip__name {
    font-size: 12.5px; font-weight: 500;
    color: var(--bn-ink2);
    transition: color .45s ease;
}
.bn-flow-strip__sub {
    font-size: 12px; color: var(--bn-mutedSoft);
    transition: color .45s ease;
}

/* 자동 순환 하이라이트 — 권장 순서 가이드 */
.bn-flow-strip__step.is-hl {
    background: var(--bn-ok);
    border-color: var(--bn-ok);
    box-shadow: 0 2px 10px rgba(60,179,113,0.32);
    transform: translateY(-1px);
}
.bn-flow-strip__step.is-hl:hover { background: color-mix(in srgb, var(--bn-ok) 88%, #000); }
.bn-flow-strip__step.is-hl .bn-flow-strip__num,
.bn-flow-strip__step.is-hl .bn-flow-strip__name {
    color: #fff;
    font-weight: 700;
}
.bn-flow-strip__step.is-hl .bn-flow-strip__sub { color: rgba(255,255,255,0.92); }

.bn-flow-strip__sep {
    color: var(--bn-mutedSoft);
    margin: 0 6px;
    font-size: 14px;
    flex-shrink: 0;
    user-select: none;
}

@media (max-width: 768px) {
    .bn-flow-strip { padding: 10px 16px; gap: 6px; }
    .bn-flow-strip__sub { display: none; }
    .bn-flow-strip__step { padding: 4px 8px; gap: 5px; }
    .bn-flow-strip__sep { margin: 0 2px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .bn-flow-strip__step,
    .bn-flow-strip__num,
    .bn-flow-strip__name,
    .bn-flow-strip__sub { transition: none; }
    .bn-flow-strip__step.is-hl { transform: none; }
}

/* ── 브레드크럼 ───────────────────────────────────── */
.breadcrumb-container { background: var(--bn-surface); border-bottom: 1px solid var(--bn-line); padding: 10px 0; }
.breadcrumb {
    max-width: 1160px; margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--bn-muted);
}
.breadcrumb a { color: var(--bn-muted); text-decoration: none; transition: color 0.15s; }
.breadcrumb a:hover { color: var(--bn-chrome-bg); }
.breadcrumb .separator { color: var(--bn-mutedSoft); }
.breadcrumb .current { color: var(--bn-chrome-bg); font-weight: 600; }
