/* frontend/css/header.css — 헤더 & 네비게이션 */

/* ── 헤더 ─────────────────────────────────────────── */
.site-header {
  background: var(--ink);
  color: white;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* ── 로고 ─────────────────────────────────────────── */
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--gold-light);
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.logo-sub {
  font-size: 0.68rem;
  color: #aaa;
  font-family: var(--font-sans);
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── 네비 ─────────────────────────────────────────── */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.nav-link {
  color: #ccc;
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border-radius: 4px;
  font-size: 0.875rem;
  transition: all 0.2s;
}
.nav-link:hover        { color: white; background: rgba(255,255,255,0.1); }
.nav-link.active       { color: var(--gold-light); }

/* ── 헤더 인증 버튼 ──────────────────────────────── */
.header-auth {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.header-username {
  font-size: 0.85rem;
  color: #ccc;
}
.btn-outline-light {
  background: transparent;
  border: 1px solid #555;
  color: #ccc;
  padding: 0.4rem 0.9rem;
  border-radius: 5px;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-outline-light:hover { border-color: var(--gold-light); color: var(--gold-light); }

/* ── 모바일 메뉴 버튼 ────────────────────────────── */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  margin-left: auto;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--ink-light);
  border-top: 1px solid rgba(255,255,255,0.08);
}
.mobile-nav a {
  color: #ccc;
  text-decoration: none;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.95rem;
}
.mobile-nav a:hover { background: rgba(255,255,255,0.05); color: white; }
.mobile-nav.open { display: flex; }

/* ── 로그인 알림 박스 ────────────────────────────── */
.login-notice {
  padding: 0.75rem 1rem;
  background: var(--parchment);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 1rem;
}
.login-notice a { color: var(--gold); text-decoration: none; }
.login-notice a:hover { text-decoration: underline; }

/* ── 반응형 ──────────────────────────────────────── */
@media (max-width: 768px) {
  .main-nav        { display: none; }
  .header-auth     { display: none; }
  .mobile-menu-btn { display: block; }
  .logo-sub        { display: none; }
}

/* ── 현재 페이지 네비 활성화 스크립트 지원 ────────── */
.nav-link[data-page].active { color: var(--gold-light); }

/* ── 사이드바 레이아웃 (선택형·사례형 공통) ────────── */
.qbank-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 62px);
  max-width: 1200px;
  margin: 0 auto;
}

.sidebar {
  background: white;
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  position: sticky;
  top: 62px;
  height: calc(100vh - 62px);
  overflow-y: auto;
}

.sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
  margin-top: 1.25rem;
  padding-left: 0.4rem;
}
.sidebar-title:first-child { margin-top: 0; }

.filter-item {
  display: flex;
  align-items: center;
  padding: 0.35rem 0.6rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.15s;
  color: var(--ink);
  user-select: none;
}
.filter-item:hover  { background: var(--parchment); }
.filter-item.active { background: var(--ink); color: white; font-weight: 500; }
.filter-count {
  margin-left: auto;
  font-size: 0.72rem;
  color: #aaa;
  background: var(--parchment);
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
}
.filter-item.active .filter-count { color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.15); }

.main-content {
  padding: 1.5rem;
  min-width: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.result-info { font-size: 0.85rem; color: #666; white-space: nowrap; }

@media (max-width: 900px) {
  .qbank-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

/* ── 모바일: 본문 컨테이너 여백 축소 (좁은 화면 가독폭 확보) ────────── */
@media (max-width: 600px) {
  .main-content { padding: 0.85rem; }
}
