/* Novalis navigation: the logo on the left and the page links on the right, with no background of
   its own. It sits over the top of each page's hero and scrolls away with the page; scrolling back
   up brings it in again as a white floating bar (see "Floating bar" below).
   Light theme (default): white links and a white-and-gold logo, for the navy page heroes.
   Dark theme: navy links and the navy-and-gold logo, for light backgrounds.
   Below 1100px the links move into a drop-down panel opened by the menu button. */
.nv-header {
  --nv-head-ink: #fff;
  --nv-head-gold: #ba8d40;
  position: absolute;
  inset: 0 0 auto;
  z-index: 1002;
}

.nv-header--dark {
  --nv-head-ink: #263450;
}

.nv-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.5rem var(--nv-pad, clamp(16px, 5vw, 96px));
}

/* Logo: sits on a small frosted white panel, so it always shows in its navy-and-gold colours. */
.nv-header__logo {
  flex: none;
  display: block;
  padding: 0.85rem 1.1rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  line-height: 0;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nv-header__logo {
    background: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    backdrop-filter: blur(14px) saturate(160%);
  }
}

.nv-header__logo-img {
  display: block;
  width: 150px;
  height: auto;
}

/* Light theme over photos: a dark halo (not a background) keeps white and gold text readable on
   pale rooms and bright slats. */
.nv-header--light .nv-header__link {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), 0 0 10px rgba(0, 0, 0, 0.5), 0 0 22px rgba(0, 0, 0, 0.3);
}

.nv-header--light .nv-header__burger {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}

/* On the white panel the navy-and-gold logo is used on every page. */
.nv-header__logo-img--light {
  display: none;
}

.nv-header__logo:focus-visible {
  outline: 2px solid var(--nv-head-gold);
  outline-offset: 6px;
}

/* Links */
.nv-header__nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2.4vw, 2.5rem);
}

.nv-header__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0;
  border: 0;
  background: none;
  color: var(--nv-head-ink);
  font-family: Sohne, Arial, sans-serif;
  font-size: 0.8125rem;
  font-weight: 500; /* Sohne Buch: a touch heavier than the Leicht body text, so links hold up on photos */
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.25s ease;
}

.nv-header__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--nv-head-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nv-header__link:hover,
.nv-header__link:focus-visible,
.nv-header__link[aria-current="page"],
.nv-header__link.is-current {
  color: var(--nv-head-gold);
}

.nv-header__link:hover::after,
.nv-header__link:focus-visible::after {
  transform: scaleX(1);
}

/* Current page: a hairline stroke makes the word a touch heavier than Sohne Buch, the heaviest
   weight loaded, without the browser faking a bold. */
.nv-header__link[aria-current="page"],
.nv-header__link.is-current {
  -webkit-text-stroke: 0.4px currentColor;
}

/* Current page: a small gold dot under the middle of the word instead of the hover underline. */
.nv-header__link[aria-current="page"]::after,
.nv-header__link.is-current::after {
  left: 50%;
  right: auto;
  bottom: -0.35rem;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  transform: none;
  transition: none;
}

.nv-header--light .nv-header__link[aria-current="page"]::after,
.nv-header--light .nv-header__link.is-current::after {
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}

.nv-header.is-floating .nv-header__link[aria-current="page"]::after,
.nv-header.is-floating .nv-header__link.is-current::after {
  box-shadow: none;
}

.nv-header__link:focus-visible,
.nv-header__toggle:focus-visible {
  outline: 2px solid var(--nv-head-gold);
  outline-offset: 4px;
}

/* Utilities drop-down: opens on hover, keyboard focus or click. The menu itself is a white card so
   its links stay readable over any picture. */
.nv-header__dropdown {
  position: relative;
}

.nv-header__dropdown::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 1rem;
}

.nv-header__dropdown-toggle::before {
  content: "";
  order: 2;
  width: 5px;
  height: 5px;
  margin: 0 0 3px 0.55rem;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.25s ease;
}

