:root
{
  --font-family: Montserrat, Open Sans, Raleway, Work Sans, Barlow;
  --font-size: 1rem;
  --font-weight: 500;
  --scrollbar-color: #c00000;
  --header-height: 48px;
  --header-background: #404040;
  --header-color: #ffffff;
  --body-background: #f6f6f6;
  --body-color: #555;
  --max-content-width: 1024px;
  --menu-color: #fff;
  --menu-background: #222;
  --menu-hover-color: #fff;
  --menu-hover-background: #c00000;
  --vmenu-color: #fff;
  --vmenu-background: #222;
  --vmenu-hover-color: #fff;
  --vmenu-hover-background: var(--menu-hover-background);
  --section-background: #ffffff;
  --footer-color: #fafafa;
  --footer-background: #444;
  --border-radius: 6px;
  --pre-background: #e8e8e8;
  --code-background: #e8e8e8;
  --link-color: #d00000;
  --button-hover-color: #f0f0f0;
  --button-hover-background: #b05050;
}

[data-theme="dark"]
{
  --header-background: #444;
  --header-color: #ffffff;
  --body-background: #302020;
  --body-color: #c0d0c0;
  --menu-color: #fff;
  --menu-background: #222;
  --menu-hover-color: #fff;
  --menu-hover-background: #c00000;
  --vmenu-color: #fff;
  --vmenu-background: #222;
  --vmenu-hover-color: #fff;
  --vmenu-hover-background: var(--menu-hover-background);
  --section-background: #1c1c1c;
  --footer-color: #fafafa;
  --footer-background: #444;
  --pre-background: #303030;
  --code-background: #303030;
  --link-color: #ff6060;
  --button-hover-color: #f0f0f0;
  --button-hover-background: #b05050;
}

html, body
{
  margin: 0;
  padding: 0;
  height: auto;
  font-family: var(--font-family);
  font-size: var(--font-size);
  font-weight: var(--font-weight);
  background: var(--body-background);
  color: var(--body-color);
  height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s linear, color 0.3s linear;
}

body *
{
  transition: background-color 0.3s linear, color 0.3s linear;
}

header
{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 0;
  color: var(--header-color);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  background: var(--header-background);
  flex-direction: column;
}

header > a h1
{
  line-height: var(--header-height);
  color: var(--header-color);
  margin: 0;
  padding: 0;
  font-size: 20px;
  display: flex;
  align-items: center;
}

header > a h1 > img
{
  height: var(--header-height);
}

main
{
  margin-top: calc(var(--header-height) + 32px);
  padding: 1rem;
  line-height: 1.6;
  flex-grow: 1;
}

main .content
{
  max-width: var(--max-content-width);
  margin-left: auto;
  margin-right: auto;
}

main .content > h2
{
  display: flex;
  align-items: center;
}

main .content > h2 > span
{
  padding-right: 6px;
}

main .content ul
{
  padding-inline-start: 24px;
}

footer
{
  text-align: center;
  min-height: 100px;
  background: var(--footer-background);
  color: var(--footer-color);
  padding: 2rem;
  flex-grow: 0;
}

footer a
{
  color: var(--footer-color);
}

header > a
{
  height: var(--header-height);
  text-decoration: none;
}

header nav
{
  color: var(--menu-color);
  position: relative;
}

header nav a
{
  color: var(--menu-color);
  text-decoration: none;
}

