/* header and nav layout */
header .nav {
  display: grid;
  grid-template:
    "hamburger brand" 64px
    "sections sections" 1fr / 50px 1fr;
  align-items: center;
  padding: 0 2rem;
  position: fixed;
  z-index: 2;
  background-color: var(--background-color);
  width: 100vw;
  height: 64px;
  box-sizing: border-box;
}

header .nav a:any-link {
  color: var(--heading-color);
}


/* hamburger */
header .nav-hamburger {
  grid-area: hamburger;
  height: 22px;
  padding-top: 3px;
  cursor: pointer;
}

header .nav[aria-expanded='false'] .nav-hamburger-icon,
header .nav[aria-expanded='false'] .nav-hamburger-icon::after,
header .nav[aria-expanded='false'] .nav-hamburger-icon::before {
  box-sizing: border-box;
  position: relative;
  display: block;
  top: 8px;
  width: 20px;
  height: 2px;
  border-radius: 3px;
  background: currentcolor;
}

header .nav[aria-expanded='false'] .nav-hamburger-icon::after,
header .nav[aria-expanded='false'] .nav-hamburger-icon::before {
  content: "";
  position: absolute;
  top: -6px;
}

header .nav[aria-expanded='false'] .nav-hamburger-icon::after {
  top: 6px;
}

header .nav[aria-expanded='true'] .nav-hamburger-icon {
  box-sizing: border-box;
  position: relative;
  display: block;
  width: 22px;
  height: 22px;
  border: 2px solid transparent;
  border-radius: 5px;
  transform: translate(-3px, -2px);
}

header .nav[aria-expanded='true'] .nav-hamburger-icon::after,
header .nav[aria-expanded='true'] .nav-hamburger-icon::before {
  content: "";
  display: block;
  box-sizing: border-box;
  position: absolute;
  width: 22px;
  height: 2px;
  background: currentcolor;
  transform: rotate(45deg);
  border-radius: 5px;
  top: 8px;
  left: 1px
}

header .nav[aria-expanded='true'] .nav-hamburger-icon::after {
  transform: rotate(-45deg)
}

/* brand */
header .nav-brand {
  grid-area: brand;
  font-size: 22px;
  font-weight: 700;
  line-height: 1em;
}

header .nav-brand svg {
  padding-top: 4px;
  height: 40px;
}

header .nav-brand p {
  margin: 0;
  display: none;
}


header .nav-brand p:first-of-type {
  display: unset;
}

/* sections */
header .nav-sections {
  grid-area: sections;
  flex-direction: column;
  display: none;
  background-color: rgba(var(--background-color) / 92%);
  width: 100vw;
}

header .nav-sections h2 {
  font-size: 22px;
}

header .nav-sections ul {
  list-style: none;
  padding-left: 0;
} 

header .nav-sections li {
  font-size: 20px;
  font-weight: 700;
}

header .nav[aria-expanded='true'] .nav-sections {
  display: block;
  align-self: flex-start;
}

header .nav[aria-expanded='true'] {
  min-height: 100vh;
}

/* desktop nav styles */
@media (min-width: 1200px) {
  header .nav {
    display: block;
    height: 140px;
    position: unset;
  }
  

  header .nav-brand {
    width: 936px;
    margin: auto;
    display: flex;
    font-size: 15px;
    font-weight: 400;
    justify-content: space-between;
    align-items: center;
    height: 75px;
  }

  header .nav-brand p {
    display: unset;
  }

  header .nav-brand p:first-of-type {
    align-self: center;
  }

  header .nav-brand p a:first-of-type {
    display: inline-block;
    margin-right: 30px;
  }

  header .nav-brand img {
    padding: 0;
    height: 49px;
  }

  header .nav-hamburger {
    display: none;
  }

  header .nav-section.nav-divider {
    height: 30px;
    border-left: 1px solid #999;
    margin: 0 22px;
    padding: 0;
  }

  header .nav-section.nav-section-drop {
    padding-right: 25px;
  }

  header .nav-section.nav-section-drop::after {
    content: ' ';
    border: 1px solid #000;
    width: 5px;
    height: 5px;
    border-width: 1px 1px 0 0;
    display: inline-block;
    position: absolute;
    top: 8px;
    right: 10px;
    transform: rotate(135deg);
  }

  header .nav-sections {
    margin: auto;
    display: flex;
    flex-direction: row;
    background-color: unset;
    width: 936px;
    padding-left: 20px;
  }


  header .nav[aria-expanded='true'] .nav-sections {
    display: flex;
    min-height: unset;
  }

  header .nav-section {
    padding: 0 10px;
    position: relative;
  }

  header .nav-sections h2 {
    font-size: 17px;
    margin: 0;
    cursor: pointer;
    font-weight: 400;
  }

  header .nav-sections h2 a:any-link {
    color: #000;
  }

  header .nav-section ul {
    display: none;
  }

  header .nav-section li {
    font-size: 18px;
    padding: 8px 16px;
  }

  header .nav-section[aria-expanded='true'] ul {
    display: block;
    position: absolute;
    background-color: #018380;
    width: 300px;
    left: 0;
    z-index: 2;
  } 

  header .nav-section[aria-expanded='true'] ul a:any-link {
    color: var(--background-color);
  }
}
