/* 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-theme="light"] {
  --background-image-outer-color: white;
  --background-image-inner-color: #a2d9ce;
  --content-background-color: white;
  --content-color: black;
  --top-bar-background-color: #e0e0e0;
  --top-bar-color: black;
  --button-background-color: #159d82;
  --button-hover-background-color: #12876f;
  --button-active-background-color: #606060;
  --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: #008f72;
  --copyright-color: gray;
}


/** Dark Theme **/

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

[data-theme="dark"] {
  --background-image-outer-color: black;
  --background-image-inner-color: #a2d9ce;
  --content-background-color: #404040;
  --content-color: white;
  --top-bar-background-color: #202020;
  --top-bar-color: white;
  --button-background-color: #159d82;
  --button-hover-background-color: #12876f;
  --button-active-background-color: #404040;
  --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: #1fe0ba;
  --copyright-color: gray;
}


/* General */

:root {
  --footer-height: 6.5em;
  --top-bar-height: 3em;
  font-family: 'Atkinson Hyperlegible';
}

html {
  height: 100%;
  overscroll-behavior: none;
  background-image: linear-gradient(to right, var(--background-image-outer-color), var(--background-image-inner-color), var(--background-image-outer-color));
  background-attachment: fixed;
  overflow-y: scroll;
}

body {
  margin: auto;
  max-width: 1000px;
  min-width: 300px;
  height: calc(100% - var(--top-bar-height));
}

#content {
  background-color: var(--content-background-color);
  padding: 20px;
  min-height: calc(100% - 40px);
  margin-top: var(--top-bar-height);
  width: calc(100% - 40px);
  max-width: inherit;
  color: var(--content-color);
  position: relative;
}


/* Footer */

footer {
  height: var(--footer-height);
  padding: 10px;
  position: absolute;
  bottom: 0;
  left: 10px;
  width: calc(100% - 40px);
  max-width: 100%;
}

footer hr {
  border-color: var(--copyright-color);
}

footer .wrapper div {
  margin-bottom: 5px;
  width: fit-content;
  font-size: small;
}

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

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


/* Navigation */

#top-bar {
  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: inherit;
}

#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 {
  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: 0px;
  transform: rotate(90deg);
}

#page-heading {
  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 {
  width: max-content;
  min-width: 25%;
  background-color: var(--top-bar-background-color);
  height: inherit;
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 10;
  padding: 10px;
  box-shadow: var(--side-bar-shadow-color) -10px 0 20px;
}

#side-bar {
  position: sticky;
  top: calc(var(--top-bar-height) + 5px);
  max-height: calc(100vh - 80px);
  overflow-y: scroll;
  scrollbar-width: 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-hover-background-color); 
}


/* Misc */

h1:first-of-type {
  margin-top: -10px;
  hyphens: auto;
}

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

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;
}
