/* ============================================
   Apple-style Header (Glassmorphism)
   ============================================ */

.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(20px, env(safe-area-inset-left));
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-separator, rgba(0,0,0,0.06));
  z-index: 100;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.header__logo {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: contain;
}

.header__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary, #1d1d1f);
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header__nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary, #6e6e73);
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}

.header__nav-link:hover {
  color: var(--color-text-primary, #1d1d1f);
}

.header__nav-link--active {
  color: var(--color-text-primary, #1d1d1f);
  font-weight: 600;
}

.header__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 로그인 pill 버튼 */
.header__login {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary, #6e6e73);
  padding: 5px 14px;
  border-radius: 980px;
  border: 1px solid var(--color-border, rgba(0,0,0,0.1));
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.header__login:hover {
  color: var(--color-accent, #1D2F4E);
  border-color: var(--color-accent, #1D2F4E);
}

/* Hamburger — 항상 표시 */
.header__hamburger {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  width: 20px;
  height: 16px;
  position: relative;
  flex-shrink: 0;
}

.header__hamburger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--color-text-primary, #1d1d1f);
  position: absolute;
  left: 0;
  transition: all 0.25s ease;
}

.header__hamburger span:nth-child(1) { top: 0; }
.header__hamburger span:nth-child(2) { top: 7px; }
.header__hamburger span:nth-child(3) { top: 14px; }

/* Menu */
.header__mobile-menu {
  display: none;
  position: fixed;
  top: 48px;
  right: 0;
  width: 240px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  padding: 8px 0;
  z-index: 99;
  flex-direction: column;
  border: 1px solid var(--color-separator, rgba(0,0,0,0.06));
  border-radius: 0 0 12px 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.header__mobile-menu.open { display: flex; }

.header__mobile-link {
  font-size: 14px;
  font-weight: 500;
  color: #1d1d1f;
  padding: 10px 20px;
  text-decoration: none;
  transition: background 0.15s;
}

.header__mobile-link:hover { background: rgba(0, 0, 0, 0.04); }

/* 메뉴 구분선 */
.header__menu-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 4px 0;
}

/* 계정 영역 (마이페이지/로그아웃) */
.header__menu-auth {
  display: flex;
  flex-direction: column;
}

.header__menu-auth-link {
  font-size: 14px;
  font-weight: 500;
  color: #1d1d1f;
  padding: 10px 20px;
  text-decoration: none;
  transition: background 0.15s;
}

.header__menu-auth-link:hover { background: rgba(0, 0, 0, 0.04); }

.header__menu-auth-link--logout {
  color: #ff3b30;
}

/* 관리자 메뉴 링크 */
.header__menu-auth-link--admin {
  font-size: 13px;
  color: #86868b;
}

/* ============================================
   Admin Sub-Navigation
   ============================================ */

.admin-subnav {
  position: fixed;
  top: 48px;
  left: 0; right: 0;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 max(20px, env(safe-area-inset-left));
  background: var(--penguin-navy, #1D2F4E);
  z-index: 99;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-subnav::-webkit-scrollbar { display: none; }

.admin-subnav__link {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  white-space: nowrap;
  transition: all 0.2s;
}

.admin-subnav__link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.admin-subnav__link--active {
  color: #fff;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
}

/* admin 페이지 body 오프셋 (header 48px + subnav 40px) */
body.admin-page {
  padding-top: 88px;
}

/* 모바일: 자격증 링크만 숨기고 공지사항은 헤더에 유지 */
@media (max-width: 734px) {
  .header__nav-link--cert { display: none; }

  .header__nav {
    gap: 0;
  }

  .header__mobile-menu {
    width: 100%;
    border-radius: 0;
    left: 0;
  }

  .admin-subnav {
    gap: 2px;
    padding: 0 12px;
  }

  .admin-subnav__link {
    font-size: 12px;
    padding: 5px 10px;
  }
}
