/* ══════════════════════════════════════════════════════════
   SHARED NAV STYLES  —  nav.css
   Vivek Vijay | IIT Jodhpur
══════════════════════════════════════════════════════════ */

:root {
  --accent:      #ffcd38;
  --accent-dark: #e6b800;
  --text:        #444;
  --heading:     #222;
  --body-bg:     #f5f5f5;
  --border:      #eee;
  --nav-h:       64px;
}

/* ── TOP NAVBAR ── */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  z-index: 200;
  display: flex;
  align-items: stretch;
}

.nav-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 28px 0 24px;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  text-decoration: none;
}
.nav-brand-name {
  font-family: 'Oswald', sans-serif;
  font-size: 20px; font-weight: 500;
  color: var(--heading); letter-spacing: .4px; line-height: 1.1;
}
.nav-brand-sub {
  font-family: 'Oswald', sans-serif;
  font-size: 11px; font-weight: 300;
  color: #aaa; letter-spacing: .3px;
}

/* Desktop nav links */
.nav-links {
  display: flex;
  align-items: stretch;
  list-style: none;
  flex: 1;
  overflow: visible;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links > li {
  position: relative;
  display: flex;
  align-items: stretch;
}
.nav-links > li > a {
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-family: 'Oswald', sans-serif;
  font-size: 16.5px; letter-spacing: .3px;
  color: #555; white-space: nowrap;
  position: relative;
  transition: color .2s;
  user-select: none;
  text-decoration: none;
}
.nav-links > li > a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 16px; right: 16px;
  height: 3px;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .22s ease;
}
.nav-links > li > a:hover { color: var(--heading); }
.nav-links > li > a:hover::after { transform: scaleX(1); }
.nav-links > li.active > a { color: var(--heading); font-weight: 500; }
.nav-links > li.active > a::after { transform: scaleX(1); }

/* Desktop dropdown */
.nav-links > li .submenu {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 0 0 6px 6px;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  list-style: none;
  z-index: 300;
}
.nav-links > li:hover .submenu { display: block; }
.nav-links > li .submenu li a {
  display: block;
  padding: 10px 18px;
  font-family: 'Oswald', sans-serif;
  font-size: 13px; color: #555;
  border-bottom: 1px solid #f5f5f5;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.nav-links > li .submenu li:last-child a { border-bottom: none; }
.nav-links > li .submenu li a:hover { background: #fffbee; color: var(--heading); }
.nav-links > li .submenu li a.active-sub {
  color: #0099cc;
  font-weight: 500;
  background: #f0faff;
}

/* Search */
.nav-right {
  display: flex;
  align-items: center;
  padding: 0 20px 0 12px;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}
.nav-search {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: 'PT Sans', sans-serif;
  font-size: 13px; outline: none;
  width: 160px;
  transition: border-color .2s, width .3s;
  background: #fafafa; color: var(--heading);
}
.nav-search:focus { border-color: var(--accent); width: 200px; background: #fff; }

/* Hamburger */
.nav-hamburger {
  display: none;
  background: none; border: none;
  cursor: pointer;
  padding: 0 20px;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
}
.nav-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--heading);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.nav-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: #fff;
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
  z-index: 190;
  padding: 8px 0 12px;
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}
.mobile-menu.open { display: block; }

.mobile-menu a {
  display: block;
  padding: 11px 24px;
  font-family: 'Oswald', sans-serif;
  font-size: 14px; color: var(--heading);
  border-bottom: 1px solid #f5f5f5;
  transition: background .15s;
  text-decoration: none;
}
.mobile-menu a:hover { background: #fffbee; }
.mobile-menu a.active-mob { color: #0099cc; font-weight: 500; }

.mob-research-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 24px;
  font-family: 'Oswald', sans-serif;
  font-size: 14px; color: var(--heading);
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  user-select: none;
}
.mob-research-toggle:hover { background: #fffbee; }
.mob-arrow { transition: transform .2s; font-size: 11px; color: #aaa; }
.mob-arrow.open { transform: rotate(180deg); }

.mob-submenu { display: none; }
.mob-submenu.open { display: block; background: #fafafa; }
.mob-submenu a {
  padding-left: 40px;
  font-size: 13px; color: #666;
  border-bottom: 1px solid #eee;
}

@media (max-width: 900px) {
  .nav-links, .nav-right { display: none; }
  .nav-hamburger { display: flex; }
}
@media (max-width: 500px) {
  .nav-brand-sub { display: none; }
}
