/* ============================================================
   main.css — 스캔모어 홈페이지 공통 스타일시트
   ============================================================ */

/* ── 1. RESET & BASE ───────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── 2. CSS VARIABLES ──────────────────────────────────────── */
:root {
    --blue:       #1B5FE8;
    --blue-dark:  #1450CC;
    --blue-light: #EBF1FF;
    --teal:       #00B4D8;
    --orange:     #FF6B2C;
    --green:      #00C97A;
    --text:       #0F1C35;
    --text-2:     #3D5278;
    --text-3:     #6B82A8;
    --white:      #FFFFFF;
    --surface:    #F5F8FF;
    --border:     #D6E2FF;
    --font:       'Noto Sans KR', sans-serif;
    --mono:       'DM Mono', monospace;
}

/* ── 3. GLOBAL ─────────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font), serif;
    background: var(--white);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.7;
    /* sticky footer: 콘텐츠가 짧아도 footer가 화면 하단에 위치 */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── 4. NAVIGATION ─────────────────────────────────────────── */
header nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5vw;
    height: 68px;
    background: rgba(255, 255, 255, 0.93);
    /* backdrop-filter는 ::before로 분리 — nav에 직접 쓰면 자식 position:fixed 요소의
       containing block이 nav로 바뀌어 모바일 패널 좌표가 뷰포트 기준이 아닌 nav 기준이 됨 */
    border-bottom: 1px solid rgba(27, 95, 232, 0.1);
    box-shadow: 0 2px 20px rgba(27, 95, 232, 0.06);
}

header nav::before {
    content: '';
    position: absolute;
    inset: 0;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: -1;
}

.logo {
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.logo-mark {
    width: 36px;
    height: 36px;
    background: var(--blue);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-mark svg {
    width: 20px;
    height: 20px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    color: var(--blue);
}

.logo-text span {
    color: var(--orange);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--blue);
}

.nav-cta {
    font-size: 0.875rem;
    font-weight: 700;
    padding: 10px 24px;
    background: var(--blue);
    color: #fff;
    border-radius: 100px;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(27, 95, 232, 0.3);
}

.nav-cta:hover {
    background: var(--blue-dark);
    transform: translateY(-1px);
}

/* ── 5. DROPDOWN MENU ──────────────────────────────────────── */
.nav-links li {
    position: relative;
}

/* padding-bottom bridges the gap between the nav link and dropdown,
   keeping :hover active while the mouse travels across the gap */
.has-dropdown {
    padding-bottom: 12px;
}

.has-dropdown > a::after {
    content: ' ▾';
    font-size: 0.7em;
    color: var(--text-3);
    vertical-align: middle;
}

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(27, 95, 232, 0.13);
    border: 1px solid var(--border);
    min-width: 160px;
    padding: 8px 0;
    list-style: none;
    z-index: 1001;
    white-space: nowrap;
}

.dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: var(--white);
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
    rotate: 45deg;
}

.has-dropdown:hover .dropdown {
    display: block;
}

.dropdown li {
    position: static;
}

.dropdown a {
    display: block;
    padding: 10px 22px;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-2);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.dropdown a:hover {
    background: var(--blue-light);
    color: var(--blue);
}

/* ── 6. HAMBURGER BUTTON ───────────────────────────────────── */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
    transform-origin: center;
}

.nav-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── 7. OVERLAY ────────────────────────────────────────────── */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 28, 53, 0.45);
    z-index: 998;
}

.nav-overlay.is-open { display: block; }

/* mobile-cta-item은 데스크탑에서 숨김 */
.mobile-cta-item { display: none; }

