/* The shared top bar. Standalone from site.css so the homepage, which has its
   own layout from style.scss, can take the nav without the rest. */

:root {
  --max-width: 60rem;
  --nav-h: 52px;
  --text: #222;
  --text-soft: #55596f;
  --line: #e0e0e8;
  --card: #fff;
  --fill: #fafafc;
  --primary: #d33;
}

/* Makes up for the nav being out of the flow */
body {
  padding-top: var(--nav-h);
}

/* Fixed, so the page can rubber-band under it without dragging it along */
nav.site {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  padding: 0;
  /* Picnic sets Arial on the homepage; the bar reads the same everywhere.
     The smoothing comes from reset.css, which the homepage does not load, and
     without it the same weight renders visibly heavier. */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

/* The homepage also loads Picnic, which lays its own nav out with floats and a
   half-height translate. Everything it sets on .brand and .burger is undone
   here, otherwise both land off-centre with the burger hidden. */
nav.site .brand,
nav.site .burger {
  float: none;
  position: static;
  transform: none;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

nav.site a {
  color: var(--text-soft);
  text-decoration: none;
}

nav.site .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  max-width: none;
  font-size: 15.5px;
  font-weight: normal;
  white-space: nowrap;
}

nav.site .brand img {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  margin: 0;
}

/* Mobile: the links collapse into a burger dropdown; at 700px they are a row */
.site-links {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  gap: 2px;
  padding: 8px 1.5rem 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
}

.site-links a {
  font-weight: 500;
  padding: 8px;
  font-size: 15px;
}

.site-links a:hover,
.site-links a.active {
  color: var(--primary);
}

.nav-toggle:checked ~ .site-links {
  display: flex;
}

.nav-toggle {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

nav.site .burger {
  display: flex;
  align-items: center;
  padding: 4px;
  margin: -4px;
  color: var(--text-soft);
}

@media (min-width: 700px) {
  .site-links {
    display: flex;
    position: static;
    flex-direction: row;
    gap: 22px;
    padding: 0;
    background: none;
    border-bottom: none;
  }
  .site-links a {
    padding: 0;
    font-size: 13.5px;
  }
  nav.site .burger {
    display: none;
  }
}