.nv-header__dropdown-menu {
  position: absolute;
  top: calc(100% + 0.9rem);
  right: -1.25rem;
  display: flex;
  flex-direction: column;
  min-width: 15rem;
  padding: 0.6rem 0;
  border-bottom: 2px solid #ba8d40;
  background: #fff;
  box-shadow: 0 16px 36px rgba(20, 28, 44, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

.nv-header__dropdown-menu a {
  padding: 0.7rem 1.25rem;
  color: #263450;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nv-header__dropdown-menu a:hover,
.nv-header__dropdown-menu a:focus-visible,
.nv-header__dropdown-menu a[aria-current="page"] {
  color: #ba8d40;
  background: #f4f5f6;
}

.nv-header__dropdown:hover .nv-header__dropdown-menu,
.nv-header__dropdown:focus-within .nv-header__dropdown-menu,
.nv-header__dropdown.is-open .nv-header__dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s;
}

.nv-header__dropdown:hover .nv-header__dropdown-toggle::before,
.nv-header__dropdown.is-open .nv-header__dropdown-toggle::before {
  transform: translateY(2px) rotate(225deg);
}

/* Menu button (small screens only): two lines in the link colour and a short gold one. */
.nv-header__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.5rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.nv-header__burger {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.nv-header__burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--nv-head-ink);
  transition: width 0.3s ease, transform 0.3s ease, opacity 0.2s ease;
}

.nv-header__burger span:last-child {
  width: 13px;
  background: var(--nv-head-gold);
}

.nv-header.is-panel-open .nv-header__burger span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nv-header.is-panel-open .nv-header__burger span:nth-child(2) {
  opacity: 0;
}

.nv-header.is-panel-open .nv-header__burger span:nth-child(3) {
  width: 22px;
  background: var(--nv-head-ink);
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Drop-down panel (small screens only): a white card under the bar. */
.nv-header__panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  margin: 0 var(--nv-pad, 16px);
  padding: 0.75rem 1.5rem 1.25rem;
  border-bottom: 2px solid #ba8d40;
  background: #fff;
  box-shadow: 0 18px 40px rgba(20, 28, 44, 0.2);
}

.nv-header__panel[hidden] {
  display: none;
}

.nv-header__panel a {
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(38, 52, 80, 0.1);
  color: #263450;
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}

.nv-header__panel a:last-child {
  border-bottom: 0;
}

.nv-header__panel a[aria-current="page"],
.nv-header__panel a:hover,
.nv-header__panel a:focus-visible {
  color: #ba8d40;
}

/* Utilities in the panel: a row like the other links that opens its three pages underneath (open
   already on a Utilities page). */
.nv-header__panel-group,
.nv-header__panel-subs {
  display: flex;
  flex-direction: column;
}

.nv-header__panel-subs[hidden] {
  display: none;
}

.nv-header__panel-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.85rem 0;
  border: 0;
  border-bottom: 1px solid rgba(38, 52, 80, 0.1);
  background: none;
  color: #263450;
  font: inherit;
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.nv-header__panel-toggle::after {
  content: "";
  width: 7px;
  height: 7px;
  margin: 0 0.25rem 4px 0;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.25s ease, margin 0.25s ease;
}

.nv-header__panel-toggle[aria-expanded="true"]::after {
  margin-bottom: -2px;
  transform: rotate(225deg);
}

.nv-header__panel-toggle.is-current,
.nv-header__panel-toggle:focus-visible {
  color: #ba8d40;
}

.nv-header__panel-toggle:focus-visible {
  outline: 2px solid #ba8d40;
  outline-offset: 2px;
}

/* The last page in the group keeps its rule, so Contact stays separated. */
.nv-header__panel .nv-header__panel-subs a:last-child {
  border-bottom: 1px solid rgba(38, 52, 80, 0.1);
}

.nv-header__panel .nv-header__panel-sub {
  padding-left: 1rem;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: none;
}

@media (max-width: 1099px) {
  .nv-header__nav .nv-header__link,
  .nv-header__dropdown {
    display: none;
  }
  .nv-header__toggle {
    display: inline-flex;
  }
}

@media (min-width: 1100px) {
  .nv-header__panel {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .nv-header__bar {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  .nv-header__logo {
    padding: 0.6rem 0.8rem;
  }
  .nv-header__logo-img {
    width: 104px;
  }
}

/* Floating bar: once the header has scrolled out of view, the script pins it to the top of the
   window as a frosted-glass bar with the navy-and-gold logo. It stays hidden above the window while
   the page scrolls down and slides in when the page scrolls up. Transitions are switched on
   (is-armed) only after the bar is pinned, so pinning it never animates on screen. Browsers without
   backdrop blur get a near-solid white bar so the navy links stay readable. */
.nv-header.is-floating {
  --nv-head-ink: #263450;
  position: fixed;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(186, 141, 64, 0.55);
  box-shadow: 0 10px 30px rgba(20, 28, 44, 0.08);
  transform: translate3d(0, calc(-100% - 2rem), 0);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nv-header.is-floating {
    background: rgba(255, 255, 255, 0.74);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    backdrop-filter: blur(18px) saturate(170%);
  }
}

.nv-header.is-floating.is-armed {
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nv-header.is-floating.is-revealed,
.nv-header.is-floating:focus-within {
  transform: none;
}

.nv-header.is-floating .nv-header__bar {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.nv-header.is-floating .nv-header__logo {
  padding: 0;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.nv-header.is-floating .nv-header__logo-img {
  width: 120px;
}

.nv-header.is-floating .nv-header__link {
  text-shadow: none;
}

.nv-header.is-floating .nv-header__burger {
  filter: none;
}

@media (max-width: 767px) {
  .nv-header.is-floating .nv-header__bar {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
  }
  .nv-header.is-floating .nv-header__logo-img {
    width: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nv-header__link::after,
  .nv-header__dropdown-menu,
  .nv-header__burger span,
  .nv-header.is-floating.is-armed {
    transition: none;
  }
}
