/* Site-wide top bar: the same header as the new landing page (/landing/),
 * shown on every page. Markup: navbar/templates/navbar/site_header.html,
 * rendered and cached by navbar.generator.render_site_navigation().
 * Behaviour: library/js/site-header.js.
 *
 * Self-contained on purpose: it is loaded by bootstrap pages (base.html),
 * base_modern pages, the classic homepage (after homepage.css, which has its
 * own .header rules) and the landing page, so every rule is scoped under .sh
 * and sets what it needs rather than inheriting it. */

/* ---- base bar ---------------------------------------------------------------*/
/* Deliberately NOT sticky (see library/test_site_nav_not_sticky.py): the bar
 * scrolls away with the page so it does not sit over the text while reading.
 * `relative` only so the z-index applies and the search panel stays above the
 * page content. */
.header {
  position: relative;
  z-index: 1000;
  background: #FFFFFF;
}
.sh, .sh * { box-sizing: border-box; }
.sh {
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #10201B;
  -webkit-font-smoothing: antialiased;
  border-bottom: 1px solid #EFEBE4;
}
.sh a { text-decoration: none; }
.sh button { font-family: inherit; }
.sh :focus-visible { outline: 3px solid #0E4D3F; outline-offset: 3px; }

.sh-bar {
  max-width: 1240px; margin: 0 auto; padding: 0 32px; height: 84px;
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
}
.sh .sh-brand {
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  color: #10201B; font-weight: 800; font-size: 22px; letter-spacing: -0.02em; line-height: 1;
}
.sh .sh-brand:hover { color: #10201B; }
.sh .sh-brand small { color: #0E4D3F; font-weight: 600; font-size: 14px; }

.sh-links { display: flex; gap: 26px; font-size: 16px; font-weight: 700; }
.sh .sh-links a { color: #10201B; white-space: nowrap; }
.sh .sh-links a:hover { color: #0E4D3F; text-decoration: none; }
.sh .sh-links a.sh-links__all { color: #0E4D3F; }

.sh-actions { display: flex; gap: 12px; align-items: center; flex-shrink: 0; }
.sh-icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid #E6E2DA; padding: 0;
  background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.sh-icon-btn:hover { border-color: #0E4D3F; }
.sh-menu-btn { display: none; }
.sh .sh-cta {
  background: #0E4D3F; color: #FFFFFF; font-weight: 800; font-size: 16px; line-height: 1.2;
  padding: 12px 20px; border-radius: 999px; white-space: nowrap;
}
.sh .sh-cta:hover { background: #0A3A2F; color: #FFFFFF; text-decoration: none; }

/* ---- search panel -----------------------------------------------------------*/
.sh-search { border-top: 1px solid #E6E2DA; background: #FFFFFF; padding: 18px 0 22px; }
.sh-search[hidden] { display: none; }
.sh-search__inner { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.sh-search label { display: block; font-weight: 700; font-size: 14px; color: #0E4D3F; margin: 0 0 8px; }
.sh-search__wrap { position: relative; }
.sh-search__input {
  width: 100%; font: inherit; font-size: 18px; padding: 14px 18px; border-radius: 14px;
  border: 1.5px solid #DDD6C8; background: #F3F1EC; color: #10201B;
}
.sh-search__input:focus { outline: none; border-color: #0E4D3F; background: #FFFFFF; }
.sh-search__results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #FFFFFF; border-radius: 14px;
  box-shadow: 0 20px 50px rgba(16, 32, 27, .18), inset 0 0 0 1px #DDD6C8; max-height: 60vh; overflow: auto; z-index: 20;
}
.sh-search__results[hidden] { display: none; }
.sh .sh-result {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px; color: #10201B; border-bottom: 1px solid #E6E2DA;
}
.sh .sh-result:hover { background: #F3F1EC; color: #10201B; text-decoration: none; }
.sh-result__main { display: flex; flex-direction: column; min-width: 0; }
.sh-result__title { font-weight: 700; }
.sh-result__sub { font-size: 13px; color: #4F5A54; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-result__badge { font-size: 12px; font-weight: 800; color: #0E4D3F; background: #BFE3CF; padding: 3px 8px; border-radius: 999px; flex-shrink: 0; }
.sh .sh-result--more { color: #0E4D3F; font-weight: 700; border-bottom: 0; }

/* ---- narrower screens -------------------------------------------------------*/
@media (max-width: 1100px) {
  .sh-links { gap: 18px; font-size: 15px; }
}
/* Below 980px the links fold into a menu under the bar. */
@media (max-width: 980px) {
  .sh-menu-btn { display: flex; }
  .sh-links {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0; background: #FFFFFF; padding: 8px 16px 16px;
    border-bottom: 1px solid #E6E2DA; box-shadow: 0 16px 30px rgba(16, 32, 27, .12);
  }
  .sh.sh--menu-open .sh-links { display: flex; }
  .sh .sh-links a { padding: 12px 8px; font-size: 17px; border-bottom: 1px solid #F0EDE7; }
  .sh .sh-links a:last-child { border-bottom: 0; }
}
@media (max-width: 600px) {
  .sh-bar { padding: 0 16px; height: 68px; gap: 12px; }
  .sh-search__inner { padding: 0 16px; }
  .sh .sh-brand { font-size: 18px; gap: 10px; }
  .sh .sh-brand small { display: none; }
  .sh-actions { gap: 8px; }
  .sh .sh-cta { padding: 10px 14px; font-size: 14px; }
}
/* No room for the button beside the brand on the smallest phones. */
@media (max-width: 440px) {
  .sh .sh-cta { display: none; }
}
