/* A shared, responsive masthead. Custom classes avoid legacy PKP nav rules. */
body.ncp-modern-header #headerNavigationContainer {
  position: sticky !important;
  top: 0;
  z-index: 90;
  display: block !important;
  width: 100%;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #fff !important;
  border: 0 !important;
  border-bottom: 1px solid #e8eaed !important;
  box-shadow: none !important;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
#headerNavigationContainer .ncp-masthead,
#headerNavigationContainer .ncp-masthead * { box-sizing: border-box; }
#headerNavigationContainer .ncp-masthead {
  position: relative;
  display: flex;
  align-items: center;
  gap: 40px;
  width: 100%;
  max-width: 1500px;
  min-height: 88px;
  margin: 0 auto;
  padding: 18px 36px;
}
#headerNavigationContainer .ncp-masthead a {
  color: #26384a;
  text-decoration: none;
  border: 0;
  box-shadow: none;
}
#headerNavigationContainer .ncp-masthead a:hover { color: #8c1515; }
#headerNavigationContainer .ncp-masthead a:focus-visible,
#headerNavigationContainer .ncp-masthead summary:focus-visible,
#headerNavigationContainer .ncp-masthead button:focus-visible {
  outline: 2px solid #8c1515;
  outline-offset: 4px;
}
#headerNavigationContainer .ncp-masthead-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 10px;
  padding: 0;
}
#headerNavigationContainer .ncp-masthead-symbol {
  position: relative;
  display: block;
  overflow: hidden;
  flex: 0 0 34px;
  width: 34px;
  height: 44px;
}
#headerNavigationContainer .ncp-masthead-symbol img {
  position: absolute;
  display: block;
  width: 80px !important;
  height: 80px !important;
  max-width: none !important;
  max-height: none !important;
  left: -21px;
  top: -9.5px;
  margin: 0 !important;
}
#headerNavigationContainer .ncp-masthead-wordmark {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: #172e44;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.8px;
  line-height: 1.12;
  white-space: nowrap;
}
#headerNavigationContainer .ncp-masthead-wordmark > span {
  color: #6d7782;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}
#headerNavigationContainer .ncp-masthead-desktop {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 28px;
  min-width: 0;
}
#headerNavigationContainer .ncp-masthead-links,
#headerNavigationContainer .ncp-masthead-account {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
#headerNavigationContainer .ncp-masthead-links { margin-right: auto; }
#headerNavigationContainer .ncp-masthead-links a[aria-current="page"] { color: #8c1515; }
#headerNavigationContainer .ncp-masthead-account { gap: 18px; font-size: 13px; }
#headerNavigationContainer a.ncp-masthead-button {
  padding: 10px 16px;
  color: #fff;
  background: #8c1515;
  border: 1px solid #8c1515;
  border-radius: 6px;
  font-weight: 600;
}
#headerNavigationContainer a.ncp-masthead-button:hover { background: #6e1010; }
#headerNavigationContainer .ncp-masthead-search {
  display: flex;
  align-items: center;
  flex: 0 1 190px;
  min-width: 140px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e3e6ea;
  border-radius: 6px;
  background: #f7f8fa;
}
#headerNavigationContainer .ncp-masthead-search:focus-within {
  outline: 2px solid #8c1515;
  outline-offset: 2px;
}
#headerNavigationContainer .ncp-masthead-search input {
  width: 100%;
  min-width: 0;
  height: 38px;
  margin: 0;
  padding: 8px 0 8px 12px;
  border: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
  color: #26384a;
  font: inherit;
  font-size: 13px;
}
#headerNavigationContainer .ncp-masthead-search input::placeholder { color: #66717e; opacity: 1; }
#headerNavigationContainer .ncp-masthead-search button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: #566474;
  cursor: pointer;
}
#headerNavigationContainer .ncp-masthead-mobile { display: none; }
/* The homepage's former second nav is now part of the shared masthead. */
body.ncp-modern-header.pkp_page_index .ncp-content-nav { display: none !important; }
/* The catalogue previously reserved space for its own fixed 72px header. */
body.ncp-modern-header.pkp_page_library .pkp_structure_content { padding-top: 0 !important; }
@media (max-width: 1199px) {
  #headerNavigationContainer .ncp-masthead { gap: 28px; padding-inline: 24px; }
  #headerNavigationContainer .ncp-masthead-desktop { gap: 20px; }
  #headerNavigationContainer .ncp-masthead-links { gap: 18px; }
  #headerNavigationContainer .ncp-masthead-account { gap: 12px; }
}
@media (max-width: 1099px) {
  #headerNavigationContainer .ncp-masthead { min-height: 76px; padding: 14px 24px; justify-content: space-between; }
  #headerNavigationContainer .ncp-masthead-desktop { display: none; }
  #headerNavigationContainer .ncp-masthead-mobile { display: block; }
  #headerNavigationContainer .ncp-masthead-mobile summary {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 0 10px 12px;
    color: #26384a;
    font-size: 14px;
    font-weight: 500;
    line-height: 24px;
    list-style: none;
    cursor: pointer;
  }
  #headerNavigationContainer .ncp-masthead-mobile summary::-webkit-details-marker { display: none; }
  #headerNavigationContainer .ncp-masthead-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: grid;
    gap: 22px;
    padding: 24px;
    background: #fff;
    border-top: 1px solid #e8eaed;
    border-bottom: 1px solid #e8eaed;
    box-shadow: 0 12px 24px rgba(23,46,68,.08);
  }
  #headerNavigationContainer .ncp-masthead-panel .ncp-masthead-links,
  #headerNavigationContainer .ncp-masthead-panel .ncp-masthead-account { flex-wrap: wrap; white-space: normal; gap: 22px; }
  #headerNavigationContainer .ncp-masthead-panel .ncp-masthead-search { width: 100%; max-width: 420px; }
}
@media (max-width: 399px) {
  #headerNavigationContainer .ncp-masthead { gap: 12px; padding-inline: 16px; }
  #headerNavigationContainer .ncp-masthead-wordmark { font-size: 22px; }
  #headerNavigationContainer .ncp-masthead-brand { gap: 7px; }
  #headerNavigationContainer .ncp-masthead-panel { padding: 20px 16px; }
}

/* Keep the catalogue title clear of the shared sticky masthead. */
body.ncp-modern-header.pkp_page_library .wc-catalog { padding-top: 28px !important; }

/* Standalone public documents use this same masthead and accessible labels. */
#headerNavigationContainer .pkp_screen_reader,
#headerNavigationContainer .ncp-skip-link {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
#headerNavigationContainer .ncp-skip-link:focus {
  z-index: 100; top: 8px; left: 8px; width: auto; height: auto;
  margin: 0; padding: 10px 16px; clip: auto; background: #fff;
  color: #172e44; outline: 2px solid #8c1515;
}
#headerNavigationContainer .ncp-masthead-search input:focus-visible {
  outline: 2px solid #8c1515; outline-offset: -3px; border-radius: 4px;
}
@media print { #headerNavigationContainer { display: none !important; } }
