/* Basic properties */
:root {
  --text-color: #c9c4bd;
  --emph-text-color: #ffffff;
  --bg-color: #1e1f29;
  --alt-bg-color: #2e3440;
  --sidebar-bg-color: #8a3435;
  --heading-color: #c34a4b;
  --link-color: var(--heading-color);
  --quote-color: var(--sidebar-bg-color);
  --button-color: var(--heading-color);
  --sidebar-width: 14rem;
}
html {
  color: var(--text-color);
  background-color: var(--bg-color);
  font-family: Sans;
  line-height: 1.5em;
}
body { margin: 0; }
/* Common elements */
h1, h2, h3, h4, h5, h6 {
  color: var(--heading-color);
  padding-bottom: 0;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  line-height: 1em;
}
strong, em { color: var(--emph-text-color); }
a {
  color: var(--link-color);
  text-decoration: none;
}
a em, a strong { color: var(--link-color); }
a:hover { text-decoration: underline; }
li { margin-bottom: 0.2em; }
.table-wrap {
  overflow-x: scroll;
  position: fixed;
  width: 100%;
}
.table-wrapper { overflow-x: auto; }
table {
  border-collapse: separate;
  table-layout: fixed;
  max-width: 100%;
  border-spacing: 0.25em;
}
img { width: 100%; }
th, td {
  padding: 0.5em;
  border: 1em;
  border-radius: 0.25em;
  background-color: var(--alt-bg-color);
  overflow: auto;
}
blockquote {
  margin-left: 0;
  border-left: 0.5ch solid var(--sidebar-bg-color);
  padding-left: 1.5ch;
  color: var(--quote-color);
}
blockquote strong, blockquote em { color: var(--heading-color); }
code {
  background-color: var(--alt-bg-color);
  border-radius: 0.25rem;
  padding: 0.25rem;
}
code-block { padding: 1rem; }
th code, td code { background-color: var(--bg-color); }
ul, ol {
  padding-left: 2ch;
  list-style-position: outside;
}
li { padding-left: 0ch; }
ol { list-style-type: decimal; }
ol ol { list-style-type: lower-alpha; }
ol ol ol { list-style-type: lower-roman; }
ol ol ol ol { list-style-type: circle; }

sup { line-height: 0 }

/* Forms, etc */
form label { text-align: center; }
form input {
  font-size: 1.4em;
}
form input[type=search] { width: 80%; }
form input[type=submit] { width: 20%; }
input, button {
  color: var(--emph-text-color);
  background-color: var(--alt-bg-color);
  border: none;
  border-radius: 0.25rem;
  padding: 0.5rem;
}
input[type=button], input[type=submit], button {
  background-color: var(--button-color);
  font-weight: bold;
  cursor: pointer;
}
input[type=button]:hover, input[type=submit]:hover, button:hover,
input[type=button]:active, input[type=submit]:active, button:active {
  opacity: 80%;
}
input[type=search], input[type=text] {
  padding: 0.45rem;
  border: 0.05rem solid var(--text-color);
}
th input, td input {
  background-color: var(--bg-color);
}

/* Sidebar */
.sidebar {
  color: var(--emph-text-color);
  background-color: var(--sidebar-bg-color);
  text-align: center;
  width: 100%;
  position: relative;
  height: 130%;
  overflow: auto;
}
.sidebar h1 {
  padding: 0;
  margin: 0;
}
.sidebar a {
  display: block;
  padding: 1rem;
  color: var(--emph-text-color);
  text-decoration: None;
}
  .sidebar nav {
    display: flex;
    align-items: stretch;
    align-content: stretch;
    flex-grow: 1;
  }
  .sidebar nav * {
    flex-grow: 1;
  }
.sidebar div {
  font-size: 0.8em;
  padding: 1rem;
  opacity: 0.8;
}
.sidebar a.active, .sidebar a:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

/* Main Content Box */
.contentScaler {
  margin-left: 0;
  padding: 1rem 1rem;
  /*overflow-wrap: anywhere;*/
}
main {
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

/* Convert sidebar to header on narrow screens */
@media screen and (min-width: 768px) {
  .sidebar {
    text-align: left;
    width: var(--sidebar-width);
    height: 120%;
    position: fixed;
  }
  .sidebar nav {
    display: block;
  }
  .contentScaler { margin-left: var(--sidebar-width); }
}

/* Index page styling */
article {
  background-color: var(--alt-bg-color);
  padding: 1rem;
  margin-bottom: 1rem;
  margin-top: 1rem;
  border-radius: 0.5rem;
}
article[onclick]:hover, article[onclick]:active {
  opacity: 80%;
}
/*.index {
  background-color: var(--alt-bg-color);
}*/

/* Specific part CSS */
.posttitle { margin-bottom: 0; }
.paginator {
  text-align: center;
  font-size: 1.3em;
}
.citeurl-explainer {
  color: var(--emph-text-color);
  font-weight: bold;
}
.toc {
  border: 0.2em solid var(--link-color);
  padding: 1em;
  margin-top: 2rem;
  margin-bottom: 2rem;
}
.toctitle {
  color: var(--emph-text-color);
  font-weight: bold;
  text-align: center;
  width: 100%;
}
