/* Colors */

/*
All colors are intended to be given as values of variables to easily switch
between a light and a dark theme.
*/


/** Light Theme **/

/*
This is the default theme. It can be overridden via JavaScript (see below).
*/

[data-site-theme="light"] {
  --background-image-top-color: #8c1515;
  --background-image-bottom-color: white;
  --body-shadow-color: #8c1515;
  --content-background-color: white;
  --content-color: black;
  --top-bar-background-color: #e0e0e0;
  --top-bar-color: black;
  --button-background-color: #8c1515;
  --button-hover-background-color: #711212;
  --button-active-background-color: #595959;
  --button-color: white;
  --menu-button-color: black;
  --side-bar-heading-color: gray;
  --side-bar-shadow-color: #c0c0c0;
  --drop-down-option-background-color: darkgrey;
  --drop-down-option-hover-background-color: grey;
  --drop-down-option-selected-background-color: grey;
  --drop-down-option-color: #202020;
  --link-color: #b11b1b;
  --copyright-color: gray;
  --comp-undelined-color: #0069d3;
  --def-comp-undelined-color: #ad006d;
  --comp-colored-color: #0069d3;
  --def-comp-colored-color: #ad006d;
  --comp-subtle-color: #1e90ff80;
  --def-comp-subtle-color: #c7158580;
}


/** Dark Theme **/

/*
To switch to the dark theme, the "html" tag is annotated with an 
data-site-theme=dark" attribute via JavaScript.
*/

[data-site-theme="dark"] {
  --background-image-top-color: #8c1515;
  --background-image-bottom-color: white;
  --body-shadow-color: #8c1515;
  --content-background-color: #404040;
  --content-color: white;
  --top-bar-background-color: #202020;
  --top-bar-color: white;
  --button-background-color: #8c1515;
  --button-hover-background-color: #6e1111;
  --button-active-background-color: #595959;
  --button-color: white;
  --menu-button-color: white;
  --side-bar-heading-color: gray;
  --side-bar-shadow-color: #606060;
  --drop-down-option-background-color: darkgrey;
  --drop-down-option-hover-background-color: grey;
  --drop-down-option-selected-background-color: grey;
  --drop-down-option-color: #202020;
  --link-color: #ff4d4d;
  --copyright-color: gray;
  --comp-undelined-color: #67b3ff;
  --def-comp-undelined-color: #f167bf;
  --comp-colored-color: #67b3ff;
  --def-comp-colored-color: #f167bf;
  --comp-subtle-color: dodgerblue;
  --def-comp-subtle-color: mediumvioletred;
}


/* Symbol Highlighting Styles */

[data-symbol-highlighting-style="underlined"] {
  --ftml-comp-color: revert;
  --ftml-comp-text-decoration: underline solid var(--comp-undelined-color) 0.15ex;
  --ftml-comp-text-shadow: revert;
  --ftml-def-comp-color: revert;
  --ftml-def-comp-text-decoration: underline solid var(--def-comp-undelined-color) 0.15ex;
  --ftml-def-comp-text-shadow: revert;
}

[data-symbol-highlighting-style="colored"] {
  --ftml-comp-color: var(--comp-colored-color);
  --ftml-comp-text-decoration: revert;
  --ftml-comp-text-shadow: revert;
  --ftml-def-comp-color: var(--def-comp-colored-color);
  --ftml-def-comp-text-decoration: revert;
  --ftml-def-comp-text-shadow: revert;
}

[data-symbol-highlighting-style="subtle"] {
  --ftml-comp-color: revert;
  --ftml-comp-text-decoration: revert;
  --ftml-comp-text-shadow: 0.1ex 0.1ex 0.3ex var(--comp-subtle-color);
  --ftml-def-comp-color: revert;
  --ftml-def-comp-text-decoration: revert;
  --ftml-def-comp-text-shadow: 0.1ex 0.1ex 0.3ex var(--def-comp-subtle-color);
}

[data-symbol-highlighting-style="off"] {
  --ftml-comp-color: revert;
  --ftml-comp-text-decoration: revert;
  --ftml-comp-text-shadow: revert;
  --ftml-def-comp-color: revert;
  --ftml-def-comp-text-decoration: revert;
  --ftml-def-comp-text-shadow: revert;
}


/* General */

:root {
  --footer-height: 6.5em;
  --top-bar-height: 3em;
  --max-body-width: 1000px;
  --min-body-width: 300px;
  font-family: 'Atkinson Hyperlegible';
}

html {
  height: 100%;
  overscroll-behavior: none;
  background-image: linear-gradient(var(--background-image-top-color), var(--background-image-bottom-color));
  background-attachment: fixed;
  overflow-y: scroll;
  overflow-x: hidden;
}

body {
  margin: auto;
  max-width: var(--max-body-width);
  min-width: var(--min-body-width);
  min-height: calc(100% - var(--top-bar-height));
  box-shadow: 0 10px 10px var(--body-shadow-color);
}

main {
  background-color: var(--content-background-color);
  padding: 20px;
  margin-top: var(--top-bar-height);
  min-height: calc(100vh - 2 * var(--top-bar-height) - var(--footer-height) + 8px);
  width: calc(100% - 40px);
  max-width: inherit;
  color: var(--content-color);
  position: relative;
}


/* Footer */

footer {
  background-color: var(--content-background-color);
  height: var(--footer-height);
  width: 100%;
  max-width: inherit;
}

footer hr {
  margin-top: 0;
  margin-bottom: 0;
  border-color: var(--copyright-color);
  width: calc(100% - 40px);
}

