/* ==========================================================================
   Site header & language toggle

   Imported by styles.css, and linked on its own by pages with their own
   stylesheet (e.g. residency blogs). Rules are scoped and don't rely on
   styles.css resets, so they render the same on both.
   ========================================================================== */

@font-face {
  font-family: "Singlex";
  src: url("/static/fonts/Singlex.woff2") format("woff2");
  descent-override: 0%;
  ascent-override: 100%;
}
@font-face {
  font-family: "Bookish";
  src: url("/static/fonts/Bookish-Book.woff2") format("woff2");
  font-style:normal;
  font-synthesis: none;
}
@font-face {
  font-family: "Bookish";
  src: url("/static/fonts/Bookish-Italic.woff2") format("woff2");
  font-style:italic;
  font-synthesis: none;
}

/* Root font size of the main site; styles.css uses it for html, body */

:root {
  --site-font-size: 24px;
}
@media (max-width: 800px) {
  :root {
    --site-font-size: 20px;
  }
}
@media (max-width: 640px) {
  :root {
    --site-font-size: 18px;
  }
}
@media (max-width: 480px) {
  :root {
    --site-font-size: 16px;
  }
}

site-header, lang-toggle {
  display: block;
  font-size: var(--site-font-size);
  font-family: "Bookish", serif;
  line-height: normal;
  color: black;
}

/* Navigation */

nav {
  width: 100%;
  font-size: calc(0.8 * var(--site-font-size));
  margin-block: calc(0.25 * var(--site-font-size));
  ul {
    margin: 0;
    padding: 0;
    max-width: none;
    overflow: visible;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap:1ch;
    width: 100%;
    justify-content:center;
    li {
      text-align: center;
      a {
        text-decoration:none;
        color: black;
        padding:0 5px;
        &:hover {
          outline:1px dashed blue;
        }
      }
    }
  }
}
@media (max-width: 585px) {
  nav ul {
    gap:0.5ch;
  }
}

/* Logo */

.header-logo {
  text-align: center;
  font-family: "Singlex", sans-serif;
  p {
    margin: 0;
    max-width: none;
    font-size: calc(0.75 * var(--site-font-size));
    line-height: 1;
    letter-spacing:0.1em;
  }
  a {
    text-decoration:none;
    color:black;
  }
}

/* Language toggle */

lang-toggle {
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  button {
    border:none;
    padding:0;
    background:none;
    color: black;
    font-size: calc(0.8 * var(--site-font-size));
    font-family:"Bookish", sans-serif;
    letter-spacing:0.05em;
    cursor:pointer;
    &:hover {
      outline:1px dashed blue;
    }
  }
}
