/*
 * WPU E-Resources Portal — Compact Single-Line Top Menu v31.4
 * - One horizontal navigation row on desktop, tablet, and mobile
 * - Smaller labels; no wrapping into a second line
 * - Mobile uses direct horizontal swipe/scroll instead of a hamburger menu
 * - Home and Printed Collection Discovery are filtered in public/header.php
 */

html body.wpu-site-header-active .public-header-shell .wpu-public-nav-toggler {
  display: none !important;
}

html body.wpu-site-header-active .public-header-shell .discovery-nav,
html body.wpu-site-header-active .public-header-shell .wpu-public-nav-container {
  min-height: 0 !important;
}

html body.wpu-site-header-active .public-header-shell .wpu-public-nav-container {
  display: flex !important;
  flex-flow: row nowrap !important;
  align-items: center !important;
  gap: clamp(8px, 1vw, 18px) !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

html body.wpu-site-header-active .public-header-shell .wpu-home-brand {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

html body.wpu-site-header-active .public-header-shell #publicNav.wpu-public-nav-always-visible {
  display: flex !important;
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
  transition: none !important;
}

html body.wpu-site-header-active .public-header-shell .wpu-public-nav-list {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: clamp(2px, .42vw, 8px) !important;
  width: 100% !important;
  min-width: max-content !important;
  margin: 0 0 0 auto !important;
  padding: 0 !important;
}

html body.wpu-site-header-active .public-header-shell .wpu-public-nav-list > .nav-item {
  display: block !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
}

html body.wpu-site-header-active .public-header-shell .discovery-nav .nav-link,
html body.wpu-site-header-active .public-header-shell .nav-admin-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 34px !important;
  margin: 0 !important;
  padding: .42rem clamp(.28rem, .5vw, .58rem) !important;
  border-radius: 8px !important;
  font-size: clamp(.61rem, .70vw, .72rem) !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: -.01em !important;
  text-align: center !important;
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

html body.wpu-site-header-active .public-header-shell .nav-admin-btn {
  gap: 4px !important;
}

/* Prevent any old V31.3 overflow class from producing a second menu row. */
html body.wpu-site-header-active .public-header-shell.wpu-nav-overflow .wpu-public-nav-container {
  flex-wrap: nowrap !important;
}
html body.wpu-site-header-active .public-header-shell.wpu-nav-overflow #publicNav.wpu-public-nav-always-visible {
  flex: 1 1 auto !important;
  width: auto !important;
  padding: 0 !important;
  border-top: 0 !important;
}
html body.wpu-site-header-active .public-header-shell.wpu-nav-overflow .wpu-public-nav-list {
  display: flex !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
}
html body.wpu-site-header-active .public-header-shell.wpu-nav-overflow .discovery-nav .nav-link,
html body.wpu-site-header-active .public-header-shell.wpu-nav-overflow .nav-admin-btn {
  width: auto !important;
  white-space: nowrap !important;
}

/* On narrower screens, keep the brand and menu on one header line. The menu
   can be swiped horizontally; no click or hamburger is required. */
@media (max-width: 1199.98px) {
  html body.wpu-site-header-active .public-header-shell.wpu-modern-site-header,
  html body.wpu-homepage-header-active .public-header-shell.wpu-modern-home-header {
    position: relative !important;
    top: auto !important;
    overflow: visible !important;
  }
  html body.wpu-site-header-active .public-header-shell .wpu-public-nav-container {
    flex-wrap: nowrap !important;
    padding-inline: 12px !important;
  }
  html body.wpu-site-header-active .public-header-shell .wpu-home-brand {
    flex: 0 0 auto !important;
    max-width: min(30vw, 230px) !important;
  }
  html body.wpu-site-header-active .public-header-shell #publicNav.wpu-public-nav-always-visible {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 0 0 1px !important;
    border: 0 !important;
  }
  html body.wpu-site-header-active .public-header-shell #publicNav.wpu-public-nav-always-visible::-webkit-scrollbar {
    display: none !important;
  }
  html body.wpu-site-header-active .public-header-shell .wpu-public-nav-list {
    justify-content: flex-start !important;
    width: max-content !important;
    min-width: max-content !important;
    margin-left: 0 !important;
  }
  html body.wpu-site-header-active .public-header-shell .discovery-nav .nav-link,
  html body.wpu-site-header-active .public-header-shell .nav-admin-btn {
    min-height: 32px !important;
    padding: .39rem .42rem !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    background: rgba(255,255,255,.07) !important;
    font-size: .64rem !important;
  }
  html body[data-wpu-public-homepage="1"] .public-header-shell .nav-admin-btn {
    background: #FFD942 !important;
    border-color: #FFD942 !important;
    color: #073777 !important;
    -webkit-text-fill-color: #073777 !important;
  }
  html body.wpu-site-header-active .public-header-shell .discovery-dropdown.show {
    position: fixed !important;
    inset: auto 12px 12px 12px !important;
    transform: none !important;
    width: auto !important;
    max-height: min(65vh, 420px) !important;
    overflow-y: auto !important;
    z-index: 1085 !important;
  }
}

@media (max-width: 767.98px) {
  html body.wpu-site-header-active .public-header-shell .wpu-public-nav-container {
    gap: 7px !important;
    padding: 7px 8px !important;
  }
  html body.wpu-site-header-active .public-header-shell .brand-logo,
  html body.wpu-site-header-active .public-header-shell .brand-logo-fallback {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
  }
  html body.wpu-site-header-active .public-header-shell .wpu-home-brand {
    gap: 6px !important;
    max-width: 116px !important;
  }
  html body.wpu-site-header-active .public-header-shell .brand-text {
    min-width: 0 !important;
    max-width: 76px !important;
  }
  html body.wpu-site-header-active .public-header-shell .brand-text strong {
    display: block !important;
    max-width: 76px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: .62rem !important;
    line-height: 1.05 !important;
  }
  html body.wpu-site-header-active .public-header-shell .brand-text small {
    display: none !important;
  }
  html body.wpu-site-header-active .public-header-shell .discovery-nav .nav-link,
  html body.wpu-site-header-active .public-header-shell .nav-admin-btn {
    min-height: 30px !important;
    padding: .36rem .36rem !important;
    border-radius: 7px !important;
    font-size: .60rem !important;
  }
  html body.wpu-site-header-active .public-header-shell .nav-admin-btn i {
    display: none !important;
  }
}

@media (max-width: 390px) {
  html body.wpu-site-header-active .public-header-shell .wpu-home-brand {
    max-width: 92px !important;
  }
  html body.wpu-site-header-active .public-header-shell .brand-text,
  html body.wpu-site-header-active .public-header-shell .brand-text strong {
    max-width: 52px !important;
  }
  html body.wpu-site-header-active .public-header-shell .discovery-nav .nav-link,
  html body.wpu-site-header-active .public-header-shell .nav-admin-btn {
    font-size: .57rem !important;
    padding-inline: .32rem !important;
  }
}
