/* ===========================
   BUP Header — CSS-only layout (scoped, no DOM moves)
   Goals:
   - Prevent “Guidelines” & “About” from squashing (wrap gracefully)
   - About opens on click only (not hover)
   - Ensure **white** background under ALL menu rows/items (no tinted bars)
   =========================== */

/* --- White header band + roomy wrapper --- */
.pkp_structure_head {
  position: relative;
  background: #fff;
}
.pkp_structure_head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
}
.pkp_head_wrapper.bup-head-enabled {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  background: #fff;
  position: relative;
  overflow: visible;
  z-index: 20;
}

/* --- LEFT: logo/site + title --- */
.bup-head-enabled .bup-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 0 0 auto;
  min-width: 0;
  
}
.bup-head-enabled .bup-left img {
  height: 56px !important;
  width: auto !important;
  display: inline-block !important;
}

.bup-header__title {
  line-height: 1.1;
  font-weight: 600;
}
.bup-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 60px 9px 0;
}
.bup-title-text {
  font: 600 25px/1.2 Inter, system-ui, -apple-system, Segoe UI, Roboto,
    "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: #000;
  letter-spacing: 0.22px;
  max-width: 1000px;
  margin: 0;
}
.bup-sep {
  height: 2px;
  width: 100%;
  background: #1e4216;
}
.bup-issn {
  font: 600 11px/1.2 Inter, system-ui, -apple-system, Segoe UI, Roboto,
    "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: #000;
  letter-spacing: 0.11px;
  margin: 6px 0 0;
}

/* --- PRIMARY NAV (multi-row allowed) --- */
#navigationPrimary {
  display: flex !important;
  flex-wrap: wrap !important; /* allow second row when needed */
  align-items: flex-start !important; /* tall items won’t be squeezed */
  justify-content: flex-start;
  column-gap: 28px;
  row-gap: 8px; /* space between rows */
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
  white-space: nowrap; /* short items: single line */
  background: #fff !important; /* ensure white under ALL rows */
}
#navigationPrimary > li {
  position: relative;
  float: none !important;
  margin: 0 !important;
  flex: 0 0 auto;
  background: transparent !important; /* kill any theme strip on li */
}
#navigationPrimary > li > a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 24px;
  color: #000 !important;
  font-weight: 500;
  font-size: 16px;
  white-space: nowrap; /* short items stay single line */
  padding: 0; /* rely on theme spacing */
  background: transparent !important; /* kill any theme strip on a */
}

/* --- Search pinned far-right on row 1 --- */
#navigationPrimary > li.bup-search {
  margin-left: auto !important;
  order: 0;
  white-space: normal;
}
#navigationPrimary > li input[type="search"] {
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

/* Row break marker */
#navigationPrimary::after {
  content: "";
  flex-basis: 100%;
  height: 0;
  order: 1;
}

/* =========================
   BUP: TARGETED FIXES
   ========================= */

/* A) Long items wrap gracefully, not squash */
.pkp_head_wrapper.bup-head-enabled,
#navigationPrimary {
  overflow: visible !important;
  height: auto !important;
}
#navigationPrimary > li.bup-long {
  flex: 0 1 clamp(220px, 32vw, 560px) !important;
  max-width: 100% !important;
  overflow: visible !important;
  align-self: flex-start;
  background: transparent !important; /* in case theme targets .bup-long */
}
#navigationPrimary > li.bup-long > a {
  white-space: normal !important; /* allow multi-line */
  line-height: 1.3 !important;
  display: block;
  word-break: break-word;
  hyphens: auto;
  background: transparent !important;
}

/* B) ABOUT = click-only (not hover) */
#navigationPrimary > li.bup-nohover:hover > .pkp_nav_submenu,
#navigationPrimary > li.bup-nohover:hover > ul {
  display: none !important;
}
#navigationPrimary > li.bup-nohover.bup-open > .pkp_nav_submenu,
#navigationPrimary > li.bup-nohover.bup-open > ul {
  display: block !important;
}

/* Keep dropdowns consistent */
#navigationPrimary > li > .pkp_nav_submenu,
#navigationPrimary > li > ul {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10000;
  min-width: 220px;
  margin-top: 8px;
  padding: 6px 0;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* C) RIGHT SIDE: ensure transparent; dropdown stays readable */
.bup-head-enabled .bup-right,
.bup-head-enabled .bup-right > .pkp_navigation_user_wrapper,
.bup-head-enabled .bup-right > .pkp_user_nav_wrapper,
.bup-head-enabled .bup-right > #navigationUser {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.bup-head-enabled #navigationUser {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin: 0 0 0 780px !important;
  padding: 0 !important;
  list-style: none;
  white-space: nowrap;
  width: auto !important;
}
.bup-head-enabled #navigationUser > li {
  float: none !important;
  margin: 0 30px 0 0 !important;
}
.bup-head-enabled #navigationUser > li > a {
  display: inline-flex;
  align-items: center;
  gap: 0px;
  padding: 6px 0;
  line-height: 24px;
  text-decoration: none;
  color: #111 !important;
  font-weight: 500;
  background: transparent !important;
}
.bup-head-enabled #navigationUser .pkp_nav_submenu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 10000;
  display: none;
  min-width: 200px;
  background: #fff;
  color: #111;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.bup-head-enabled #navigationUser li:hover > .pkp_nav_submenu {
  display: block;
}
.bup-head-enabled #navigationUser .pkp_nav_submenu a {
  display: block;
  padding: 8px 12px;
  color: #111 !important;
  text-decoration: none;
}
.bup-head-enabled #navigationUser .pkp_nav_submenu a:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* --- HARD OVERRIDES for theme tints/stripes on wrapped rows --- */
/* 1) Ensure nav containers are white (no bars/gradients) */
.pkp_navigation_primary,
.pkp_site_nav_menu,
.pkp_site_nav_menu .pkp_nav_list,
.pkp_site_nav_menu .pkp_nav_list::before,
.pkp_navigation_primary::before,
.pkp_navigation_primary::after {
  background: #fff !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* 2) Nuke any top-level hover/active tint strips on li/a */
#navigationPrimary > li,
#navigationPrimary > li::before,
#navigationPrimary > li::after,
#navigationPrimary > li > a,
#navigationPrimary > li > a::before,
#navigationPrimary > li > a::after,
#navigationPrimary > li:hover,
#navigationPrimary > li:hover > a,
#navigationPrimary > li:focus-within > a {
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

/* Keep submenu item hover distinct (don’t touch) */

/* --- Responsive --- */
@media (max-width: 1180px) {
  .bup-header__title {
    display: none;
  }
}
@media (max-width: 1024px) {
  .pkp_head_wrapper.bup-head-enabled {
    flex-wrap: wrap;
    row-gap: 12px;
  }
}

@media (min-width: 1200px) {
  .pkp_site_name_wrapper,
  .pkp_navigation_primary_wrapper,
  .pkp_navigation_user,
  .pkp_search_mobile,
  .pkp_structure_content,
  .pkp_structure_footer {
    width: 1000px;
  }
}

.pkp_navigation_primary_wrapper {
  width: 20rem !important;
}

.pkp_structure_main {
  width: 730px !important;
}

.bup-long {
  border: 0 0 1px 0 solid !important;
}