/* ============================================================
   nav2.css — Shared top-bar, header & navigation
   Depends on: css/theme.css (CSS custom properties)
   ============================================================ */

/* ---- Scroll progress line ---- */
.scroll-line {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: var(--accent);
  width: 0;
  z-index: 9999;
  transition: width .1s linear;
  pointer-events: none;
}

/* ---- Testing banner ---- */
.testing-banner {
  background: #111;
  color: #ffd966;
  text-align: center;
  padding: 7px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 600;
  animation: testFlash 1.8s ease-in-out infinite;
}
@keyframes testFlash {
  0%,100% { background:#111; color:#ffd966 }
  50%      { background:#2a1309; color:#fff }
}

/* ---- Utility bar ---- */
.util { background: var(--primary-ink); color: #f1e6c8 }
.util-inner {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 7px 0;
  font-size: 12.5px;
  flex-wrap: wrap;
}
.util a { color: #f1e6c8; text-decoration: none }
.util a:hover { color: #fff }
.util .sep { opacity: .4 }
.util .push { margin-left: auto; display: flex; gap: 12px; align-items: center }
.util .pill {
  border: 1px solid rgba(255,255,255,.26);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
}
.util .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(196,144,36,.22);
}

/* ---- Top header (logo + NAAC) ---- */
.top-header { background: var(--paper, #fff9ea); border-bottom: 1px solid var(--rule, #d6c6a6) }
.top-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 26px;
  align-items: center;
  padding: 16px 0;
}
.brand { display: flex; gap: 16px; align-items: center }
.seal {
  width: 80px; height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--paper, #fff9ea), 0 0 0 5px var(--primary);
  flex-shrink: 0;
}
.seal img { width: 100%; height: 100%; object-fit: cover; display: block }
.brand h1 {
  margin: 0;
  font-family: 'Yeseva One', serif;
  font-weight: 400;
  font-size: 32px;
  line-height: 1.1;
  color: var(--primary-ink);
}
.brand .sub {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  flex-wrap: wrap;
}
.brand .sub .tag {
  background: var(--accent);
  padding: 3px 10px;
  border-radius: 4px;
  color: #2a1309;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.naac {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--bg-2, #ede0bf);
  border: 1px solid var(--rule, #d6c6a6);
  padding: 10px 14px;
  border-radius: 6px;
}
.naac .info h3 {
  margin: 0;
  font-family: 'Yeseva One', serif;
  font-size: 14px;
  color: var(--primary-ink);
  font-weight: 400;
  letter-spacing: .02em;
}
.naac .info p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .04em;
}
.naac-badge {
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  object-fit: contain;
  background: var(--paper, #fff9ea);
  display: block;
}

/* ============================================================
   Main navigation — sticky below header
   ============================================================ */
nav.main {
  background: var(--primary);
  color: #f1e6c8;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  border-top: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
}

/* No body padding needed — nav is sticky, not fixed */
body {
  padding-top: 0 !important;
}

.nav-wrap {
  display: flex;
  align-items: center;
  position: relative;
}

/* ---- Hamburger button (hidden on desktop) ---- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 14px 12px;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #f1e6c8;
  border-radius: 2px;
  transition: transform .22s ease, opacity .22s ease;
  transform-origin: center;
}
/* animated X when open */
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg) }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0) }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg) }

/* ---- Nav row ---- */
.navrow {
  display: flex;
  gap: 0;
  align-items: stretch;
  /* IMPORTANT: overflow must stay visible so dropdowns aren't clipped */
  overflow: visible;
}

