/* ─────────────────────────────────────────────────────────────
   공용 상단 네비 — templates/partials/site_nav.html 의 짝

   랜딩과 문서 페이지(정책 4종·고객문의)가 같은 네비를 쓰므로
   이 파일이 .lp-nav / .lp-account 계열을 단독으로 소유합니다.
   네비를 쓰는 화면은 반드시 이 파일을 함께 읽어야 합니다.
   ───────────────────────────────────────────────────────────── */

/* ── 상단 네비 ───────────────────────────────────────────── */
.lp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 11px clamp(20px, 5vw, 48px);
  border-bottom: 1px solid var(--border);
}

/* 브랜드는 홈으로 가는 링크입니다(원본이 랜딩을 가리킴). */
.lp-brand {
  font: 700 19px var(--font-serif);
  letter-spacing: .5px;
  color: var(--text);
  text-decoration: none;
}

.lp-nav-menu {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(9px, 2vw, 16px);
}

/* ── 모바일 햄버거 · 드로어 (데스크톱에서는 감춤) ──────────────
   토글과 백드롭은 여기서 모양만 정의하고, 실제로 드러나는 것은
   아래 @media (max-width: 768px) 블록입니다. */
.lp-nav-toggle {
  display: none;   /* 모바일 미디어쿼리에서만 보입니다. */
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--control-bg);
  cursor: pointer;
  transition: border-color .2s ease;
}

.lp-nav-toggle:hover { border-color: var(--accent); }

.lp-nav-toggle-bar {
  width: 18px;
  height: 2px;
  margin: 0 auto;
  border-radius: 2px;
  background: var(--text);
  transition: transform .25s ease, opacity .2s ease;
}

/* 열린 상태 — 세 줄이 X 로 접힙니다. */
.lp-nav.is-open .lp-nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.lp-nav.is-open .lp-nav-toggle-bar:nth-child(2) { opacity: 0; }
.lp-nav.is-open .lp-nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.lp-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, .45);
}

.lp-nav-backdrop[hidden] { display: none; }

.lp-nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color .25s ease;
}

.lp-nav-link:hover { color: var(--text); }

.lp-nav-login {
  text-decoration: none;
  padding: 9px 20px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  transition: all .25s ease;
}

.lp-nav-login:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.lp-nav-cta {
  text-decoration: none;
  padding: 9px 20px;
  background: var(--accent);
  color: var(--accent-on);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  transition: all .25s ease;
}

.lp-nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px var(--accent-shadow);
}

/* ── 인증 대기 배지 (로그인 후 · 미승인) ─────────────────── */
.lp-nav-pending {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
}

/* ── 계정 메뉴 ───────────────────────────────────────────── */
.lp-account { position: relative; }

/* 계정 버튼 — 이름 텍스트 없이 원 하나에 첫 글자(디자인의 결제 페이지 상단바와 동일). */
.lp-account-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--accent-on);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font: 700 14px var(--font-serif);
  transition: all .2s;
}

.lp-account-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--accent-shadow);
}

.lp-account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-on);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 13px var(--font-serif);
}

.lp-account-avatar--lg {
  width: 36px;
  height: 36px;
  font-size: 15px;
}

/* 바깥을 눌러 닫기 위한 투명 판. */
.lp-account-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.lp-account-menu {
  position: absolute;
  top: 50px;
  right: 0;
  z-index: 41;
  min-width: 230px;
  padding: 8px;
  background: var(--control-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .2);
  animation: lp-pop .18s;
}

.lp-account-menu[hidden],
.lp-account-backdrop[hidden] { display: none; }

.lp-account-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.lp-account-fullname {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.lp-account-email {
  margin-top: 1px;
  font-size: 12px;
  color: var(--text-faint);
}

.lp-account-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 9px;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}

.lp-account-item:hover { background: var(--bg-alt); }

/* 미승인 사용자에게만 보이는 강조 항목. */
.lp-account-item--accent {
  color: var(--accent);
  font-weight: 700;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

/* 지금 보고 있는 화면 (원본은 옅은 배경으로 표시합니다). */
.lp-account-item--on { background: var(--surface-band); }

.lp-account-item--muted { color: var(--text-muted); }

.lp-account-divider {
  height: 1px;
  margin: 6px 8px;
  background: var(--border);
}

/* 계정 메뉴가 뜰 때의 팝 애니메이션. */
@keyframes lp-pop {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ── 모바일: 우측 슬라이드 드로어 ─────────────────────────────
   JS 가 있을 때만 드로어로 바꿉니다. no-js 에서는 메뉴를 열 수단이
   없으므로 기존처럼 아래로 접힌 채(flex-wrap) 그대로 둡니다. */
@media (max-width: 768px) {
  html:not(.no-js) .lp-nav-toggle {
    display: inline-flex;
    position: relative;
    z-index: 65;   /* 열렸을 때 드로어(60) 위에 남아 X 로 닫을 수 있게. */
  }

  html:not(.no-js) .lp-nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    width: min(82vw, 300px);
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 2px;
    padding: 74px 22px 28px;
    background: var(--control-bg);
    border-left: 1px solid var(--border);
    box-shadow: -18px 0 46px rgba(0, 0, 0, .28);
    overflow-y: auto;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .28s ease, visibility .28s ease;
  }

  html:not(.no-js) .lp-nav.is-open .lp-nav-menu {
    transform: none;
    visibility: visible;
  }

  /* 드로어 안에서는 항목을 세로로 쌓고 탭 영역을 넓힙니다. */
  html:not(.no-js) .lp-nav-menu .lp-nav-link {
    padding: 13px 4px;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
  }

  html:not(.no-js) .lp-nav-menu .theme-toggle {
    align-self: flex-start;
    margin-top: 6px;
  }

  html:not(.no-js) .lp-nav-login,
  html:not(.no-js) .lp-nav-cta {
    margin-top: 10px;
    text-align: center;
  }

  html:not(.no-js) .lp-nav-pending {
    justify-content: center;
    margin-top: 10px;
  }

  /* 계정 메뉴는 드로어 안에서 떠 있는 팝오버 대신 인라인으로 펼칩니다. */
  html:not(.no-js) .lp-account { position: static; margin-top: 10px; }
  /* 계정 버튼은 이제 원 하나라 드로어에서도 그대로 둡니다(스트레치 금지). */

  html:not(.no-js) .lp-account-menu {
    position: static;
    min-width: 0;
    margin-top: 8px;
    box-shadow: none;
    animation: none;
  }

  /* 드로어 자체가 바깥 클릭으로 닫히므로 계정 전용 백드롭은 접습니다. */
  html:not(.no-js) .lp-account-backdrop { display: none; }
}

/* ── 모션 최소화 선호 ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .lp-account-menu { animation: none; }
  .lp-nav-cta:hover { transform: none; }
  .lp-nav-menu { transition: none; }
  .lp-nav-toggle-bar { transition: none; }
}
