/* apps/web-html/css/nav.css
 * 공통 상단 내비게이션 (DESIGN-01). 모든 화면이 tokens.css 다음에 불러온다.
 * 메뉴는 아이콘 + 짧은 글자. 모바일(≤720px)에서는 하단 탭바로 바뀐다.
 * 화면별 스타일과 섞이지 않게 .nav 아래로만 범위를 둔다 (base.css를 쓰지 않는 화면도 있음).
 */
.nav, .nav * { box-sizing: border-box; }
.nav {
  position: sticky; top: 0; z-index: 30;
  font-family: var(--font-body);
  background: rgba(13, 12, 18, 0.86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--c-line-soft);
}
.nav .navin {
  max-width: var(--w-page); margin: 0 auto; padding: 8px 32px;
  display: flex; align-items: center; gap: 28px;
}
.nav .brand {
  font-family: var(--font-brand); font-weight: 700; font-size: 22px; letter-spacing: 0.08em;
  color: var(--c-text); text-decoration: none; white-space: nowrap;
}
.nav .brand span { color: var(--c-accent); }

.nav .tabs { display: flex; gap: 2px; }
.nav .tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 60px; padding: 6px 10px; border-radius: 10px;
  color: var(--c-text-muted); text-decoration: none; font-size: 11px; font-weight: 500; line-height: 1.2;
  cursor: pointer; user-select: none; white-space: nowrap;
  background: transparent; border: 0;
}
.nav .tab svg { width: 22px; height: 22px; display: block; }
.nav .tab:hover { color: var(--c-text); background: var(--c-surface); }
.nav .tab.active { color: var(--c-text); font-weight: 600; }
.nav .tab.active svg { color: var(--c-accent-text); }

.nav .nav-search {
  margin-left: auto; flex: 0 1 320px;
  display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px;
  border-radius: var(--r-md); background: var(--c-surface); border: 1px solid var(--c-line);
  color: var(--c-text-muted); text-decoration: none; font-size: 14px;
}
.nav .nav-search:hover { border-color: #3A3748; color: var(--c-text); }
.nav .nav-search svg { flex: 0 0 auto; }

@media (max-width: 720px) {
  body { padding-bottom: calc(var(--h-tabbar) + env(safe-area-inset-bottom)); }
  /* backdrop-filter가 있으면 안쪽 position:fixed(하단 탭바)의 기준이 .nav가 되므로 모바일에서는 끈다 */
  .nav { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(13, 12, 18, 0.96); }
  .nav .navin { padding: 10px 16px; gap: 12px; }
  .nav .brand { font-size: 19px; }
  .nav .nav-search { flex: 0 0 44px; height: 44px; padding: 0; justify-content: center; }
  .nav .nav-search .nav-search-text { display: none; }

  /* 상단 메뉴 → 하단 탭바 */
  .nav .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--h-tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0;
    background: rgba(13, 12, 18, 0.96); border-top: 1px solid var(--c-line-soft);
  }
  .nav .tab { min-width: 0; padding: 6px 0; border-radius: 0; color: #8C88A0; }
  .nav .tab:hover { background: transparent; }
}
