body {
  background: #fafafa;
  color: #333333;
  margin: 0 auto;
  text-rendering: optimizeLegibility;
  font-size: 1em;

  --blue-050: #e6efff;
  --blue-200: #a6c7ff;
  --blue-400: #6694e3;
  --blue-600: #466fb5;
  --blue-800: #204d99;
  --blue-900: #173e82;
}

* {
  outline: none;
  box-sizing: border-box;
}

.scrollwrap {
  overflow-x: auto;
}

.boxed,
table.formulae {
  background-color: white;
  border: 1px solid #dfdfdf;
  margin: 1em 0;
  border-collapse: collapse;
  min-width: 300px;
}

.boxed {
  padding: 10px;

  li {
    margin-bottom: 8px;
  }

  img {
    display: block;
    margin: auto;
  }
}

table.formulae {
  th {
    font-weight: bold;
    vertical-align: top;
  }

  td {
    background-color: #fafafa;
  }

  th,
  td {
    margin: 0.5em 1em;
    border: 1px solid #c8c8c8;
    display: table-cell;
    padding: 0.5em;
    font-size: 14px;
  }

  svg {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
  }
}

table {
  border-spacing: 0px;
  font-weight: inherit;
  color: #000000;
  text-align: left;
  margin-right: 20px;
}

.clear {
  clear: both;
  height: 0;
  visibility: hidden;
  display: block;
}

.note {
  font-weight: 500;
  color: #787878;
  padding: 29px 0px 15px 0px;
  margin: 0px;
}

a {
  text-decoration: none;
  color: var(--blue-900);
}

button {
  background-color: white;
  border-radius: 5px;
}

#tab-container {
  font-family: 'Source Sans Pro', Arial, Verdana, Helvetica, sans-serif;
}

#tab-menu {
  width: 100%;
  margin: 0;
  padding: 0;
  display: block;
  float: left;
  position: fixed;
  background: var(--blue-050);
  border-style: none;
  z-index: 2000;

  nav {
    display: flex;
    justify-content: space-between;
  }
}

.tab-menu-option-group {
  display: flex;
  overflow: hidden;
}

.tab-menu-option,
.tab-menu-language-option {
  padding: 0.5rem;
  cursor: pointer;
  overflow: hidden;

  &.active {
    background-color: var(--blue-800);
    color: white;
  }

  &:focus-visible {
    outline: 2px solid var(--blue-800);
    outline-offset: -2px;
    border-radius: 4px;
  }
}

.tab-menu-option {
  &:hover:not(.active) {
    background-color: var(--blue-200);
  }
}

.tab-menu-language-selection {
  display: flex;
}

.tab-menu-opennavi {
  float: left;
  cursor: pointer;
  margin: 0.5em 0.5em 0 0.5em;
  width: 16px;

  &:after,
  &:before,
  & div {
    background-color: #333;
    border-radius: 3px;
    content: '';
    display: block;
    height: 2px;
    margin-bottom: 3px;
    transition: all 0.2s ease-in-out;
  }

  &:focus::after,
  &:focus::before,
  &:focus div {
    background-color: black;
    height: 4px;
    margin-bottom: 1px;
  }
}

.tab-content {
  text-align: left;
  display: none;
  padding-top: 30px;
  margin-left: 10px;
  margin-right: 10px;
  margin-bottom: 30px;
  line-height: 1.5;
  padding-bottom: 2rem;

  & img {
    vertical-align: middle;
  }

  &.active {
    display: block;
  }
}

.tab-view {
  display: inline-block;
  margin-bottom: 200px;

  & h4 {
    margin-bottom: 5px;
  }
}

.js-toc {
  left: 0;
  top: 0;
  bottom: 0;
  position: fixed;
  width: 300px;
  display: block;
  font-size: 20px;
  border-right: 2px #359bb7;
  overflow-y: auto;
  background: white;
  z-index: 2000;

  opacity: 1;
  transition:
    left ease-in-out 0.2s,
    opacity linear 0.2s;

  padding: 10px;

  &.hidden {
    left: -320px;
    opacity: 0;
  }

  &::-webkit-scrollbar-track {
    background-color: #f5f5f5;
    border-right: 2px transparent;
  }

  &::-webkit-scrollbar {
    width: 10px;
    background-color: #f5f5f5;
  }

  &::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
  }

  & > .js-toc-result > .toc-list {
    padding: 10px 0 0;
    border-left: none;
    margin-left: 0;
  }

  .is-active-link {
    font-weight: normal;
  }

  .toc-list {
    list-style-type: none;
    color: #43464b;
    padding-left: 0.5rem;
    border-left: 3px solid #c6d5f4;
    margin-left: 0.5rem;

    a:hover {
      background-color: var(--blue-050);
    }

    li {
      font-size: 16px;
      transition: background-color 0.07s;
      border-radius: 3px;

      &:not(li li) {
        margin-top: 0.5rem;
      }

      a.toc-link {
        padding: 4px;
        border-radius: 3px;
        display: inline-block;
        width: 100%;

        &:focus-visible {
          border: black 1px solid;
        }

        &:before {
          content: none;
          display: none;
        }
      }

      &.is-active-li > a {
        background-color: var(--blue-050);
      }
    }
  }
}

