@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Mono:ital,wght@0,200..800;1,200..800&family=Atkinson+Hyperlegible+Next:ital,wght@0,200..800;1,200..800&display=swap');

body {
  font-family: 'Atkinson Hyperlegible Next', sans-serif;
  line-height: 1.5;
  font-size: 1.2rem;
  min-height: 100dvh;
  overflow-x: hidden;
  margin: 0;
}

main {
  padding: 3rem .5rem;
  min-height: calc(100vh - 16em);
}

header {
  border-bottom: 3px solid var(--accent-color);
  background-color: white;
}

footer {
  border-top: 3px solid var(--accent-color);
}

main, header, footer {
  max-width: 50rem;
}

header, footer {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 1em;
}

footer a, button {
  border: none;
  border-radius: .3em;
  background-color: var(--accent-color);
  color: white;
  padding: .5em;
  display: flex;
}

footer a:hover, button:hover {
  filter: brightness(80%);
}

header a, main a {
  color: inherit;
  text-decoration: underline solid #999 2px;
}

header a:hover, main a:hover {
  text-decoration: none;
}

img {
  width: 100%;
  border-radius: 5px;
}

@media screen and (width >= 70rem) {
  #outline-toggle {
    display: none;
  }

  #outline {
    display: flex;
    width: 15rem;
  }

  main, header, footer {
    margin-left: 18rem;
  }
}

@media screen and (width < 70rem) {
  #outline {
    box-shadow: .4rem 0rem .8rem #bbb;
    max-width: calc(max(50vw, 15rem));
    width: calc(min(50vw, 15rem));
  }

  #outline.hidden {
    display: none;
  }

  #outline:not(.hidden) {
    display: flex;
  }

  header {
    position: sticky;
    top: 0px;
  }

  main, header, footer {
    margin: 0rem auto;
  }
}

#outline {
  position: fixed;
  flex-direction: column;
  justify-content: center;
  background-color: hsl(0, 0%, 95%);
  height: 100%;
  top: 0;
  left: 0;
  z-index: 5;
  padding: 2rem 1rem;
  overflow-x: scroll;
  text-indent: 1em hanging;
}

#outline p {
  margin-top: 0;
  margin-bottom: 0;
}

#outline ol, #outline ul {
  padding-inline-start: 1.5em;
  margin-top: 0;
  margin-bottom: 0;
}

#outline a {
  color: inherit;
  text-decoration: none;
}

#outline a:hover, #outline a.current:hover {
  color: var(--accent-color);
}

#outline a.current {
  font-weight: bold;
}

pre {
    max-width: 100%;
    overflow-x: auto;
    background-color: #eee;
    padding: 1rem;
    border-radius: 5px;
    font-size: 1rem;
}

pre code {
    padding: 0;
    background: none;
    font-size: 1em;
}

code {
    background-color: #eee;
    font-size: 0.8em;
    padding: 0.1em;
    border-radius: 5px;
    font-family: 'Atkinson Hyperlegible Mono', monospace;
}

table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

table th, td {
  padding: 0.4em;
  text-align: start;
}


tbody tr:nth-child(odd) {
  background-color: #f8f8f8;
}

td {
  border: .1em solid #eee;
}

@media (prefers-color-scheme: dark) {
  body {
    color: #bbb;
  }

  body, main, header, footer {
    background-color: #222;
  }

  #outline {
    background-color: hsl(0, 0%, 5%);
  }

  pre {
    background-color: #333;
  }

  code {
    background-color: #333;
  }

  tbody tr:nth-child(odd) {
    background-color: #181818;
  }

  td {
    border: .1em solid #333;
  }
}

@media screen and (prefers-color-scheme: dark) and (width <= 70rem) {
  #outline {
    box-shadow: .4rem 0rem .8rem #333;
  }
}
