/*
 * 허브 공통 틀(헤더 · 푸터 · 모바일 하단 바) — 시안 B. 클래스 접두어 hb- (본문 CSS 와 겹치지 않게).
 * 색은 tokens.css 의 의미 토큰(--c-*)만 쓴다 → 라이트/다크 전환이 기존 화면과 같이 움직인다.
 * 쓰는 곳: layouts/main · game · hub (game/partials/header.php · footer.php · bottom-nav.php)
 */
.hb-gnb {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--c-header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
  font-family: var(--font-body);
}
.hb-gnb__in {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.hb-logo {
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.04em;
  color: var(--c-text);
  white-space: nowrap;
  text-decoration: none;
}
.hb-logo b {
  color: var(--c-accent);
}
.hb-logo:hover {
  color: var(--c-text);
}
.hb-nav {
  display: flex;
  gap: 2px;
  min-width: 0;
}
.hb-nav a {
  padding: 8px 11px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--c-text-muted);
  white-space: nowrap;
  text-decoration: none;
}
.hb-nav a:hover {
  color: var(--c-text);
  background: var(--c-surface-2);
}
.hb-nav a[aria-current="page"] {
  color: var(--c-text);
  background: var(--c-surface-2);
  box-shadow: inset 0 -2px 0 var(--c-accent);
  border-radius: 8px 8px 0 0;
}
.hb-sp {
  flex: 1;
}
.hb-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--c-surface-2);
  color: var(--c-text-muted);
  width: 240px;
  margin: 0;
}
.hb-search svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.hb-search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  color: var(--c-text);
  font: inherit;
  font-size: 13.5px;
  padding: 0;
}
.hb-search input::placeholder {
  color: var(--c-text-muted);
  opacity: 0.8;
}
.hb-search--block {
  width: 100%;
  margin-bottom: 10px;
}
.hb-icon {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--c-text);
  background: none;
  border: 0;
  cursor: pointer;
  flex: none;
  list-style: none;
}
.hb-icon::-webkit-details-marker {
  display: none;
}
/* 오른쪽 아이콘 묶음(테마 · 알림 · 마이 · 메뉴) — 메뉴용 간격 22px 대신 6px 로 붙여 한 덩어리로 (761px 이상, 모바일은 이미 6px) */
@media (min-width: 761px) {
  .hb-icon + .hb-icon,
  .hb-icon + .hb-btn,
  .hb-icon + .hb-drawer,
  .hb-btn + .hb-drawer {
    margin-left: -16px;
  }
  .hb-search + .hb-icon {
    margin-left: -8px;
  }
}
.hb-icon:hover {
  background: var(--c-surface-2);
  color: var(--c-text);
}
.hb-icon svg {
  width: 19px;
  height: 19px;
}
.hb-icon .icon-sun {
  display: none;
}
:root[data-theme="light"] .hb-icon .icon-sun {
  display: block;
}
:root[data-theme="light"] .hb-icon .icon-moon {
  display: none;
}
.hb-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-accent);
}
.hb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
}
.hb-btn svg {
  width: 16px;
  height: 16px;
}
.hb-btn--brand {
  background: var(--c-accent);
  color: var(--c-on-accent);
}
.hb-btn--brand:hover {
  color: var(--c-on-accent);
  filter: brightness(1.07);
}
.hb-btn--ghost {
  border-color: var(--c-border);
  color: var(--c-text);
}
.hb-btn--ghost:hover {
  border-color: var(--c-text-muted);
  color: var(--c-text);
}

/* 서랍 메뉴 (넓은 화면에서는 숨김) */
.hb-drawer {
  display: none;
  position: relative;
}
.hb-drawer[open] > .hb-icon {
  background: var(--c-surface-2);
}
.hb-drawer__panel {
  position: fixed;
  top: 64px;
  right: 0;
  left: 0;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 16px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-pop);
}
.hb-drawer__panel nav {
  display: grid;
  gap: 2px;
}
.hb-drawer__panel nav a {
  padding: 12px;
  border-radius: 10px;
  font-weight: 600;
  color: var(--c-text);
  text-decoration: none;
}
.hb-drawer__panel nav a[aria-current="page"] {
  background: var(--c-surface-2);
  color: var(--c-accent-text);
}
.hb-drawer__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.hb-drawer__actions .hb-btn {
  height: 44px;
}

/* 푸터 */
.hb-foot {
  margin-top: 80px;
  border-top: 1px solid var(--c-border);
  color: var(--c-text-muted);
  font-size: 13px;
  font-family: var(--font-body);
}
.hb-foot__in {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 24px 60px;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.hb-foot p {
  margin: 8px 0 4px;
  max-width: 520px;
  line-height: 1.6;
}
.hb-foot nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.hb-foot nav a {
  color: var(--c-text-muted);
  text-decoration: none;
}
.hb-foot nav a:hover {
  color: var(--c-text);
}

/* 모바일 하단 바 (layouts/hub 는 components.css 를 안 불러서 여기에도 둔다) */
.bottom-nav {
  display: none;
}

@media (max-width: 1180px) {
  .hb-search {
    display: none;
  }
  .hb-nav a {
    padding: 8px 8px;
    font-size: 14px;
  }
}
@media (max-width: 1000px) {
  .hb-nav {
    display: none;
  }
  .hb-drawer {
    display: block;
  }
}
@media (max-width: 760px) {
  .hb-gnb__in {
    padding: 0 12px;
    gap: 6px;
  }
  .hb-hide-sm {
    display: none;
  }
  .hb-foot {
    padding-bottom: 72px;
  }
  .bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: 64px;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--c-border);
    background: var(--c-surface);
  }
  .bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    color: var(--c-text-muted);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
  }
  .bottom-nav__item svg {
    width: 22px;
    height: 22px;
  }
  .bottom-nav__item[aria-current="page"] {
    color: var(--c-accent-text);
  }
}

/* ATOREUM 로고 점 */
.hb-logo-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3fe0c5;
  margin-left: 3px;
  vertical-align: 2px;
}

/* 업로드 로고 (관리자 › 설정 › 로고 관리) — 테마별 한 장만 표시 */
.hb-logo {
  display: inline-flex;
  align-items: center;
}
.hb-logo img {
  display: block;
  height: 20px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}
.hb-logo .logo--on-light {
  display: none;
}
:root[data-theme="light"] .hb-logo .logo--on-dark {
  display: none;
}
:root[data-theme="light"] .hb-logo .logo--on-light {
  display: block;
}
