/* Edunexus header: centered, minimal layout */
.edunexus-header {
  position: relative;
  z-index: 1000;
  background: #fff;
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.edunexus-header__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.edunexus-header__bar {
  display: block;
  text-align: center;
}

.edunexus-header__brand {
  margin-bottom: 0.25rem;
}

/* Hidden on desktop; shown only in mobile media query */
.edunexus-header__menu-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.edunexus-header__menu-toggle:hover {
  background: rgba(95, 45, 237, 0.08);
}

.edunexus-header__menu-toggle:focus-visible {
  outline: 2px solid var(--primaryColor, #5f2ded);
  outline-offset: 2px;
}

.edunexus-header__menu-toggle-bar {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--blackColor, #1b2e4b);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.edunexus-header.is-nav-open .edunexus-header__menu-toggle-bar:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.edunexus-header.is-nav-open .edunexus-header__menu-toggle-bar:nth-child(2) {
  opacity: 0;
}

.edunexus-header.is-nav-open .edunexus-header__menu-toggle-bar:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.edunexus-header__logo-link {
  display: inline-block;
}

.edunexus-header__logo-img {
  max-width: 420px;
  max-height: 240px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.edunexus-header__nav {
  margin-top: 0;
}

.edunexus-header__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 2rem;
}

.edunexus-header__menu li {
  margin: 0;
}

.edunexus-header__menu a {
  color: var(--blackColor, #000);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
}

.edunexus-header__menu a:hover {
  color: var(--primaryColor, #5F2DED);
}

/* Courses dropdown (click summary to open) */
.edunexus-header__dropdown {
  position: relative;
}

.edunexus-header__details {
  display: inline-block;
  text-align: left;
}

.edunexus-header__summary {
  list-style: none;
  cursor: pointer;
  color: var(--blackColor, #000);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  padding: 0;
}

.edunexus-header__summary::-webkit-details-marker {
  display: none;
}

.edunexus-header__summary::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0.35em;
  vertical-align: 0.15em;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.75;
  transition: transform 0.15s ease;
}

.edunexus-header__details[open] .edunexus-header__summary::after {
  transform: rotate(180deg);
}

.edunexus-header__summary:hover {
  color: var(--primaryColor, #5F2DED);
}

.edunexus-header__submenu {
  list-style: none;
  margin: 0;
  padding: 0.45rem 0 0;
  position: absolute;
  left: 0;
  right: auto;
  top: 100%;
  transform: none;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  min-width: 280px;
  max-width: min(380px, 94vw);
  max-height: min(70vh, 480px);
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(27, 46, 75, 0.12);
  z-index: 1001;
  text-align: left;
}

/* Invisible hit area between label and panel so clicks don’t fall through to content below */
.edunexus-header__submenu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 12px;
}

.edunexus-header__submenu > li {
  margin: 0;
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-width: 100%;
  flex: 0 0 auto;
  float: none;
  clear: both;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.edunexus-header__submenu > li:last-child {
  border-bottom: none;
}

.edunexus-header__submenu a {
  display: block;
  padding: 0.55rem 1rem 0.55rem 1.1rem;
  font-size: 14px;
  font-weight: 600;
  color: var(--blackColor, #1b2e4b);
  text-decoration: none;
  white-space: normal;
  line-height: 1.35;
  text-align: left;
}

.edunexus-header__submenu a:hover {
  background: rgba(95, 45, 237, 0.06);
  color: var(--primaryColor, #5F2DED);
}

.edunexus-header__submenu > li.edunexus-header__submenu-all {
  border-top: none;
  border-bottom: 2px solid rgba(95, 45, 237, 0.12);
  margin-top: 0;
  margin-bottom: 0.15rem;
  padding-top: 0;
}

.edunexus-header__submenu .edunexus-header__submenu-all a {
  color: var(--primaryColor, #5F2DED);
}

@media (max-width: 768px) {
  .edunexus-header {
    padding: 1.25rem 1rem 1rem;
    text-align: left;
  }

  .edunexus-header__inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .edunexus-header__bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    gap: 0.75rem;
  }

  .edunexus-header__brand {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
    text-align: center;
  }

  .edunexus-header__logo-link {
    margin: 0 auto;
  }

  .edunexus-header__menu-toggle {
    display: inline-flex;
  }

  .edunexus-header__nav {
    display: none;
    width: 100%;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }

  .edunexus-header.is-nav-open .edunexus-header__nav {
    display: block;
  }

  .edunexus-header__logo-img {
    max-width: 360px;
    max-height: 180px;
  }

  .edunexus-header__menu {
    gap: 0.35rem;
    justify-content: flex-start;
    flex-direction: column;
    align-items: stretch;
  }

  .edunexus-header__menu > li {
    width: 100%;
    text-align: left;
  }

  .edunexus-header__menu a {
    font-size: 14px;
  }

  .edunexus-header__summary {
    font-size: 14px;
  }

  .edunexus-header__details {
    text-align: left;
    width: 100%;
  }

  /* Stack submenus in the slide-down panel (no horizontal clipping) */
  .edunexus-header__submenu {
    position: static;
    transform: none;
    left: auto;
    right: auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-top: 0.35rem;
    box-sizing: border-box;
    box-shadow: none;
    border-radius: 8px;
    max-height: min(55vh, 420px);
  }

  .edunexus-header__submenu::before {
    display: none;
  }
}

@media (min-width: 769px) {
  .edunexus-header__menu-toggle {
    display: none !important;
  }

  .edunexus-header__nav {
    display: block !important;
  }
}
