/* resets */
.navbar li {
  list-style: none;
}

.navbar a {
  text-decoration: none;
}

/* navbar */

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  z-index: 1;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 55px;
  background-color: var(--bkg-color);
  border-bottom: 1px solid var(--sidebar-bg-color);

  transform-style: preserve-3d;
}

@media only print {
  .navbar {
    position: relative;
  }
  .header {
    margin-bottom: -55px;
  }
  .nav-menu {
    display: none;
  }
}

/* hamburger menu */
.hamburger {
  display: none;
}

/* It is a <button> now, so undo the UA chrome: no border, no background, no
   inherited font metrics, and the bars keep their own spacing. */
button.hamburger {
  background: none;
  border: 0;
  padding: 0.4rem 0.2rem;
  margin: 0;
  font: inherit;
  color: inherit;
  line-height: 0;
}

button.hamburger:focus-visible {
  outline: 2px solid var(--link-color);
  outline-offset: 3px;
  border-radius: 3px;
}

.bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  -webkit-transition: all 0.3s ease-in-out;
  transition: all 0.3s ease-in-out;
  background-color: var(--text-color);
}

/* other elements */
.nav-menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bkg-color);
}

.nav-item {
  margin-left: 2rem;
  margin-top: calc(27.5px - 0.5rem);
}

.nav-item a {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-color);
}

.nav-item a:hover {
  color: var(--link-color);
  transition: 250ms;
}

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

.nav-logo {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text-color);
  margin: calc(27.5px - 0.6rem) 0.5rem;
  flex-grow: 1;
  font-family: 'Oswald';
  font-style: normal;
  transform: translateY(3px);
}

.nav-img {
  height: 40px;
  width: 40px;
  margin: 7.5px 0;
}

/* MEDIA QUERIES */
@media (max-width: /*855*/768px) {
  .nav-menu {
    position: fixed;
    left: 0;
    right: 0;
    top: 55px;
    /*transform: translateY(-100%);*/
    flex-direction: column;
    width: 100%;
    /*border-radius: 10px;*/
    text-align: center;
    /* visibility is transitioned in lockstep with the transform so the five
       links inside the closed drawer are not in the tab order while off screen. */
    transition: transform 0.3s, visibility 0s linear 0.3s;
    transform: translateY( calc(-100% - 5.2rem) ) translateZ(-10px);
    visibility: hidden;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    /* The drawer used to be painted in exactly the page colour with no visible
       edge, so an open menu read as a rendering glitch rather than a panel. */
    background-color: var(--sidebar-bg-color);
  }

  /* Scrim on body, not on the drawer: .nav-menu is transformed, so a fixed
     pseudo-element inside it is sized to the drawer rather than the viewport. */
  body.menu-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    background: rgba(0, 0, 0, 0.5);
  }

  /* Locked on the root element - overflow:hidden on body alone still lets the
     document scroll. !important because splash.js writes body.style.overflowY
     inline. */
  html.menu-open {
    overflow: hidden !important;
  }
  body.menu-open {
    overflow: hidden !important;
  }

  .nav-item {
    margin: 0.3rem 0;
  }

  .hamburger {
    display: block;
    cursor: pointer;
  }

  /* The mark keeps its square and the wordmark keeps its one line. The bar's flex
     row was oversubscribed at 320px: the logo link shrank to 34px wide (a 500x500
     mark painted 34x40) and "Luigi Pizzolito" wrapped to 67px tall inside the 55px
     bar, so the name spilled 4px above the top edge. Trimming the search button's
     desktop-sized 40px left gap buys back the width instead of squeezing the mark. */
  .navbar > a:first-of-type {
    flex: 0 0 auto;
  }

  .nav-logo {
    white-space: nowrap;
  }

  .btn-search {
    margin-left: 12px;
  }

  @media only screen {
    .nav-menu.active {
      transform: translateY(0%);
      visibility: visible;
      transition: transform 0.3s, visibility 0s;
    }
    .hamburger.active .bar:nth-child(2) {
      opacity:0;
    }
    .hamburger.active .bar:nth-child(1) {
      transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active .bar:nth-child(3) {
      transform: translateY(-8px) rotate(-45deg);
    }
  }

  .light-dark {
    margin-left: auto;
  }
  
}

@media only print and (max-width: 768px) {
  ul.nav-menu.active, ul.nav-menu {
    display: none;
  }
}

.spacer-nav {
  width: 100%;
  margin-bottom: 39px;
}

/* The bar is 55px and fixed, so this spacer is what keeps the article from starting
   underneath it. Below 64em the content padding is 32px, which put a post title at
   71px - 16px of air at 320, 390, 560 and 776 - while at 1024 and up the padding grows
   to 40px and the gap is 24px (audit finding 11). Same spacer, one clearance everywhere
   the padding is small: 32 + 52 - 55 = 29px. */
@media (max-width: 63.9375em) {
  .spacer-nav {
    margin-bottom: 52px;
  }
}