/* ── 8. MOBILE NAV (≤768px) ────────────────────────────────── */
@media (max-width: 768px) {

    .nav-hamburger { display: flex; }
    .nav-cta       { display: none; }

    /* 모바일 전체화면 패널 */
    .nav-links {
        display: none;
        position: fixed;
        top: 68px;
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        gap: 0;
        overflow-y: auto;
        background: var(--white);
        z-index: 999;
        padding-bottom: 32px;
    }

    .nav-links.is-open { display: flex; }

    .nav-links > li {
        position: static;
        border-bottom: 1px solid var(--border);
    }

    .nav-links > li > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 17px 24px;
        font-size: 1rem;
        font-weight: 600;
        color: var(--text);
    }

    /* 아코디언 토글 아이콘 */
    .has-dropdown > a::after {
        content: '+';
        font-size: 1.3rem;
        font-weight: 300;
        color: var(--text-3);
    }

    .has-dropdown.is-open > a::after {
        content: '−';
        color: var(--blue);
    }

    /* 호버 드롭다운 비활성화, 클래스 기반으로만 동작 */
    .has-dropdown:hover .dropdown  { display: none; }
    .has-dropdown.is-open .dropdown { display: block; }

    /* 모바일 드롭다운 아코디언 스타일 */
    .dropdown {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0;
        background: var(--surface);
    }

    .dropdown::before { display: none; }

    .dropdown a {
        padding: 14px 24px 14px 40px;
        font-size: 0.875rem;
        border-bottom: 1px solid rgba(214, 226, 255, 0.5);
    }

    .dropdown li:last-child a { border-bottom: none; }

    /* 모바일 패널 하단 CTA */
    .mobile-cta-item {
        display: block;
        border-bottom: none !important;
        padding: 20px 24px 0;
    }

    .mobile-cta-item .nav-cta {
        display: block;
        text-align: center;
        padding: 14px 24px;
        border-radius: 12px;
        font-size: 0.95rem;
    }
}

/* ── FOOTER ──────────────────────────────────────────────────── */
footer {
  background: var(--text);
  padding: 3rem 5vw 2rem;
  /* 남는 세로 공간을 위로 밀어 footer를 항상 하단에 고정 */
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin: 0 auto 1.5rem;
}

.footer-logo-text {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #fff;
}

.footer-logo-text span { color: var(--orange); }

.footer-desc {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.75rem;
  line-height: 1.8;
}

.footer-col h5 {
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-col ul li a {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col ul li a:hover { color: #fff; }

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-bottom p {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
}

html, body {
                height: 100%;
            }
            body {
                display: flex;
                flex-direction: column;
            }
            .th-layout-main {
                flex-grow: 1;
            }

            /* ── 사용자 메뉴 (데스크톱) ── */
            .nav-user {
              display: flex;
              align-items: center;
              gap: 8px;
              margin-left: 10px;
            }
            .nav-user-link {
              font-size: 0.85rem;
              font-weight: 600;
              color: var(--text-2);
              text-decoration: none;
              padding: 6px 12px;
              border-radius: 8px;
              transition: background 0.2s, color 0.2s;
              white-space: nowrap;
            }
            .nav-user-link:hover { background: var(--blue-light); color: var(--blue); }
            .nav-user-join {
              background: var(--blue);
              color: #fff !important;
            }
            .nav-user-join:hover { background: var(--blue-dark) !important; color: #fff !important; }

            .nav-user .has-dropdown { position: relative; }
            .nav-user .has-dropdown > a {
              font-size: 0.85rem;
              font-weight: 600;
              color: var(--text-2);
              text-decoration: none;
              padding: 6px 12px;
              border-radius: 8px;
              display: flex;
              align-items: center;
              gap: 4px;
              white-space: nowrap;
            }
            .nav-user .has-dropdown > a::after { content: '▾'; font-size: 0.65rem; }
            .nav-user .has-dropdown:hover > a { background: var(--blue-light); color: var(--blue); }
            .nav-user .has-dropdown > .dropdown {
              min-width: 140px;
              right: 0;
              left: auto;
              transform: none;
            }
            .nav-user .dropdown .logout-btn {
              background: none;
              border: none;
              width: 100%;
              text-align: left;
              padding: 10px 20px;
              font-size: 0.875rem;
              color: var(--text-2);
              cursor: pointer;
              font-family: inherit;
            }
            .nav-user .dropdown .logout-btn:hover { color: var(--blue); background: var(--blue-light); }

            /* ── 사용자 메뉴 (모바일 — nav-links 안) ── */
            .mobile-auth-item { display: none; }

            @media (max-width: 768px) {
              .nav-user { display: none; }
              .mobile-auth-item { display: block; }
              .mobile-auth-item .logout-btn {
                background: none;
                border: none;
                width: 100%;
                text-align: left;
                padding: 12px 20px;
                font-size: 0.95rem;
                color: var(--text-2);
                cursor: pointer;
                font-family: inherit;
              }
            }