:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Avenir Next", Avenir,
    "Nimbus Sans L", Roboto, "Noto Sans", "Segoe UI", Arial, Helvetica,
    "Helvetica Neue", sans-serif;
  --font-serif: "Besley", Times New Roman, serif;
  --font-mono: Consolas, Menlo, Monaco, "Andale Mono", "Ubuntu Mono", monospace;

  --color-foreground: #100F0F;
  --color-background: #f5f5f5;
  --color-highlight: #ffedb9;
  --color-lowlight: #f1f1f1;
  --color-tablebase: #f3f3f3;
  --color-emphasis: #f44336;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
textarea,
select,
input,
progress {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--color-foreground);
  background: var(--color-background);
  font-family: var(--font-serif);

  font-size: 16px;
  line-height: 1.4;
  font-weight: 200;

  display: grid;
  grid-template-columns: 1fr min(15rem, 29%) min(75rem, 71%) 1fr;
  margin: 0;
  min-width: 320px;

  padding: 0 1rem;
}

::selection {
  background-color: var(--color-highlight);
}

@media only screen and (max-width: 960px) {
  nav {
    grid-column: 2 / span 2 !important;
    display: none;
  }
  main {
    grid-column: 2 / span 2 !important;
  }
  section {
    grid-column: 1 / span 2 !important;
  }
  .table-of-contents {
    margin: 0 !important;
  }
  body {
    font-weight: 300 !important;
  }
}

nav {
  grid-column: 2;
}

nav .table-of-contents {
  border-left: 1.5px solid var(--color-emphasis);
  transition: margin 150ms;
}

nav .table-of-contents ul {
  list-style-type: none;
}

main {
  grid-column: 3;
  display: grid;
  grid-template-columns: min(45rem, 64%) min(30rem, 36%);
  overflow-y: auto;
}

footer {
  grid-column: 2 / span 2;
  border-top: 2px solid var(--color-emphasis);
  margin: 5rem 0;
  padding: 2rem;
}

section {
  grid-column: 1;
}

section.table {
  grid-column: 1 / span 2;
}

section.spacer {
  padding: 2rem;
  text-align: center;
}

section.spacer .dot {
  display: inline-block;
  margin: 0 2rem;
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--color-emphasis);
  border-radius: 0.5rem;
}

strong {
  font-weight: 400;
}

a {
  color: var(--color-emphasis);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1 {
  font-weight: 500;
}

h2, h3, h4, h5 {
  font-weight: 400;
}

h1 {
  font-size: 3.6rem;
  line-height: 1.1;
}

h2 {
  font-size: 1.875rem;
}

h3 {
  font-size: 1.125rem;
}

table {
  border: none;
  border-collapse: collapse;
}

table thead > tr > th {
  border-bottom: 2px solid var(--color-emphasis);
}

table tr {
  border-bottom: 1px solid var(--color-emphasis);
}
table tr:hover {
  background-color: var(--color-lowlight);
}

table tr td {
  vertical-align: top;
  font-size: 0.9rem;
  padding: 1rem;
}

table tr td h3 {
  border-bottom: 1px dotted var(--color-emphasis);
}

table th:nth-child(1), table td:nth-child(1) {
  width: 15rem;
}
table th:nth-child(2), table td:nth-child(2) {
  width: 15rem;
}
table th:nth-child(3), table td:nth-child(3) {
  width: 20rem;
}
table th:nth-child(4), table td:nth-child(4) {
  background-color: var(--color-lowlight);
}

.table-container table {
  min-width: 70rem;
}

.table-container {
  overflow-x: auto;
}

span.chip {
  display: inline-block;
  padding: 0 0.5rem;
  border-radius: 0.5rem;
  margin-right: 0.5rem;
  cursor: pointer;
}

p {
  margin: 0 0 1rem 0;
}

p.small, small {
  font-size: 0.8rem;
}

ul, ol {
  padding-left: 1.5rem;
}
ul li, ol li {
  margin: 0.25rem 0;
}

input[type="checkbox"].fold-toggle {
  display: none;
}

.fold-caret {
  cursor: pointer;
  float: left;
  margin: 1.7rem 0.5rem 1rem 0;
  font-size: 1.5rem;
  width: 1rem;
}
.fold-caret::after {
  content: "\25BF"; /* Right */
}

.fold-body {
  position: relative;
  max-height: fit-content;
}

input[type="checkbox"].fold-toggle:checked ~ .fold-body {
  max-height: 4rem;
  overflow-y: hidden;
}
input[type="checkbox"].fold-toggle:checked ~ .fold-body::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4rem;
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0%,var(--color-background) 100%);
  cursor: pointer;
}

input[type="checkbox"].fold-toggle:checked ~ .fold-caret::after {
  content: "\25B9";
}

div.hidden {
  display: none;
}
