* {
  --bgcolor: #fff;
  --textcolor: #444;
  --headcolor: #374;
  --linkcolor: #08b;
  --vlinkcolor: #529;
}

@media (prefers-color-scheme: dark) {
  * {
    --bgcolor: #222;
    --textcolor: #dadada;
    --headcolor: #4ba;
    --linkcolor: #ffc400;
    --vlinkcolor: #e80;
  }
}

html {
  margin: auto;
  padding: 10px;
  max-width: 76em;
}

body {
  line-height: 1.6;
  font-size: 16px;
  color: var(--textcolor);
  background: var(--bgcolor);
  padding: 1em;
  position: relative;
}

@media only screen and (min-width: 1200px) {
  body {
    padding: 0 .5em 0;
  }
}

@media only screen and (max-width: 1200px) {
  #sidebar {
    display: none;
  }
}

h1.title {
  text-align: center;
  border-bottom: 2px solid;
}

h1,
h2,
h3 {
  line-height: 1.2;
  padding: .1em;
  border-bottom: 1px solid;
  color: var(--headcolor);
}

a {
  color: var(--linkcolor);
  text-decoration: none;
  font-weight: bolder;
}

a:visited {
  color: var(--vlinkcolor)
}

ul>li {
  list-style-type: square;
}

code {
  font-weight: bolder;
}

#title-block-header .date {
  text-align: right;
  font-size: small;
}

/* From pandoc site layout */
.container {
  display: flex;
  justify-content: center;
}

#sidebar {
  order: 2;
  position: sticky;
  top: 2rem;
  max-width: 20em;
  min-width: 12em;
  align-self: baseline;
  background: transparent;
}

#toc {
  margin-top: 1em;
  margin-left: 2rem;
  height: 80vh;
  overflow-y: scroll;
  font-size: 11pt;
}

#toc code {
  font-size: 10pt;
}

div#toc li {
  list-style: none;
}

#toc>ul {
  margin-left: 0;
  margin-top: 4pt;
}

#toc li {
  padding-bottom: 3pt;
  padding-top: 3pt;
}

#toc ul {
  padding-left: 1em;
}

#toc ul>li {
  position: relative;
}

main {
  position: relative;
  /* needed for the anchor links to work */
  order: 1;
  max-width: 48em;
  min-width: 300px;
  /* ensure that any anchor can be at top */
  padding-bottom: 60em;
  flex-shrink: 3;
}

div.center {
  width: max-content;
  margin-left: auto;
  margin-right: auto;
}

.asciiart {
  line-height: initial;
}

div.twocolumns {
  display: grid;
  grid-template-columns: auto auto;
}
