/* Top-level container */
header {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  margin: 0;
  background: var(--background-color);
  background-image: var(--background-image);
  mask-image: linear-gradient(black 80%, transparent 100%);
  padding-top: 0.5em;
  padding-bottom: 2em;
  z-index: 10000;
}

/* Skip-to-main-content link */
header > #skip-to-content {
  position: fixed;
  left: -65536px;
  top: -65536px;

  padding: 0.5em;
  background-color: var(--background-color);
  color: var(--text-color-dark);
  font-family: "Kirsty", serif;
}

header > #skip-to-content:focus {
  left: 0;
  top: 0;
}

/* Common rules for all navigation links */
header > nav a {
  display: inline-block;
  font-size: 18pt;
  text-decoration: none;
  text-transform: uppercase;
  color: var(--text-color-light);
}

/* Navigation menu is always at the top */
header > nav {
  position: sticky;
  width: calc(100% - min(10%, 10em));
  margin: 0 min(5%, 5em);
}

/* Wide viewports: flex the menu horizontally */
header > nav {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  white-space: nowrap;
  background-image: url("../images/chains.svg");
  background-repeat: no-repeat;
  background-position: center 100px;
  background-size: 86px;
}

/* Common style for navigation menu */
header > nav > ul {
  position: relative;
  list-style: none;
  margin: 0;
  margin-top: 13px;
  padding: 0;
  display: inline-block;
  background-image: url("../images/sign-middle.svg");
  background-size: contain;
}

header > nav > ul:before {
  content: "";
  position: absolute;
  left: -15px;
  top: 0;
  height: 100%;
  width: 15px;
  background-image: url("../images/sign-left.svg");
}

header > nav > ul:after {
  content: "";
  position: absolute;
  right: -15px;
  top: 0;
  height: 100%;
  width: 15px;
  background-image: url("../images/sign-right.svg");
}

/* Homepage link */
header > nav > a#home:hover {
  scale: 1;
}
header > nav > a#home > img {
  height: 100px;
}

/* Common style for navigation menu items */
header > nav > ul > li {
  display: inline-block;
  margin: 0 0.5em;
}

header > nav a {
  filter: drop-shadow(0px 0px 0 rgb(0, 0, 0, 0.25));
  scale: 1;
  transition:
    filter 0.2s,
    scale 0.2s;
}

header > nav a:hover {
  scale: 1.05;
  filter: drop-shadow(2px 2px 0 rgb(0, 0, 0, 0.25));
  text-shadow: none;
}

/* Mobile navigation */
header > nav > label[for="nav-expand"] {
  display: none;
  width: 1em;
  height: 1em;
  margin: 0.25em;
  padding: 0.1em;
  text-align: center;
  border: 1px solid var(--stroke-color);
  color: var(--text-color-dark);
  font-size: 20pt;
  border-radius: 0.25em;
  line-height: 18pt;
}
header > nav > #nav-expand {
  display: none;
  position: fixed;
  left: -65535px;
  top: -65535px;
}

@media (max-width: 1000px) {
  header > nav > ul > li {
    margin: 0 0.25em;
  }
}

/* Mobile styling */
@media (max-width: 820px) {
  header > nav {
    flex-direction: row;
    align-items: start;
    background-image: none;
  }
  header > nav > ul {
    padding-left: 0;
    overflow-x: none;
  }

  header > nav > ul,
  header > nav > ul:before,
  header > nav > ul:after {
    background-image: none;
  }

  header > nav a {
    color: black;
  }

  header > nav > a#home > img {
    height: 40px;
  }

  header > nav > label[for="nav-expand"] {
    display: block;
  }
  #nav-expand:not(:checked) + #nav-menu {
    display: none;
  }
  #nav-expand:checked + #nav-menu,
  #nav-expand:checked + #nav-menu li {
    display: block;
  }
  #nav-menu {
    text-align: right;
  }
}
