/* Code blocks */

pre {
  overflow-x: auto;
  border: solid #aaa 1px;
  border-left: .25rem solid var(--pre-color);
  padding: 8px;
  >code {
    white-space: pre;
    overflow: visible;
    background-color: unset;
    padding: 0;
  }
}

pre.numberSource {
  border-left: .25rem solid var(--pre-color);
  margin: 0;
  padding-left: 0;
}

div.sourceCode {
  overflow: visible;
  margin: 0;
}
pre.sourceCode {
  margin: var(--universal-margin);
  overflow-x: auto;
}

pre.sourceCode.numberSource {
  overflow-x: visible;
  > code {
    white-space: pre-wrap
  }
  > span {
    left: 8px;
    text-indent: -4.6em;
  }
}

/* code folding */
.chunk-summary {
  text-align: right;
  margin-right: var(--universal-margin);
  + {
    pre, div.sourceCode {
      margin-top: 2px;
    }
  }
}

/* TOC */
nav[role="doc-toc"] {
  > ul {
    border: .0625rem solid #444;
    border-radius: 4px;
    margin: 5px;
    padding: 5px;
  }
  ul {
    list-style-type: none;
    li {
      padding: 0;
    }
    ul {
      margin-top: 0;
      margin-bottom: 0;
      padding-top: 0;
      padding-bottom: 0;
    }
  }
  code {
    background-color: unset;
    color: unset;
    padding: 0;
  }
}

/* header */
header {
  height: auto;
}

/* accordion */
article > .collapse {
  margin: 0;
  width: auto;
  > {
    label, label + div, :checked + label + div {
      margin: 0 calc(2*var(--universal-margin));
      width: calc(100%-4*var(--universal-margin));
    }
  }
}
