/* Preserve the original header independently of Bootstrap page controls. */
.site-header {
  --header-bar: #212529;
  --header-bar-line: #3f4346;
  --header-bar-ink: #ffffff;
  --header-bar-ink-quiet: #b3b7bb;
  --header-surface: #f7f5f0;
  --header-line: #d3cfc6;
  --header-ink: #16202c;
  --header-page: #eeebe4;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}
[data-bs-theme="dark"] .site-header {
  --header-bar: #0c1016;
  --header-bar-line: #2a313b;
  --header-surface: #1c232d;
  --header-line: #39424f;
  --header-ink: #eef1f5;
  --header-page: #131820;
}

/* Original header layout, navigation, icons and account disclosure. */


.site-header {
  position: sticky;
  top: 0;
  z-index: 1020; /* Above Leaflet controls, matching Bootstrap sticky navigation. */
  background: var(--header-bar);
  color: var(--header-bar-ink);
  border-bottom: 1px solid var(--header-bar-line);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  align-items: center;
  margin: 0 auto;
  max-width: 68rem;
  padding: .5rem 1rem;
  min-height: 3.5rem;
}

.site-header :focus-visible {
  outline-color: var(--header-bar-ink);
}

.site-header__brand {
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--header-bar-ink);
}

.site-header__menu {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  align-items: center;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Reserve the right-hand action's label width across locales. Navigation
   links keep their natural widths and the same gap between visible labels. */
.site-header__label {
  display: inline-grid;
}
.site-header__label > span,
.site-header__label::before,
.site-header__label::after {
  grid-area: 1 / 1;
}
.site-header__label::before {
  content: attr(data-label-cs);
  visibility: hidden;
}
.site-header__label::after {
  content: attr(data-label-en);
  visibility: hidden;
}

.site-nav a,
.site-header__icon-link {
  color: var(--header-bar-ink-quiet);
  text-decoration: none;
}

.site-nav a:hover,
.site-header__icon-link:hover,
.user-menu__summary:hover {
  color: var(--header-bar-ink);
}

/* The current page is said in words to assistive technology (aria-current)
   and shown by more than colour: it is white and underlined. */
.site-nav a[aria-current="page"],
.site-header__icon-link[aria-current="page"],
.user-menu__summary--current {
  color: var(--header-bar-ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

.site-header__end {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.site-header .site-header__add {
  padding: .25rem .75rem;
}

.site-header__icon-link {
  display: inline-flex;
  align-items: center;
  padding: .25rem;
}

/* The theme toggle shows the theme a click would switch to: the sun while
   dark is showing, the moon while light is. */
.site-header__theme {
  border: 0;
  background: none;
}
.site-header__theme-slot {
  display: inline-flex;
  align-items: center;
  flex: 0 0 26px; /* The existing 18px icon plus two 4px paddings. */
  height: 26px;
  margin-right: .5rem;
}

/* Compact segmented language control, shared with signed-out pages. The
   header scopes it to dark mode independently of the page's theme. */
.language-switch {
  display: flex;
  align-items: center;
}

.language-switch .language-switch__button {
  --bs-btn-bg: transparent;
  --bs-btn-border-color: transparent;
  --bs-btn-hover-bg: var(--app-neutral-hover);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-bg: var(--app-neutral-hover);
  --bs-btn-active-border-color: var(--bs-secondary-text-emphasis);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 7px;
  font-size: 1.2rem;
  line-height: 1;
}

.language-switch .language-switch__button[aria-pressed="true"] {
  --bs-btn-bg: var(--app-neutral-hover);
  --bs-btn-border-color: var(--bs-secondary-text-emphasis);
  --bs-btn-hover-border-color: var(--bs-secondary-text-emphasis);
}

.site-header__divider {
  align-self: stretch;
  width: 1px;
  margin: .25rem .75rem;
  background: var(--header-bar-ink-quiet);
  opacity: 0.5;
}

.site-header__toggle {
  display: inline-flex;
  margin-left: auto;
  padding: .25rem .5rem;
  border-color: var(--header-bar-line);
  background: transparent;
  color: var(--header-bar-ink-quiet);
}

/* Account menu: a disclosure, so it opens and closes without JavaScript. */

.user-menu {
  position: relative;
}

.user-menu__summary {
  display: flex;
  gap: .25rem;
  align-items: center;
  color: var(--header-bar-ink-quiet);
  cursor: pointer;
  list-style: none;
}

.user-menu__summary::-webkit-details-marker {
  display: none;
}

.user-menu__summary::after {
  content: "";
  border: 0.3em solid transparent;
  border-top-color: currentColor;
  border-bottom: 0;
}

.user-menu__items {
  position: absolute;
  right: 0;
  z-index: 1100;
  min-width: 11rem;
  margin: .5rem 0 0;
  padding: .5rem 0;
  list-style: none;
  background: var(--header-surface);
  border: 1px solid var(--header-line);
  border-radius: .375rem;
  box-shadow: 0 0.5rem 1rem rgb(0 0 0 / 0.15);
}

.user-menu__item {
  display: block;
  width: 100%;
  padding: .25rem 1rem;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--header-ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
}

.user-menu__item:hover {
  background: var(--header-page);
}

.user-menu__separator {
  margin: .5rem 0;
  border-top: 1px solid var(--header-line);
}

/* Narrow screens: with JavaScript, the bar folds behind the menu button and
   opens as a column; without it, everything simply wraps. */
@media (min-width: 48rem) {
  .site-header__toggle {
    display: none;
  }
}

@media (max-width: 47.99rem) {
  .has-js .site-header__menu,
  .site-header--collapsible .site-header__menu {
    display: none;
  }

  .has-js[data-header-expanded="true"] .site-header__menu,
  .site-header--collapsible .site-header__menu--open {
    display: flex;
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: .5rem;
  }

  .has-js .site-nav ul,
  .site-header--collapsible .site-nav ul {
    flex-direction: column;
  }

  .has-js .site-header__end,
  .site-header--collapsible .site-header__end {
    flex-wrap: wrap;
    margin-left: 0;
  }

  .user-menu__items {
    left: 0;
    right: auto;
  }
}

.site-header__toggle {
  border: 1px solid var(--header-bar-line);
  border-radius: .375rem;
  font: inherit;
  cursor: pointer;
}
.site-header__theme { cursor: pointer; }
.site-header__inner > *, .site-header__menu, .site-header__end, .user-menu {
  min-width: 0;
  max-width: 100%;
}
.site-header__brand:hover { color: var(--header-bar-ink); }
.user-menu__summary { overflow-wrap: anywhere; }
.user-menu__summary::after { flex-shrink: 0; }
.user-menu__item { cursor: pointer; }
.site-header :focus-visible { outline-width: 3px; }