header nav ul
{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

header nav > ul > li
{
  position: relative;
}

header nav > ul > li > a,
header nav > ul > li.submenu > a
{
  display: flex;
  align-items: center;
}

header nav > ul > li.submenu > a span
{
  transform: rotate(0deg);
  transition: transform 0.1s;
}

header nav > ul > li.submenu.drop > a span
{
  transform: rotate(180deg);
}

header nav ul ul
{
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--menu-background);
  display: none;
  flex-direction: column;
  min-width: 180px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

header nav ul ul li
{
}

header nav li.drop > ul
{
  display: flex;
}

header nav ul li > a
{
  display: flex;
  align-items: center;
  padding: 10px;
  padding-right: 12px;
  line-height: 24px;
}

header nav ul li > a:hover
{
  color: var(--menu-hover-color);
  background-color: var(--menu-hover-background);
}

header nav ul li.submenu > a
{
  padding-right: 2px;
}

header button.menu-toggle.image-button
{
  position: fixed;
  background: none;
  color: white;
  padding: 0;
  top:0;
  left:0;
  width: var(--header-height);
  height: var(--header-height);
  display: none;
}

header button.theme-toggle.image-button
{
  position: fixed;
  background: none;
  color: white;
  padding: 0;
  top:0;
  right:0;
  width: var(--header-height);
  height: var(--header-height);
}

#lang-select
{
  position: fixed;
  background: var(--header-background);
  color: var(--header-color);
  padding: 0;
  top:16px;
  right:var(--header-height);
}

a
{
  text-decoration: none;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
  color: var(--link-color);
}

code
{
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
  background: var(--code-background);
  border-radius: var(--border-radius);
  padding: 2px 4px 2px 4px;
}

.flex
{
  display: flex;
}

.flex-grow-1
{
  flex-grow: 1;
}

.m-1
{
  margin: 0.25rem;
}

.ml-1
{
  margin-left: 0.25rem;
}

.mr-1
{
  margin-right: 0.25rem;
}

.mt-1
{
  margin-top: 0.25rem;
}

.mb-1
{
  margin-bottom: 0.25rem;
}

.p-1
{
  padding: 0.25rem;
}

.pl-1
{
  padding-left: 0.25rem;
}

.pr-1
{
  padding-right: 0.25rem;
}

.pt-1
{
  padding-top: 0.25rem;
}

.pb-1
{
  padding-bottom: 0.25rem;
}

p.featured
{
  font-size: 20px;
  font-weight: bold;
  margin: 0.2rem;
}

section
{
  margin-bottom: 2rem;
  background: var(--section-background);
  padding: 1rem;
  border-radius: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

section.download
{
  display: flex;
}

section.download > span
{
  margin-top: 22px;
  margin-right: 6px;
}

a.link-button
{
  border: 1px solid var(--link-color);
  border-radius: var(--border-radius);
  display: inline-flex;
  text-decoration: none;
  padding: 6px;
  padding-right: 12px;
  vertical-align: middle;
}

a.link-button:hover
{
  text-decoration: none;
  color: var(--button-hover-color);
  background-color: var(--button-hover-background);
}

section.version
{
  margin-top: 10px;
}

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

section.screenshots img
{
  max-width: 100%;
  margin-top: 20px;
}

main ul > li, main ol > li
{
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
}

h2, h3, h4
{
  scroll-margin-top: calc(var(--header-height) + 50px);
}

button.image-button
{
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
}

section > h3
{
  display: flex;
  align-items: center;
}

pre
{
  background: var(--pre-background);
  border-radius: var(--border-radius);
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px;
}

pre .hljs
{
  background: transparent;
}

.language-yaml
{
  padding: 0;
  font-family: monospace;
  white-space: pre;
  background: transparent;
}

nav.pagination
{
  display: flex;
  gap: 1rem;
  align-items: center;
  line-height: normal;
}

#up-button
{
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: none;
  background-color: #444;
  color: white;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: opacity 0.3s;
  z-index: 1000;
  padding-top: 4px;
}

#up-button:hover
{
  background-color: #555;
}

a.github
{
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

a.github > img
{
  width: 32px;
  padding-right: 4px;
}

*::-webkit-scrollbar
{
  width: 0.6em;
  height: 0.6em;
}

*::-webkit-scrollbar-track
{
  -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
}

*::-webkit-scrollbar-thumb
{
  background-color: var(--scrollbar-color);
  outline: 1px solid var(--scrollbar-color);
}

figure
{
  margin: 0;
  margin-top: 10px;
}

figure figcaption
{
  font-size: 0.9rem;
}

.videos
{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  padding: 10px;
}

.video-player
{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: flex;
  flex-direction: column;
  aspect-ratio: 16 / 9;
}

@media (max-width: 768px), (max-height: 500px)
{
  header button.menu-toggle.image-button
  {
    display: flex;
  }

  header nav ul
  {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    flex-direction: column;
    width: 250px;
    max-width: 100%;
    color: var(--vmenu-color);
    background: var(--vmenu-background);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x:hidden;
    box-sizing: border-box;
  }

  header nav ul.active
  {
    transform: translateX(0);
    box-shadow: 3px 0px 3px 0px rgba(0,0,0,0.2);
  }

  header nav > ul > li
  {
  }

  header nav ul li.drop ul
  {
    position: static;
    background: none;
    display: block;
    box-shadow: none;
    padding-left: 20px;
    transform: none;
  }

  header nav ul ul li
  {
    border-left: 1px solid #606060;
  }

  header nav ul li a:hover
  {
    color: var(--vmenu-hover-color);
    background-color: var(--vmenu-hover-background);
  }

  main
  {
    margin-top: var(--header-height);
  }

  h2, h3, h4
  {
    scroll-margin-top: calc(var(--header-height) + 8px);
  }
}

