:root {
  color-scheme: light dark;

  &:has(#theme-light:checked) {
    color-scheme: light;
  }

  &:has(#theme-dark:checked) {
    color-scheme: dark;
  }

  --text-color: light-dark(black, hsl(219, 14%, 71%));
  --text-secondary-color: light-dark(#555, #aaa);
  --bg-color: light-dark(hsl(48, 87%, 94%), hsl(220, 13%, 18%));
  --title-color: light-dark(hsl(323, 39%, 40%), hsl(355, 65%, 65%));
  --link-color: light-dark(hsl(190, 89%, 25%), hsl(187, 47%, 55%));
  --link-hover-color: light-dark(hsl(39, 24%, 76%), hsl(222, 14%, 28%));
  --border-color: hsl(43, 59%, 41%);

}

html,
body {
  font-family: "Noto Sans", "DejaVu Sans", sans-serif;
  text-align: justify;
  text-justify: inter-word;
  color: var(--text-color);

  margin-right: 12%;
  margin-left: 12%;
  margin-top: 40px;
  margin-bottom: 20px;

  @media only screen and (max-device-width: 480px) {
    margin-right: 4%;
    margin-left: 4%;
  }

  background-color: var(--bg-color);
}

theme-picker {
  display: flex;
  position: fixed;
  top: 20px;
  right: 20px;

  label {
    &:has(input:checked) {
      box-shadow: inset 0px 0px 8px 0px #888;
    }

    &:has(input:focus-visible) {
      outline: 2px solid #000;
    }

    text-align: center;
    vertical-align: middle;
    width: 25px;
    height: 25px;
    box-shadow: inset 0px 0px 1.2px 0px #000;
    padding: 10px;
    cursor: pointer;
    background: #0002;

    &:hover {
      background: #0004;
    }

    &:active {
      background: #0006;
    }
  }

  input {
    opacity: 0;
    position: absolute;
    pointer-events: none;
  }
}

footer {
  text-align: center;
  font-size: 90%;
  color: gray;
  overflow: hidden;

  div.webring {
    padding: 0pt;
    margin: 0pt;

    a {
      margin-left: .3em;
      margin-right: .3em;
    }
  }

  div.copyright {
    padding: 0pt;
    margin: 0pt;
  }


  a {
    color: gray;
  }
}

h2 {
  text-align: center;
  padding-top: 24px;
  padding-bottom: 24px;
  color: var(--title-color);
}

a {
  text-decoration-line: none;
  padding: 1px 2px;
  color: var(--link-color);
}

a:hover {
  background-color: var(--link-hover-color);
}

.lang-buttons {
  div {
    margin: 10px 5px;
    width: 28px;
    height: 24px;
    vertical-align: middle;
  }

  a {
    padding: 0;

    div.lang-active:hover {
      background-color: var(--link-hover-color);
    }
  }
}

@keyframes animateLeftBar {
  0% {
    opacity: 1;
    transform: translatex(-15px);
  }

  100% {
    opacity: 1;
    transform: translatex(0);
  }
}

.left-bar {
  position: fixed;
  display: block;
  background-color: transparent;
  color: var(--text-secondary-color);
  top: 0;
  left: 0;
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
  text-align: center;

  details[open] {
    background-color: var(--bg-color);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    width: 18vw;

    @media only screen and (max-device-width: 480px) {
      width: 50vw;
    }

    img {
      width: 85%;
    }

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

  /* the summary button */
  details>summary {
    position: relative;
    top: 10px;
    margin-left: 10px;
    list-style: none;
    cursor: pointer;
    background-color: var(--link-hover-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

    div.open {
      display: none;
    }
  }

  details[open]>summary {
    div.open {
      display: block;
    }

    div.closed {
      display: none;
    }
  }
}

/* email obsfucation for automated harvesters */
/* thanks to https://spencermortensen.com/articles/email-obfuscation/ ! */
span.email {
  span:nth-child(2) {
    display: none;
  }
}
