/* ── Portal nav — lifted from core-managed.pages.dev ── */

/* Reset container */
.nav {
  position: relative;
  margin-bottom: 16px;
  z-index: 100;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

/* ── Green bar ── */
.header-nav {
  background: #297843;
  position: relative;
  z-index: 9;
  border-radius: 4px;
}
.header-nav .header-container {
  padding: 0 20px;
}

/* ── Top-level list ── */
.main-nav .nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0;
  margin: 0;
  padding: 0;
}

/* ── Top-level links ── */
.nav-list > li > a {
  font-family: Rajdhani, sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 20px;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: #fff;
  padding: 0 26px;
  margin: 25px 4px;
  display: block;
  position: relative;
  transition: all .3s ease;
  text-decoration: none;
}

/* Dark pill hover background */
.nav-list > li > a::before {
  height: 40px;
  background-color: #202426;
  position: absolute;
  inset: 0;
  content: "";
  z-index: -1;
  border-radius: 3px;
  transform: scaleX(.5);
  opacity: 0;
  transition: all .5s ease;
  margin-top: -9px;
}
.nav-list > li:hover > a::before,
.nav-list > li.current-page > a::before {
  transform: scaleX(1);
  opacity: 1;
}
.nav-list > li > a:hover,
.nav-list > li:hover > a {
  color: #fff;
}

/* ── First-level dropdown ── */
.has-dropdown {
  position: relative;
}
.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #f6f6f6;
  min-width: 270px;
  list-style: none;
  margin: 0;
  padding: 0;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  border-top: 3px solid #297843;
  z-index: 600;
  opacity: 0;
  visibility: hidden;
  transition: all .3s linear 0s;
}
.has-dropdown:hover > .dropdown {
  display: block;
  opacity: 1;
  visibility: visible;
}

/* ── Dropdown links ── */
.dropdown li a {
  font-family: Rajdhani, sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.5;
  color: #202426;
  padding: 15px 30px;
  display: block;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  transition: all .3s;
  position: relative;
  text-decoration: none;
}
.dropdown li a:hover {
  color: #fff;
  background: #297843;
  padding-left: 40px;
}

/* Hover dash indicator */
.dropdown li a::before {
  position: absolute;
  content: "";
  left: 18px;
  top: 24px;
  width: 0;
  height: 2px;
  background-color: transparent;
  transition: all .5s ease-in-out;
}
.dropdown li a:hover::before {
  background-color: rgba(255,255,255,0.5);
  width: 10px;
}

/* ── Third-level (flyout right) ── */
.has-sub {
  position: relative;
}
.has-sub > a::after {
  content: '›';
  float: right;
  margin-left: 8px;
  font-size: 18px;
  line-height: 1;
}
.sub-dropdown {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  background: #f6f6f6;
  min-width: 270px;
  list-style: none;
  margin: 0;
  padding: 0;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  border-top: 3px solid #297843;
  z-index: 601;
}
.has-sub:hover > .sub-dropdown {
  display: block;
}

/* ── Mobile ── */
.mobile-close {
  display: none;
}
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}
.mobile-toggle span {
  width: 25px;
  height: 2px;
  background: #fff;
  transition: all .3s;
}

@media (max-width: 768px) {
  .mobile-toggle { display: flex; }
  .header-nav { display: none; }
  .mobile-close {
    display: none;
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    z-index: 1001;
    line-height: 1;
    padding: 5px;
  }
  .header-nav.mobile-open .mobile-close { display: block; }
  .header-nav.mobile-open {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    z-index: 1000;
    background-color: #222;
    overflow-y: auto;
  }
  .header-nav.mobile-open .header-container {
    flex-direction: column;
    padding: 0;
  }
  .main-nav .nav-list {
    flex-direction: column;
    padding: 90px 0;
    width: 100%;
  }
  .nav-list > li {
    width: 100%;
    border-bottom: 1px solid rgba(204,204,204,0.1);
  }
  .nav-list > li > a {
    color: #fff;
    padding: 15px 25px;
    margin: 0;
    height: auto;
    line-height: normal;
    font-size: 14px;
  }
  .nav-list > li > a::before { display: none; }
  .dropdown, .sub-dropdown {
    position: static;
    box-shadow: none;
    background: transparent;
    border-top: none;
    min-width: 100%;
    display: none;
    opacity: 1;
    visibility: visible;
  }
  .dropdown li a {
    color: #fff;
    padding: 15px 25px;
    border-bottom: none;
  }
  .dropdown li a:hover {
    padding-left: 25px;
    background: rgba(255,255,255,0.05);
  }
  .has-dropdown.open > .dropdown,
  .has-sub.open > .sub-dropdown {
    display: block;
  }
  .sub-dropdown { padding-left: 1em; }
}

/* ── Dark mode overrides ── */
[data-theme="dark"] .header-nav { background: #1a4a2c; }
[data-theme="dark"] .dropdown,
[data-theme="dark"] .sub-dropdown {
  background: #1e293b;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
[data-theme="dark"] .dropdown li a { color: #e2e8f0; border-bottom-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .dropdown li a:hover { color: #fff; background: #297843; }

@media (prefers-color-scheme: dark) {
  .header-nav { background: #1a4a2c; }
  .dropdown, .sub-dropdown {
    background: #1e293b;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  }
  .dropdown li a { color: #e2e8f0; border-bottom-color: rgba(255,255,255,0.06); }
  .dropdown li a:hover { color: #fff; background: #297843; }
}

/* ── Legacy ── */
.nav-links { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
