/* Header and navigation. Built by /js/menu-init.js. */

.site-header,
.site-header * {
  box-sizing: border-box;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #ffffff;
  border-bottom: 1px solid #d6dfe8;
  font-family: "Schibsted Grotesk", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

.site-header .container {
  max-width: calc(1120px + 2 * clamp(20px, 4vw, 40px));
  margin: 0 auto;
  padding: 12px clamp(20px, 4vw, 40px);
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Logo */

.site-logo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
}

.site-logo img {
  display: block;
  height: 46px;
  width: auto;
}

/* Burger */

.nav-toggle {
  margin-left: auto;
  display: none; /* hidden on desktop */
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: none;
  border: 1.5px solid #d6dfe8;
  border-radius: 6px;
  font: inherit;
  font-size: 16px;
  color: #002448;
  cursor: pointer;
}

.nav-toggle:focus-visible,
.nav-parent:focus-visible,
.site-header a:focus-visible {
  outline: 3px solid #18609c;
  outline-offset: 2px;
}

/* Main menu */

.nav.main-nav {
  margin-left: auto;
}

.nav-root {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 6px;
  align-items: center;
}

.nav-root > li {
  position: relative;
}

.nav-root > li > a,
.nav-parent {
  display: inline-block;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: 6px;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  color: #1c2f45;
  text-decoration: none;
  cursor: pointer;
}

.nav-root > li > a:hover,
.nav-parent:hover,
.has-mega.open > .nav-parent {
  color: #002448;
  background: #f2f6f9;
}

.nav-parent::after {
  content: "";
  display: inline-block;
  width: 0.42em;
  height: 0.42em;
  margin-left: 0.5em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.2em) rotate(45deg);
}

/* The self-test link is the one call to action in the menu */

.nav-root > li > a.nav-cta {
  margin-left: 10px;
  padding: 9px 16px;
  background: #1b7a3a;
  color: #ffffff;
  font-weight: 600;
}

.nav-root > li > a.nav-cta:hover {
  background: #14602d;
  color: #ffffff;
}

/* Submenu */

.has-mega .mega {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  min-width: 240px;
  padding: 14px 8px 8px;
  background: #ffffff;
  border: 1px solid #d6dfe8;
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(0, 36, 72, 0.12);
  display: none;
}

.has-mega.open .mega {
  display: block;
}

.mega-col h4 {
  margin: 0 10px 6px;
  font-size: 13px;
  font-weight: 600;
  color: #4b5d72;
}

.mega-col h4:not(:first-child) {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid #d6dfe8;
}

.mega-col a {
  display: block;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 16px;
  color: #1c2f45;
  text-decoration: none;
}

.mega-col a:hover {
  color: #002448;
  background: #f2f6f9;
}

/* Mobile */

@media (max-width: 1060px) {
  .site-header .container {
    padding-block: 10px;
  }

  .site-logo img {
    height: 40px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav.main-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #ffffff;
    border-bottom: 1px solid #d6dfe8;
    box-shadow: 0 12px 28px rgba(0, 36, 72, 0.12);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease-out, transform 0.18s ease-out, visibility 0.18s;
  }

  .nav.main-nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-root {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px clamp(20px, 4vw, 40px) 16px;
  }

  .nav-root > li > a,
  .nav-parent {
    display: block;
    width: 100%;
    padding: 12px;
    text-align: left;
  }

  .nav-root > li > a.nav-cta {
    margin: 8px 0 0;
    text-align: center;
  }

  .has-mega .mega {
    position: static;
    min-width: 0;
    padding: 0 0 6px 12px;
    border: none;
    box-shadow: none;
  }

  .mega-col h4 {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav.main-nav {
    transition: none;
  }
}

/* Screen-reader text */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
