@font-face {
  font-family: "IBM Plex Sans";
  src: url("/resources/fonts/IBM Plex Sans Var-Roman.woff2?b2sum=")
    format("woff2-variations");
  font-style: normal;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/resources/fonts/IBM Plex Sans Var-Italic.woff2?b2sum=")
    format("woff2-variations");
  font-style: italic;
}

#abstract:before {
  content: "Summary";
  font-style: bold;
}

html {
  font-size: 1rem;

  @media (max-width: 576px) {
    font-size: 0.9rem;
  }
}

body {
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 420;
  line-height: 1.75;
}

header {
  --border-color: gainsboro;
  --text-color: dimgray;

  margin: auto;
  max-width: 80ch;
  padding: 0.25rem 0 0.75rem;
  border-bottom: 1px var(--border-color) solid;

  nav ol {
    display: flex;
    flex: 0 auto;
    flex-flow: row wrap;
    justify-content: space-evenly;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;

    li a {
      color: var(--text-color);
      font-size: 1rem;
      font-weight: bold;
      text-transform: uppercase;
      text-decoration: unset;

      &:hover {
        color: var(--link-color);
      }
    }
  }
}

footer {
  border-top: 1px gainsboro solid;
  max-width: 80ch;
  margin: 5rem auto;

  font-size: 1.15rem;
}

main {
  margin: 0 auto;
  padding: 0 1rem;
  max-width: 65ch;
  font-size: 1.25rem;
}

#table-of-contents ul {
  list-style: none;
  padding-left: 0;
  font-weight: bold;

  a {
    color: unset;
    text-decoration: unset;

    &:hover {
      color: var(--link-color);
      text-decoration: underline solid 3px var(--link-color);
    }
  }

  li ul {
    font-weight: normal;
    li ul {
      padding-left: 1.25rem;
      li ul {
        padding-left: 1.25rem;
      }
    }
  }
}

a {
  --link-color: oklch(0.4 0.1 180);

  color: var(--link-color);
  text-underline-offset: 0.4rem;
  text-decoration: underline solid 1px var(--link-color);

  &:hover {
    text-decoration: underline solid 3px var(--link-color);
  }

  &:focus {
    outline: unset;
    background-color: moccasin;
  }

  &[href^="http"] {
    --link-color: oklch(0.4 0.2 270);

    &:after {
      --link-image: url(/resources/images/external-link.svg);

      content: "";
      background-image: var(--link-image);
      background-size: contain;
      background-repeat: no-repeat;
      position: relative;
      display: inline-block;
      width: 1rem;
      height: 1.5rem;
      margin-left: 0.5rem;
      margin-right: 0.2rem;
      baseline-shift: -27%;
    }
  }

  &[href*="wikipedia.org"]::after {
    --link-image: url(/resources/images/wikipedia-favicon.svg);
    width: 1.15rem;
    baseline-shift: -25%;
  }

  &[href*="pitt.edu"]::after {
    --link-image: url(/resources/images/pitt-shield.svg);
    width: 0.85rem;
    baseline-shift: -23%;
  }

  &[href*="creativecommons.org"]::after {
    --link-image: url(/resources/images/creative-commons-favicon.svg);
  }

  &[href*="gnu.org"]::after {
    --link-image: url(/resources/images/gnu-logo.svg);
  }

  &[href*="nytimes.com"]::after {
    --link-image: url(/resources/images/new-york-times-icon.svg);
  }

  &[href*="theregister.com"]::after {
    --link-image: url(/resources/images/the-register-favicon.svg);
  }

  &[href*="theguardian.com"]::after {
    --link-image: url(/resources/images/the-guardian-favicon.svg);
    baseline-shift: -25%;
  }

  &[href*="nature.com"]::after {
    --link-image: url(/resources/images/nature-favicon.svg);
  }

  &[href*="un.org"]::after {
    --link-image: url(/resources/images/un-emblem.svg);
    width: 1.25rem;
  }
}

h1 {
  font-size: 3.5rem;
  text-align: center;
}

h4 {
  display: inline;
  padding-right: 0.5rem;

  + p {
    display: inline;
  }
}

h1 a,
h2 a,
h3 a,
h4 a,
h5 a,
h6 a {
  color: unset;
  text-decoration: unset;

  &:hover {
    color: var(--link-color);
    text-decoration: none;
  }

  &:focus {
    text-decoration: none;
  }
}

.badge {
  height: 2.5rem;
  display: inline-block;
  margin-right: 1rem;
}
