/* widgets/main/header/header.css — new theme */

.n-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--n-header-h);
  background: color-mix(in srgb, var(--n-bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--n-line);
  z-index: var(--n-z-header);
}

.n-header__bar {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--n-s-5);
}

/* Brand */
.n-header__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--n-s-2);
  text-decoration: none;
  color: var(--n-text);
  font-weight: var(--n-w-bold);
  font-size: var(--n-fs-md);
  letter-spacing: -0.01em;
  transition: color var(--n-dur-fast) var(--n-ease);
}
.n-header__brand:hover { color: var(--n-accent); }

.n-header__brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: var(--n-text);
  color: var(--n-bg);
  border-radius: 8px;
  font-family: var(--n-font-mono);
  font-size: 14px;
  font-weight: var(--n-w-bold);
  letter-spacing: -0.02em;
}
.n-header__brand-mark span { color: var(--n-accent); margin-left: 1px; }

.n-header__brand-name {
  font-size: var(--n-fs-md);
}

@media (max-width: 560px) {
  .n-header__brand-name { display: none; }
}

/* Primary nav */
.n-header__nav {
  display: flex;
  align-items: center;
  gap: var(--n-s-1);
}
.n-header__nav-link {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 var(--n-s-3);
  border-radius: var(--n-r-xs);
  color: var(--n-text-soft);
  font-size: var(--n-fs-sm);
  font-weight: var(--n-w-med);
  text-decoration: none;
  transition: background var(--n-dur-fast) var(--n-ease),
              color var(--n-dur-fast) var(--n-ease);
}
.n-header__nav-link:hover { background: var(--n-bg-hover); color: var(--n-text); }
.n-header__nav-link.is-active {
  color: var(--n-text);
  background: var(--n-bg-sunk);
}

/* Burger — hidden on desktop, visible <720px */
.n-header__burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 0;
  border-radius: var(--n-r-xs);
  color: var(--n-text);
  cursor: pointer;
  margin-left: calc(var(--n-s-3) * -1);
  transition: background var(--n-dur-fast) var(--n-ease);
}
.n-header__burger:hover { background: var(--n-bg-hover); }

@media (max-width: 720px) {
  .n-header__nav { display: none; }
  .n-header__burger { display: inline-flex; }
  /* Hide secondary quick actions on small screens — drawer has them */
  .n-header__login-btn { display: none; }
}
@media (max-width: 420px) {
  .n-header__register-btn { display: none; }
}

/* Actions (right cluster) */
.n-header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--n-s-2);
}

/* Theme toggle — show only the relevant icon */
[data-theme="light"] .n-header__icon-moon { display: block; }
[data-theme="light"] .n-header__icon-sun  { display: none; }
[data-theme="dark"]  .n-header__icon-moon { display: none; }
[data-theme="dark"]  .n-header__icon-sun  { display: block; }

/* ════════════════════════════════════════════════════════════════════════
   DRAWER — side sheet
   ════════════════════════════════════════════════════════════════════════ */
.n-drawer {
  position: fixed;
  inset: 0;
  z-index: var(--n-z-modal);
  pointer-events: none;
  visibility: hidden;
}
.n-drawer.is-open {
  visibility: visible;
  pointer-events: auto;
}

.n-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity var(--n-dur-base) var(--n-ease);
}
.n-drawer.is-open .n-drawer__backdrop { opacity: 1; }

.n-drawer__panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 88vw;
  max-width: 320px;
  background: var(--n-bg-2);
  border-right: 1px solid var(--n-line);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--n-dur-slow) var(--n-ease);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
}
.n-drawer.is-open .n-drawer__panel {
  transform: translateX(0);
}

.n-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--n-s-3) var(--n-s-4);
  border-bottom: 1px solid var(--n-line);
  flex-shrink: 0;
}
.n-drawer__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--n-s-2);
  color: var(--n-text);
  font-weight: var(--n-w-bold);
  font-size: var(--n-fs-md);
  text-decoration: none;
}

.n-drawer__close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: var(--n-r-xs);
  color: var(--n-text-mute);
  cursor: pointer;
  transition: background var(--n-dur-fast) var(--n-ease),
              color var(--n-dur-fast) var(--n-ease);
}
.n-drawer__close:hover { background: var(--n-bg-hover); color: var(--n-text); }

.n-drawer__nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--n-s-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.n-drawer__nav-link {
  display: flex;
  align-items: center;
  gap: var(--n-s-3);
  padding: 12px 14px;
  border-radius: var(--n-r-xs);
  color: var(--n-text-soft);
  font-size: var(--n-fs-sm);
  font-weight: var(--n-w-med);
  text-decoration: none;
  transition: background var(--n-dur-fast) var(--n-ease),
              color var(--n-dur-fast) var(--n-ease);
}
.n-drawer__nav-link:hover {
  background: var(--n-bg-hover);
  color: var(--n-text);
}
.n-drawer__nav-link.is-active {
  background: var(--n-bg-sunk);
  color: var(--n-text);
  font-weight: var(--n-w-sem);
}
.n-drawer__nav-link.is-active::before {
  content: '';
  position: absolute;
  margin-left: -14px;
  width: 3px;
  height: 20px;
  background: var(--n-accent);
  border-radius: 0 3px 3px 0;
}
.n-drawer__nav-link {
  position: relative;
}

.n-drawer__nav-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.n-drawer__nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.n-drawer__foot {
  flex-shrink: 0;
  padding: var(--n-s-3);
  border-top: 1px solid var(--n-line);
  display: flex;
  flex-direction: column;
  gap: var(--n-s-2);
}

/* Prevent scroll when drawer is open */
html.n-drawer-open,
body.n-drawer-open {
  overflow: hidden;
}
