/* Variables */
:root {
  --dark: black;
  --grey: #2f2f2f;
  --light: #f0ffff;
  --seafoam: #72c4d0;

  --light-text-color: var(--dark);
  --light-background-color: var(--light);

  --text-color: var(--light);
  --background-color: var(--dark);

  --font-family: "SourceSansPro", Palatino, Helvetica;
  --font-size-base: 18px;

  --base-padding: 5px;
  --depth: 0;

  --edge-margin: 15px;
  --max-width: 100ch;
  --toc-width: 250px;

  /* Pagefind */
  --pagefind-ui-scale: 1 !important;
  --pagefind-ui-primary: var(--text-color) !important;
  --pagefind-ui-text: var(--text-color) !important;
  --pagefind-ui-background: var(--background-color) !important;
  --pagefind-ui-border-radius: 0px !important;
  --pagefind-ui-font: var(--font-family) !important;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
}

a {
  color: var(--text-color);
  font-family: var(--font-family);
  font-weight: bold;
  text-decoration: none;
}

a:hover:not(.img) {
  color: var(--background-color);
  background-color: var(--text-color);
  border-radius: 8px 0px;
  padding: 1px;
}

a:hover .epistemic-icon {
  filter: invert(100%);
}

pre {
  background-color: #2c2c2c;
}

/* Tables */

.content th,
td {
  padding-top: 5px;
  padding-bottom: 5px;
  padding-left: 15px;
  padding-right: 15px;
  text-align: left;
}

.content tr:nth-child(even) {
  background-color: var(--grey);
}

thead {
  background: url(img/rainbow.webp);
  background-color: darkseagreen;
  background-blend-mode: multiply;
}

input::placeholder {
  color: var(--text-color) !important;
  opacity: unset !important;
}

mark {
  background-color: var(--seafoam) !important;
}

/* Class or ID selectors */

#directory-content {
  background-color: var(--background-color);
  color: var(--text-color);
}

/* Not sure I liked the light theme...
@media (prefers-color-scheme: dark) {
}

@media (prefers-color-scheme: light) {
  body {
    background-color: var(--light-background-color);
    color: var(--light-text-color);
  }

  a {
    color: var(--light-text-color);
  }

  pre {
    background-color: white;
    border-style: line;
    border-width: 1px;
    border-color: #777
  }

  .content a:hover:not(.img) {
    color: var(--light-background-color);
    background-color: var(--light-text-color);
  }

  #directory-content {
    background-color: var(--light-background-color);
    color: var(--light-text-color);
    border-color: var(--light-text-color);
  }

  #directory-content > details[open] {
    border-color: var(--light-text-color);
  }
}
*/

/* Font related */
@font-face {
  font-family: "SourceSansPro";
  src: url("fonts/SourceSansPro-Light.ttf") format("truetype");
}

/* Standard elements */
body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.5;
  padding: var(--base-padding);
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 20px;
}

footer img,
svg {
  border-radius: 5px;
  padding: 10px;
  width: 32px;
  height: 32px;
  background-color: var(--dark);
}

footer svg {
  display: inline-block;
}

footer path {
  fill: white;
}

img {
  max-width: calc(100% - (var(--base-padding) / 2));
}

details {
  padding-right: 10px;
  padding-left: calc(10px * var(--depth) - (5px * (var(--depth) - 2)));
}

details ul {
  margin-top: 0px;
  margin-bottom: 0px;
  margin-left: -10px;
}

blockquote {
  border-image: url(img/rainbow.webp) 30;
  border-image-width: 2px;
  margin: 0.5em 20px;
  padding: 1.505em 30px;
  quotes: "\201C" "\201D" "\2018" "\2019";
}

blockquote + p {
  margin-left: 1.5em;
}

blockquote:before {
  content: open-quote;
  font-size: 4em;
  line-height: 0.1em;
  margin-right: 0.25em;
  vertical-align: -0.4em;
}

blockquote p {
  display: inline;
}

th {
  padding-right: 25px;
}

pre {
  border-style: solid;
  border-width: 1px;
  white-space: pre-wrap;
  padding: 10px;
}

summary:hover {
  cursor: pointer;
  text-decoration: underline;
}
summary *:focus {
  outline: none;
}

/* scroll bars */

/* Works on Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--light) var(--dark);
}

/* Works on Chrome, Edge, and Safari */
*::-webkit-scrollbar {
  width: 14px;
}

*::-webkit-scrollbar-track {
  background: var(--dark);
}

*::-webkit-scrollbar-thumb {
  background-color: var(--light);
  border-radius: 20px;
  border: 3px solid var(--dark);
}

/* Classes */

.hidden {
  display: none;
}

.timestamp {
  font-size: calc(var(--font-size-base) - 2px);
}

.timestamp p {
  display: inline;
}

.top {
  display: block;
  max-width: var(--max-width);
  padding-top: 10px;
  margin-left: var(--edge-margin);
  margin-right: var(--edge-margin);
}

#directory {
  z-index: 100;
  position: absolute;
  left: 150px;
  top: 50px;
  min-width: 18ch;
  max-width: 45ch;
}

#directory-content > details[open] {
  border-style: solid;
  border-width: 2px;
}

#directory-content {
  position: relative;
  bottom: 5px;
  margin-top: 5px;
  font-size: calc(var(--font-size) - 2px);
  max-width: inherit;
  min-width: inherit;
}

#directory-content p {
  margin: 0px;
}

#page-family {
  display: flex;
  position: relative;
  top: -115px;
  left: 150px;
  line-height: 1;
  padding-top: 0px;
  padding-bottom: 0px;
  margin-bottom: -100px;
  flex-flow: row wrap;
  max-width: calc(var(--max-width) - 150px);
}

#toc {
  position: fixed;
  max-width: var(--toc-width);
  margin-left: var(--max-width);
  max-height: calc(100vh - 250px);
  overflow-y: hidden;
}

@media only screen and (max-width: calc(var(--max-width)+ 420px)) {
  #toc {
    display: none;
  }
}

#main {
  display: block;
  max-width: var(--max-width);
  margin-left: var(--edge-margin);
  margin-right: var(--edge-margin);
  padding-top: 10px;
}

#rainbow {
  display: block;
  height: 35px;
  overflow: hidden;
}

/* Snowflakes */

.epistemic-icon {
  padding-left: 5px;
  padding-right: 2px;
  max-height: calc(var(--font-size-base) - 2px);
  max-width: calc(var(--font-size-base) - 2px);
  transition: transform 1s ease-in-out;
  position: relative;
  top: 4px;
}

.tooltip {
  position: relative;
  display: inline-block;
  border-bottom: 1px dotted white;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 100px;
  background-color: white;
  color: #fff;
  text-align: center;
  border-radius: 5px;
  padding: 5px 5px 0px 5px;

  /*Position the tooltip*/
  position: absolute;
  z-index: 1;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
}

a:hover .epistemic-icon {
  transform: rotateX(-180deg);
}

#metasyn-icon {
  width: 100px;
}

#search-icon {
  width: 35px;
  position: relative;
  right: -5px;
  top: -25px;
}

#summary {
  text-align: end;
}