.js-toc-content {
  position: absolute;
  left: 350px;
  top: 40px;
  right: 0;
  bottom: 0;
}

h1 {
  font-size: 3em;
  font-weight: 500;
  color: #282828;
  margin: 0;
  padding: 30px 0px 20px 0px;
}

h2,
h3 {
  margin-top: -2rem;
  padding-top: 3rem;
  margin-bottom: 0;
}

*:has(+ h2, + h3) {
  margin-bottom: 1rem;
}

.infotext {
  color: grey;
  font-size: 16px;
  margin-top: 30px;
  margin-bottom: 30px;
  line-height: 1.7em;
}

.mjpage {
  margin: 2px;

  a,
  a:visited,
  a:hover,
  a:active {
    text-decoration: none;
    color: inherit;
  }

  svg {
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
  }

  svg:hover {
    border: 1px solid #a9a9a9;
    box-shadow:
      0px 3px 0px -2px rgb(234, 222, 222),
      0px 2px 0px 0px rgba(169, 169, 169, 1);
  }
}

button.mjpage {
  margin: 2px;
  color: #000000;

  &:focus {
    margin: 0;
  }
}

button.mjpage__block,
button.mjpage__block:focus {
  max-width: fit-content;
  margin: 0 auto;
}

button.mjpage__block {
  border: transparent 2px solid;
}

/* Ajax loader */

#loading {
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  position: fixed;
  display: block;
  opacity: 0.9;
  background-color: #fff;
  z-index: 2100;
  text-align: center;

  &.hidden {
    left: 100%;
    opacity: 0;
    transition:
      left 0s 0.3s,
      opacity linear 0.3s;
  }
}

#loading-text {
  width: 200px;
  height: 100px;
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -100px;
  margin-top: -50px;
  text-align: center;
  z-index: 2101;
  background-color: white;
  font-weight: bold;
}

.copying-box {
  font-family: 'Source Sans Pro', Arial, Verdana, Helvetica, sans-serif;
  padding: 10px;
  margin: 10px;
  background-color: var(--blue-800);
  position: fixed;
  z-index: 2050;
  border-radius: 4px;

  opacity: 0;
  top: -100px;

  &.animate {
    animation: copyingBoxFade 2s;
  }
}

.copy-text {
  font-size: 1.1em;
  margin: 8px;
  text-align: center;
  color: white;
}

@keyframes copyingBoxFade {
  0% {
    opacity: 100%;
    top: 0;
  }

  50% {
    opacity: 100%;
  }

  90% {
    top: 0;
  }

  100% {
    opacity: 0%;
    top: -100px;
  }
}

/*
	Mobile layouts
*/

@media screen and (min-width: 1025px) {
  .tab-menu-opennavi {
    display: none;
  }

  .tab-menu-option-short {
    display: none;
  }

  .tab-menu-option-long {
    display: inline;
  }
}

@media screen and (max-width: 1024px) {
  .tab-menu-opennavi {
    display: block;
  }

  .js-toc-content {
    position: static;
  }

  .tab-view {
    display: block;
  }

  .tab-view h3 {
    margin-left: 0px;
    font-size: 30px;
    margin-top: 50px;
  }

  .tab-menu-option-short {
    display: inline;
  }

  .tab-menu-option-long {
    display: none;
  }
}

@media screen and (max-width: 768px) {
  .tab-menu-option-group,
  .tab-menu-language-selection {
    font-size: 14px;
  }
}

@media screen and (max-width: 600px) {
  .formulae th,
  .formulae td {
    margin: 0.5em 1em;
    border: 1px solid #c8c8c8;
    display: table-cell;
    padding: 0.5em;
    font-size: 10px;
  }
}

video {
  width: 100% !important;
  height: auto !important;
}

/* Abitti-version navigaatio */
.abitti-version-selector {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.abitti-version-button {
  cursor: pointer;
  font-size: 1em;
  font-family: 'Source Sans Pro', Arial, Verdana, Helvetica, sans-serif;
  color: #333;
  padding-bottom: 10px;
}

.abitti-version-button.active {
  font-weight: bold;
  border-width: 0px 0px 4px 0px;
  border-bottom-color: #1e4f75;
  border-style: solid;
}

.abitti-version-button:focus-visible {
  outline: 2px solid #5a88c5;
  outline-offset: 2px;
}
