
*,
*::after,
*::before {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

/* ............/navbar/............ *
/* desktop mode............/// */

/* The navbar owns the `site-nav-*` namespace on purpose: bootstrap is loaded
   after this file (see scripts/build-frontend.sh) and it ships its own
   `.navbar` and `.container`, which used to win on source order and quietly
   set the padding/display/position of everything in here. */

.site-nav input[type="checkbox"],
.site-nav .site-nav-hamburger {
  display: none;
}

.site-nav {
  box-shadow: 0px 5px 10px 0px #aaa;
  position: sticky;
  top: 0;
  width: 100%;
  /* a translucent background rather than `opacity`, which would fade the logo
     and the slide-out menu along with it */
  background: rgba(255, 255, 255, 0.85);
  color: #000;
  min-height: 80px;
  padding: 1rem 0;
  z-index: 12;
}

/* the row inside the bar. The 0.75rem side padding is the same gutter the page
   content below uses, so the two line up on narrow screens */
.site-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 0.75rem;
}

.site-nav-menu {
  display: flex;
  order: 2;
  align-items: center;
  margin: 0;
  padding: 0;
  line-height: 1;
}

.site-nav-menu li {
  display: flex;
  align-items: center;

  list-style: none;
  margin-left: 1.5rem;
  margin-right: 1.5rem;
  font-size: 1.4rem;
}

.site-nav-menu a {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem; /* better click area */

  text-decoration: none;
  color: #444;
  font-weight: 500;
  transition: color 0.3s ease-in-out;
}

.site-nav-menu a:hover {
  color: black;
  transition: color 0.3s ease-in-out;
}

/* the logo *is* the link, so these have to sit on the element itself */
.site-nav-logo {
  order: 1;
  display: flex;
  align-items: center;
  font-size: 2.3rem;
  color: inherit;
  text-decoration: none;
}

.site-nav-logo:hover {
  color: initial;
}

.site-nav-logo img {
  max-height: 100%;
  width: auto;
}


/* ......../ media query /.......... */

@media (max-width: 768px) {
  .site-nav {
    /* single knob for the bar height, the slide-out menu keys off it */
    --nav-height: 64px;

    min-height: var(--nav-height);
    padding: 0;
    background: rgba(255, 255, 255, 0.95);
  }

  /* the bar itself: hamburger to the left, logo to the right, both centered.
     Everything that is not part of the bar (the checkbox and the slide-out
     menu) is taken out of the flow, so `align-items: center` only has these
     two to line up. */
  .site-nav-bar {
    position: relative;
    height: var(--nav-height);
  }

  .site-nav .site-nav-hamburger {
    order: 1;
    display: flex;
    flex: none;
    flex-direction: column;
    justify-content: space-between;
    height: 23px;
    width: 35px;
    z-index: 2;
  }

  .site-nav-logo {
    order: 2;
    height: 44px;
  }

  /* the invisible checkbox is the click target for the hamburger. It has to
     stay a *sibling* of the hamburger and the menu for the `~` rules further
     down, so instead of wrapping the lines in a <label> it is stretched over
     the left end of the bar. */
  .site-nav input[type="checkbox"] {
    position: absolute;
    display: block;
    top: 0;
    left: 0;
    height: 100%;
    width: 72px;
    margin: 0;
    z-index: 5;
    opacity: 0;
    cursor: pointer;
  }

  .site-nav-hamburger .line {
    display: block;
    height: 4px;
    width: 100%;
    border-radius: 10px;
    background: #333;
  }

  .site-nav-hamburger .line1 {
    transform-origin: 0% 0%;
    transition: transform 0.4s ease-in-out;
  }

  .site-nav-hamburger .line2 {
    transition: transform 0.2s ease-in-out;
  }

  .site-nav-hamburger .line3 {
    transform-origin: 0% 100%;
    transition: transform 0.4s ease-in-out;
  }

  /* the slide-out menu: `fixed` so it hangs straight off the bottom edge of
     the (sticky) bar and reaches the left edge of the screen, whatever the bar
     itself is padded with */
  .site-nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    height: calc(100vh - var(--nav-height));
    width: min(80vw, 300px);

    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 2rem;
    background: #fff;
    box-shadow: 5px 0px 10px 0px #aaa;

    /* a bit more than -100% so the box-shadow stays off screen too */
    transform: translateX(-120%);
    transition: transform 0.4s ease-in-out;
  }

  .site-nav-menu li {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 500;
  }

  .site-nav-menu a {
    padding: 0;
  }

  .site-nav-bar input[type="checkbox"]:checked ~ .site-nav-menu {
    transform: translateX(0);
  }

  .site-nav-bar input[type="checkbox"]:checked ~ .site-nav-hamburger .line1 {
    transform: rotate(35deg);
  }

  .site-nav-bar input[type="checkbox"]:checked ~ .site-nav-hamburger .line2 {
    transform: scaleY(0);
  }

  .site-nav-bar input[type="checkbox"]:checked ~ .site-nav-hamburger .line3 {
    transform: rotate(-35deg);
  }
}

@media (max-width: 500px) {
  html {
    font-size: 65%;
  }

  .site-nav-menu li {
    font-size: 1.8rem;
  }
}

@media (min-width: 769px) and (max-width: 1200px) {
}

@media (orientation: landscape) and (max-height: 500px) {
}
