/*
 * Site header
 * Mobile-first
 */

/* Header
--------------------------------------------- */

.header {
  position: sticky;
  top: 0;
  right: 0;
  left: 0;
  z-index: 100;
  width: 100%;
  background-color: #001321;
  color: #fff;
  border-bottom: 1px solid #163b52;
}

.header-container {
  display: flex;
  width: min(calc(100% - (20px * 2)), 96rem);
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  gap: 1rem;
}

/* Mobile logo
--------------------------------------------- */

.header-logo {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding-inline: 1rem;
  text-align: center;
}

.header-logo a {
  color: var(--blue);
  font-family: Inter, Arial, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.header-logo .custom-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-logo .custom-logo {
  display: block;
  width: auto;
  max-width: 10rem;
  max-height: 3rem;
}

/* Hamburger button
--------------------------------------------- */

.menu-btn {
  position: relative;
  z-index: 110;
  display: flex;
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
}

.menu-btn span {
  position: absolute;
  left: 0;
  width: 1.75rem;
  height: 1px;
  background-color: currentColor;
  transform-origin: center;
  transition:
    top 280ms ease,
    transform 280ms ease;
}

.menu-btn span:first-child {
  top: 0.55rem;
}

.menu-btn span:last-child {
  top: 1.1rem;
}

.menu-btn.is-open span:first-child {
  top: 0.85rem;
  transform: rotate(45deg);
}

.menu-btn.is-open span:last-child {
  top: 0.85rem;
  transform: rotate(-45deg);
}

/* Desktop navigation hidden on mobile
--------------------------------------------- */

.header-nav {
  display: none;
}

.nav-container {
  display: flex;
  flex: 0 0 1.75rem;
  align-items: center;
  justify-content: flex-end;
}

.header-cta {
  display: none;
}

/* Mobile menu panel
--------------------------------------------- */

.mobile-menu {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  z-index: 90;
  max-height: calc(100vh - 4.5rem);
  overflow-y: auto;
  background-color: #062334;
  border-bottom: 1px solid #163b52;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-1.5rem);
  transition:
    opacity 340ms ease,
    visibility 340ms ease,
    transform 340ms ease;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.mobile-nav {
  padding-block: 1.5rem 2rem;
}

.mobile-menu-list {
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

.mobile-menu-list > li {
  margin-block: 1.25rem;
}

.mobile-menu-list a {
  color: #fff;
  font-family: Inter, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mobile-menu-list a:hover,
.mobile-menu-list a:focus-visible,
.mobile-menu-list .current-menu-item > a,
.mobile-menu-list .current_page_item > a {
  color: var(--blue);
}

/* Mobile submenu
--------------------------------------------- */

.mobile-menu-list .sub-menu {
  display: none;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.mobile-menu-list .menu-item-has-children.is-open > .sub-menu {
  display: grid;
  gap: 0.75rem;
}

.mobile-menu-list .sub-menu li {
  margin: 0;
}

.mobile-menu-list .sub-menu a {
  color: #b3c3d3;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
}

.mobile-menu-list .menu-item-has-children > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.mobile-menu-list .menu-item-has-children > a::after {
  width: 0.45rem;
  height: 0.45rem;
  margin-top: -0.2rem;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  content: "";
  transform: rotate(45deg);
  transition: transform 220ms ease;
}

.mobile-menu-list .menu-item-has-children.is-open > a::after {
  margin-top: 0.2rem;
  transform: rotate(225deg);
}

/* Mobile CTA
--------------------------------------------- */

.mobile-menu__cta {
  margin-top: 1.5rem;
}

/* Prevent page scrolling while menu is open
--------------------------------------------- */

body.menu-open {
  overflow: hidden;
}

/* Desktop
--------------------------------------------- */

@media (min-width: 78rem) {
  .header-container {
    min-height: 5rem;
  }

  .menu-btn {
    display: none;
  }

  .header-logo {
    flex: 0 0 auto;
    justify-content: flex-start;
    padding: 0;
  }

  .header-logo .custom-logo {
    max-width: 13rem;
    max-height: 3.5rem;
  }

  .nav-container {
    flex: initial;
    gap: 1.25rem;
  }

  .header-nav {
    display: block;
  }

  .nav-menu {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 1.35vw, 1.4rem);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .nav-menu .menu-item {
    position: relative;
  }

  .nav-menu > .menu-item > a {
    color: #fff;
    font-family: Inter, Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .nav-menu > .menu-item > a:hover,
  .nav-menu > .current-menu-item > a,
  .nav-menu > .current_page_item > a,
  .nav-menu > .current-menu-ancestor > a {
    color: var(--blue);
  }

  .header-cta {
    display: inline-flex;
    padding-inline: 1.5rem;
    white-space: nowrap;
  }

  .mobile-menu {
    display: none;
  }
}

/* Desktop dropdown menu
--------------------------------------------- */

@media (min-width: 78rem) {
  .nav-menu > .menu-item-has-children::after {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 1rem;
    content: "";
  }

  .nav-menu .sub-menu {
    position: absolute;
    top: calc(100% + 1rem);
    left: 50%;
    z-index: 20;
    display: grid;
    gap: 0.75rem;
    min-width: 14rem;
    margin: 0;
    padding: 1rem;
    background-color: #062334;
    border: 1px solid #163b52;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 0.75rem);
    transition:
      opacity 220ms ease,
      visibility 220ms ease,
      transform 220ms ease;
  }

  .nav-menu .menu-item:hover > .sub-menu,
  .nav-menu .menu-item:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
  }

  .nav-menu .sub-menu a {
    display: block;
    color: #fff;
    font-family: Inter, Arial, sans-serif;
    font-size: 0.875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .nav-menu .sub-menu a:hover,
  .nav-menu .sub-menu a:focus-visible {
    color: var(--blue);
  }

  /* WordPress marks same-page anchor links as current menu items. */
  .header-nav .nav-menu > .menu-item-type-custom.current-menu-item > a[href*="#"],
  .header-nav .nav-menu > .menu-item-type-custom.current_page_item > a[href*="#"] {
    color: #fff;
  }

  .header-nav .nav-menu > .menu-item-type-custom.current-menu-item > a[href*="#"]:hover,
  .header-nav .nav-menu > .menu-item-type-custom.current-menu-item > a[href*="#"]:focus-visible,
  .header-nav .nav-menu > .menu-item-type-custom.current_page_item > a[href*="#"]:hover,
  .header-nav .nav-menu > .menu-item-type-custom.current_page_item > a[href*="#"]:focus-visible {
    color: var(--blue);
  }
}

.mobile-menu-list > .menu-item-type-custom.current-menu-item > a[href*="#"],
.mobile-menu-list > .menu-item-type-custom.current_page_item > a[href*="#"] {
  color: #fff;
}

.mobile-menu-list > .menu-item-type-custom.current-menu-item > a[href*="#"]:hover,
.mobile-menu-list > .menu-item-type-custom.current-menu-item > a[href*="#"]:focus-visible,
.mobile-menu-list > .menu-item-type-custom.current_page_item > a[href*="#"]:hover,
.mobile-menu-list > .menu-item-type-custom.current_page_item > a[href*="#"]:focus-visible {
  color: var(--blue);
}

/* KRAUSS wordmark fallback and desktop consultation. */
.brand{display:block;flex-shrink:0;color:#fff}.brand strong{display:block;font-size:31px;letter-spacing:-.045em;font-weight:900;line-height:1}.brand span{display:block;font-size:10px;letter-spacing:.16em;font-weight:600;margin-top:3px}.header-logo.brand{display:flex}.header-logo.brand>a{color:#fff;letter-spacing:normal}.header-logo .custom-logo{max-height:3rem}.header-cta{font-size:12px}.header-cta-short{display:none}.nav-menu .sub-menu{border-radius:6px}.nav-menu .sub-menu a{font-size:12px;text-transform:none;letter-spacing:0}.header .header-container{margin-inline:auto}.header-logo strong{font-size:28px}.header-logo span{font-size:9px}.header .mobile-menu-list{font-family:Inter,Arial,sans-serif}.header .mobile-menu-list>li>a{padding:0}.header .mobile-menu-list .sub-menu a{padding:0;line-height:1.6}.header .mobile-menu-list>li{position:relative}
@media(min-width:78rem){.header-logo .custom-logo{max-width:140px}.header .nav-menu>li>a{font-size:12px;letter-spacing:0;text-transform:none}.header .nav-menu{gap:18px}}
@media(max-width:77.999rem){.header-logo.brand{position:static;transform:none;max-width:none;margin:0;flex:1;padding-inline:1rem}.header .nav-container{width:1.75rem;min-width:1.75rem}.header .header-cta{display:none}.header .mobile-menu{max-height:calc(100dvh - 4.5rem)}.admin-bar .header{top:46px}.admin-bar .mobile-menu{max-height:calc(100dvh - 4.5rem - 46px)}}@media(min-width:783px){.admin-bar .header{top:32px}}
.mobile-consultation{display:flex;justify-content:center;margin-top:1.5rem}.mobile-consultation .mobile-menu__cta{margin-top:0;min-height:44px;padding:12px 24px;font-size:13px;letter-spacing:0;text-transform:none}
