/* ═══════════════════════════════════════════════════════════════
   Shared header — one navbar for every page (linked AFTER each page's
   own stylesheet so these rules win). Same logo, same links, same
   metrics on / , /projects/ , /gallery/ and /blog/.
     • Home · Projects · Gallery · Blog, current page highlighted
       (aria-current="page")
     • Sub-pages also show the  niteshupreti.com.np / page  breadcrumb
   ═══════════════════════════════════════════════════════════════ */
.navbar { z-index: 1000; }

.nav-inner {
  gap: 1.5rem;
  max-width: 1140px;
  padding: 1.25rem 2rem;
}

/* breadcrumb (sub-pages only; the home page simply has none) */
.nav-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.78rem;
  white-space: nowrap;
  min-width: 0;
}
.breadcrumb-home { color: var(--text-muted); transition: color var(--transition, 0.2s ease); }
.breadcrumb-home:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--text-faint); }
.breadcrumb-current { color: var(--accent); font-weight: 500; }

/* links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}
.nav-link {
  position: relative;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: color var(--transition, 0.2s ease), background var(--transition, 0.2s ease);
}
.nav-link:hover { color: var(--text); background: var(--border-soft); }
.nav-link[aria-current="page"] {
  color: var(--text);
  font-weight: 500;
  background: var(--border-soft);
}
.nav-link[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.18rem;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* mobile menu: same entries everywhere */
.mobile-link[aria-current="page"] { color: var(--accent); font-weight: 500; }

/* tighter in the in-between widths so the breadcrumb + 4 links + Theme fit */
@media (max-width: 900px) {
  .nav-inner { gap: 1rem; }
  .nav-link { padding: 0.4rem 0.55rem; }
  .nav-link[aria-current="page"]::after { left: 0.55rem; right: 0.55rem; }
  .nav-breadcrumb { font-size: 0.72rem; }
}
@media (max-width: 820px) {
  .breadcrumb-home, .breadcrumb-sep { display: none; }   /* keep just the page name */
}

/* ═══════════════════════════════════════════════════════════════
   Collapse to the hamburger on tablets + phones.
   This file loads AFTER every page's own stylesheet, and the blanket
   `.nav-links { display: flex }` above has the same specificity as the
   pages' `@media (max-width: 700px) { .nav-links { display: none } }`,
   so it used to win and the four links never collapsed — they shoved
   the theme button and the hamburger off the right edge of the screen.
   The collapse rules live here now, at the same breakpoint everywhere.
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 820px) {
  .nav-links { display: none; }
  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 13px 11px;              /* 44 × 44 tap target */
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-menu {
    -webkit-backdrop-filter: var(--nav-blur);
    backdrop-filter: var(--nav-blur);
    max-height: calc(100dvh - 4.5rem);   /* long menu + short landscape phone */
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .mobile-link { padding: 0.85rem 0; }  /* comfortable tap height */
}

@media (max-width: 700px) {
  /* left gutter matches the page content; right gutter keeps the
     controls clear of the pull-cord that hangs at the far right */
  .navbar .nav-inner {
    padding: 0.75rem 3.4rem 0.75rem 1rem;
    gap: 0.5rem;
  }
  .mobile-menu { padding: 0.5rem 1.25rem 1.25rem; }
}