/* top-level links & dropdown triggers */
.navrow > a,
.nav-dropdown > a {
  padding: 13px 14px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  position: relative;
  color: #f1e6c8;
  letter-spacing: .04em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  text-decoration: none;
  background: transparent;
  border: none;
  font-family: inherit;
  user-select: none;
  line-height: 1;
}
.navrow > a:hover,
.nav-dropdown > a:hover { background: rgba(0,0,0,.2); color: #fff }

/* active page indicator */
.navrow > a.active,
.nav-dropdown.active > a { background: rgba(0,0,0,.22); color: #fff }
.navrow > a.active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px;
  bottom: -3px;
  height: 3px;
  background: var(--accent);
}

.nav-chev { font-size: 9px; opacity: .7; line-height: 1 }

/* ============================================================
   Dropdown menus — desktop hover
   ============================================================ */
.nav-dropdown { position: relative }

.nav-dd-menu {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  min-width: 215px;
  background: var(--primary-ink);
  border: 1px solid rgba(255,255,255,.12);
  border-top: 3px solid var(--accent);
  z-index: 1100;
  box-shadow: 0 10px 32px rgba(0,0,0,.42);
}
/* show on desktop hover */
.nav-dropdown:hover > .nav-dd-menu { display: block }
/* show when JS toggles .open (used on mobile) */
.nav-dropdown.open  > .nav-dd-menu { display: block }

.nav-dd-menu > a,
.nav-dd-menu > div > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 13px;
  color: #f1e6c8;
  font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,.06);
  white-space: nowrap;
  text-decoration: none;
}
.nav-dd-menu > a:hover,
.nav-dd-menu > div > a:hover { background: rgba(255,255,255,.1); color: #fff }

/* ---- Nested sub-menus (Departments) ---- */
.nav-sub { position: relative }

.nav-sub-menu {
  display: none;
  position: absolute;
  left: 100%; top: -3px;
  min-width: 205px;
  background: var(--primary-ink);
  border: 1px solid rgba(255,255,255,.12);
  border-top: 3px solid var(--accent);
  z-index: 1101;
  box-shadow: 0 10px 32px rgba(0,0,0,.42);
}
.nav-sub:hover > .nav-sub-menu { display: block }
.nav-sub.open   > .nav-sub-menu { display: block }

.nav-sub-menu a {
  display: block;
  padding: 9px 16px;
  font-size: 13px;
  color: #f1e6c8;
  font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,.06);
  white-space: nowrap;
  text-decoration: none;
}
.nav-sub-menu a:hover { background: rgba(255,255,255,.1); color: #fff }

/* flip sub-menu left on narrow desktop */
@media (max-width: 1200px) {
  .nav-sub-menu { left: auto; right: 100% }
}

/* ============================================================
   Responsive — mobile (≤ 1100px): hamburger layout
   ============================================================ */
@media (max-width: 1100px) {
  /* show hamburger */
  .nav-toggle { display: flex }

  /* navrow becomes a fixed full-width vertical panel below the nav */
  .navrow {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 47px; left: 0; right: 0;
    background: var(--primary-ink, #1a0a04);
    border-top: 2px solid var(--accent);
    z-index: 999;
    max-height: calc(100vh - 47px);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,.5);
  }
  .navrow.open { display: flex }

  /* full-width links */
  .navrow > a,
  .nav-dropdown > a {
    width: 100%;
    padding: 13px 20px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    font-size: 13px;
    justify-content: space-between;
    white-space: normal;
  }
  .navrow > a.active::after { display: none }

  /* dropdowns become inline accordion panels */
  .nav-dropdown { position: static; width: 100% }

  .nav-dd-menu {
    position: static;
    display: none;
    border: none;
    border-top: none;
    box-shadow: none;
    background: rgba(0,0,0,.25);
    min-width: 100%;
  }
  /* on mobile, only JS .open class shows the menu — disable CSS hover */
  .nav-dropdown:hover > .nav-dd-menu { display: none }
  .nav-dropdown.open  > .nav-dd-menu { display: block }

  .nav-dd-menu > a,
  .nav-dd-menu > div > a { padding: 11px 20px 11px 38px; white-space: normal }

  /* sub-menus also inline */
  .nav-sub { position: static; width: 100% }
  .nav-sub-menu {
    position: static;
    left: auto; right: auto;
    border: none;
    box-shadow: none;
    background: rgba(0,0,0,.18);
    min-width: 100%;
    display: none;
  }
  .nav-sub:hover > .nav-sub-menu { display: none }
  .nav-sub.open   > .nav-sub-menu { display: block }
  .nav-sub-menu a { padding-left: 54px }

  /* header adjustments */
  .top-row { grid-template-columns: auto 1fr; gap: 14px }
  .naac { display: none }
  .brand h1 { font-size: 20px }
  .brand .sub { font-size: 11px; gap: 6px }
  .seal { width: 60px; height: 60px }

  /* hide some utility bar items */
  .util .sep,
  .util > .wrap > span:first-child { display: none }
  .util .push { margin-left: 0 }
  .util-inner { justify-content: space-between; gap: 8px }
}

@media (max-width: 500px) {
  .brand h1 { font-size: 17px }
  .util .pill { display: none }
}