footer .wrapper {
  padding-left: 20px;
  padding-right: 20px;
}

.footer-item {
  margin-bottom: 5px;
  width: fit-content;
  font-size: small;
  display: block;
}

#footer-copyright {
  margin-top: 10px;
  margin-bottom: 10px;
  color: var(--copyright-color);
}

.spacing {
  height: var(--footer-height);
}


/* Navigation */

header {
  z-index: 20;
  top: 0;
  height: var(--top-bar-height);
  overflow: hidden;
  background-color: var(--top-bar-background-color);
  position: fixed;
  width: 100%;
  max-width: min(100vw, var(--max-body-width));
}

#settings-button-wrapper {
  background-color: inherit;
  position: absolute;
  right: 0;
  height: var(--top-bar-height);
}

.settings-button {
  border: none;
  background-color: inherit;
  margin-right: 10px;
  height: 40px;
  width: 40px;
  margin-top: 0.4em;
}

.settings-button:hover {
  cursor: pointer;
}

.hamburger-line {
  width: 20px;
  border: 2px solid var(--menu-button-color);
  border-radius: 5px;
  margin-left: auto;
  margin-right: auto;
}

.hamburger-line:not(:last-child) {
  margin-bottom: 6px;
}

#hamburger-active-cross {
  transform: rotate(45deg) translateX(1px);
}

.cross-line-1 {
  width: 25px;
  border: 2px solid var(--menu-button-color);
  border-radius: 5px;
}

.cross-line-2 {
  position: absolute;
  width: 25px;
  border: 2px solid var(--menu-button-color);
  border-radius: 5px;
  top: 0;
  transform: rotate(90deg);
}

h1 {
  color: var(--top-bar-color);
  font-size: x-large;
  margin-left: 20px;
  font-weight: bold;
  margin-top: 0.4em;
  white-space: nowrap;
}

#side-bar-wrapper {
  z-index: 10;
  width: max-content;
  min-width: 25%;
  background-color: var(--top-bar-background-color);
  height: calc(100% + var(--footer-height) - 20px);
  position: absolute;
  top: 0;
  bottom: 0;
  padding: 10px;
  box-shadow: var(--side-bar-shadow-color) -10px 0 20px;
  margin-right: 0;
  margin-top: 0;
  border: none;
  color: var(--content-color);
}

#side-bar {
  position: sticky;
  top: calc(var(--top-bar-height) + 10px);
  max-height: calc(100vh - 80px);
  overflow-y: scroll;
  scrollbar-width: none;
  overscroll-behavior-y: none;
}

.navelem {
  color: var(--button-color);
  height: 20px;
  padding: 10px;
  background-color: var(--button-background-color);
  text-align: center;
  text-decoration: none;
  font-family: sans-serif;
  font-weight: bold;
  border: solid 1px var(--button-background-color);
  border-radius: 2px;
  margin-bottom: 10px;
  /* --- vertically center: --- */
  display: flex;
  align-items: center;
  justify-content: center;
  /* -------------------------- */
}

.navelem:hover {
  background-color: var(--button-hover-background-color);
  border-color: var(--button-hover-background-color);
  cursor: pointer;
}

.navelem.active {
  background-color: var(--button-active-background-color);
  border-color: var(--button-active-background-color);
}

.navelem.active:hover {
  cursor: default;
}

.side-bar-heading {
  color: var(--side-bar-heading-color);
  padding-bottom: 10px;
}

.side-bar-heading:not(:first-child) {
  padding-top: 20px;
}

input[type="radio"] {
    accent-color: var(--button-background-color); 
}


/* Footnotes */

[data-spa="footnote-content"] {
  bottom: 0;
  left: 0;
  position: fixed;
  z-index: 5;
  width: calc(100% - 20px);
  color: var(--top-bar-color);
  max-width: calc(min(100vw, var(--max-body-width)) - 20px);
  padding: 10px;
  border: none;
  background-color: var(--top-bar-background-color);
}

[data-spa="footnote-content-close-button"]::after {
  content: "✕";
  color: var(--menu-button-color);
  position: absolute;
  right: 10px;
  font-size: x-large;}

[data-spa="footnote-content-close-button"]:hover {
  cursor: pointer;
}

[data-spa="footnote-content-mark"] {
  display: block !important;
}

[data-spa="footnote-content-text"] {
  visibility: visible !important;
  display: block !important;
  padding-top: 5px;
}


/* Misc */

h2,h3 {
  hyphens: auto;
}

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

.top-section {
  margin-top: -20px;
}

section:not(.top-section) {
  margin-top: 30px;
}

p {
  text-align: justify;
  hyphens: auto;
}

pre {
  display: inline;
}

.emph {
  font-style: italic;
}

.small-caps {
  font-variant: small-caps;
}

.monospace {
  font-family: monospace;
}

.tex-e {
  vertical-align: -0\.25em;
  margin-left: -0\.1667em;
  margin-right: -0\.125em;
  line-height: 1ex;
}

.top-par {
  margin-top: 0;
}


/* Fonts */

@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  src: url(../fonts/AtkinsonHyperlegible-Regular.ttf) format('truetype');
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: italic;
  font-weight: 400;
  src: url(../fonts/AtkinsonHyperlegible-Italic.ttf) format('truetype');
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: bold;
  src: url(../fonts/AtkinsonHyperlegible-Bold.ttf) format('truetype');
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: italic;
  font-weight: bold;
  src: url(../fonts/AtkinsonHyperlegible-BoldItalic.ttf) format('truetype');
  font-display: swap;
}
