assets/css/docs.css
html {
  scroll-behavior: smooth;
  scroll-padding: 2em;
}

body {
  display: flex;
  flex-direction: column;
  height: 100%;

  color: var(--color);
  background: var(--background);
  font-family: var(--font-sans);
}

#outer-wrapper {
  display: flex;
}

#aside-wrapper {
  width: 85%;
  left: -85%;
  display: none;
  overflow-x: auto;
}

#aside-wrapper > aside > div {
  display: flex;
  padding: var(--padding);
  justify-content: flex-end;
}

#aside-wrapper > aside > a {
  display: none;
}

#content-wrapper {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 100svh;
}

main {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100svw;
}

#aside-wrapper.open {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  height: 100%;
  z-index: 10;
  transition: .3s;
  animation: slide-in-left .3s forwards;

  background: var(--model-background);
  box-shadow: var(--model-box-shadow);
}

@keyframes slide-in-left {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

#content-wrapper > header {
  border-bottom: 1px solid var(--border);
}

#content-wrapper > header > a {
  display: inline-block;
  padding: var(--padding);
}

#content-wrapper > footer {
  display: flex;
  flex-direction: column;
  padding: var(--padding_x2) var(--padding) 0;
}

#content-wrapper > footer > div {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--padding);
  gap: var(--padding_d2);
  text-align: center;
  flex-wrap: wrap;
}

#content-wrapper > footer > div:first-child {
  white-space: initial;
}

#content-wrapper > footer > div:first-child a {
  background: var(--foreground-highlight);
  color: var(--color-highlight);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0 var(--padding_d2);
}

#content-wrapper > footer > div:nth-child(2) {
  justify-content: flex-end;
}

/* --- menu --- */
#content-wrapper > nav {
  display: flex;
  justify-content: end;
}

@media (min-width: 768px) {
  #content-wrapper > nav > select {
    position: absolute;
    top: calc(var(--padding) - 2px);
    right: var(--padding);
  }
}

@media (min-width: 1280px) {
  #content-wrapper > nav > select {
    top: 0;
    right: calc(100vw/5 + var(--padding_x2));
    padding: calc(1.5*var(--padding_d2));
  }

  #content-wrapper > nav > select > option {
    padding: calc(1.5*var(--padding_d2));
  }

  main > article {
    padding-top: var(--padding_x2);
  }
}

/* ---- */

main > article {
  display: flex;
  flex: 1;
  flex-direction: column;
}

main > article > nav {
  display: flex;
  padding: var(--padding_x2) var(--padding) var(--padding);
  gap: 12px;
  justify-content: space-between;
}

main > article > header {
  padding: var(--padding) var(--padding_x2);
}

#article-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--padding) var(--padding_x2);
  overflow-x: auto;
}

main > article > footer {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 0 var(--padding_x2);
  row-gap: var(--padding);
}

main > article > footer > time {
  grid-column: 1 / 3;
  display: flex;
  color: var(--color-fade);
  justify-content: center;
  padding: var(--padding) 0;
  gap: var(--padding_d2);
}

main > article > footer > a {
  display: flex;
  padding: var(--padding);
  gap: calc(var(--padding) / 4);
  background: var(--foreground);
  color: var(--color-nav);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  width: 75%;
}

main > article > footer > a:hover {
  background: var(--foreground-hover);
}

main > article > footer > a.hidden {
  visibility: hidden;
}

main > article > footer > a:last-child {
  display: flex;
  justify-content: end;
  margin-left: 25%;
}

main > aside {
  width: 85%;
  right: -85%;
  display: none;
  overflow-x: auto;
}

main > aside.open {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  height: 100%;
  z-index: 10;
  transition: .3s;
  animation: slide-in-right .3s forwards;

  background: var(--model-background);
  box-shadow: var(--model-box-shadow);
}

/* --- sidebar --- */
#aside-wrapper {
  position: sticky;
  top: 0;
}

#aside-wrapper > aside > nav {
  padding: 0 var(--padding);
}

#aside-wrapper > aside > nav > details {
  padding-bottom: 0;
}

#aside-wrapper > aside > nav > details[open] {
  padding-bottom: calc(var(--padding) * 1.5);
}

#aside-wrapper > aside > nav > details > summary {
  display: flex;
  padding: var(--padding) 0;
  color: var(--color);
  font-weight: bold;
}

#aside-wrapper > aside > nav > details[open] > summary {
  color: var(--color-fade);
}

#aside-wrapper > aside > nav > details > ul > li {
  margin: 0 var(--padding_d2);
  border-left: 1px solid var(--border-nav);
}

#aside-wrapper > aside > nav > details > ul > li > a {
  color: var(--color-nav);
  display: flex;
  cursor: pointer;
  padding: var(--padding_d2);
}

#aside-wrapper > aside > nav > details > ul > li > a::before {
  content: '';
  display: inline-block;
  background: var(--background);
  width: var(--padding_d2);
  height: var(--padding_d2);
  transform: rotate(45deg);
  border: 1px solid var(--border-nav);
  position: relative;
  left: calc((var(--padding) * -.78));
  top: 3px;
}

#aside-wrapper > aside > nav > details > ul > li > a.active {
  background: var(--foreground-highlight);
  color: var(--color-highlight);
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

#aside-wrapper > aside > nav > details > ul > li > a.active::before {
  background: var(--foreground-highlight);
  border: var(--foreground-highlight);
  left: calc((var(--padding) * -.76));
}

#aside-wrapper > aside > nav > details > ul > li > a:hover:not(.active) {
  background: var(--foreground-hover);
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

/* --- toc --- */
main > aside > div {
  display: flex;
  padding: var(--padding);
}

main > aside > strong {
  display: flex;
  padding: var(--padding);
  color: var(--color-fade);
  font-weight: bold;
}

main > aside > nav {
  padding: 0 var(--padding);
}

#TableOfContents ul {
  border-left: 1px solid var(--border);
}

#TableOfContents a {
  color: var(--color-nav);
  display: inline-block;
  cursor: pointer;
  padding: var(--padding_d2);
}

#TableOfContents a code {
  padding: calc(var(--padding) / 3.7);
  border-radius: var(--radius);
  font-size: .9em;
}

#TableOfContents ul a::before {
  content: '';
  display: inline-block;
  width: calc(var(--padding) / 1.5);
  height: calc(var(--padding) / 1.5);
  background: var(--background);
  border: 1px solid var(--border-nav);
  position: relative;
  left: calc((var(--padding) * -.89));
  top: -3px;
  border-radius: 30%;
  transform: rotate(45deg);
}

#TableOfContents a.active {
  background: var(--foreground-highlight);
  color: var(--color-highlight);
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

#TableOfContents ul a.active::before {
  background: var(--background);
}

#TableOfContents a:hover:not(.active) {
  background: var(--foreground-hover);
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

#TableOfContents ul ul {
  margin-left: calc(var(--padding) * 1.75);
}


@keyframes slide-in-right {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

body.model-open {
  overflow: hidden;
}

#body-model-outer {
  display: none;
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;

  background: var(--model-foreground);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#aside-wrapper > aside > div .btn, main > aside > div > .btn {
  font-size: .75em;
  font-weight: 800;
}

/* From Small Tablet */
@media (min-width: 768px) {
  main > article > footer > a {
    width: 50%;
  }

  main > article > footer > a:last-child {
    margin-left: 50%;
  }
}

/* Small Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  #aside-wrapper {
    width: 50%;
    left: -50%;
  }

  main > aside {
    width: 50%;
    right: -50%;
  }
}

/* From Large Tablet */
@media (min-width: 1024px) {
  :root {
    --padding: 16px;
    --padding_d2: 8px;
    --padding_x2: 32px;
  }

  main {
    flex-direction: row;
  }

  main > article {
    width: 75vw;
    overflow-x: auto;
  }

  main > aside {
    width: 25%;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: calc(100svh - 68px);
    overflow-x: auto;
  }

  main > aside > div {
    display: none;
  }

  main > article > nav > button:last-child {
    display: none;
  }

  #content-wrapper > footer {
    padding: var(--padding) var(--padding) 0;
    flex-direction: row;
  }

  #content-wrapper > footer > div:first-child {
    width: 75vw;
  }

  #content-wrapper > footer > div:nth-child(2) {
    width: 25%;
  }
}

/* Large Tablet */
@media (min-width: 1024px) and (max-width: 1279px) {
  #aside-wrapper {
    width: 33%;
    left: -33%;
  }
}

/* From Desktop */
@media (min-width: 1280px) {
  #aside-wrapper {
    width: 20%;
    display: flex;
    flex-direction: column;
    height: 100svh;

    background: var(--foreground);
    border-right: 1px solid var(--border);
    overflow-x: auto;
  }

  #aside-wrapper > aside > div {
    display: none;
  }

  #aside-wrapper > aside > nav {
    overflow-x: auto;
  }

  #content-wrapper > header {
    display: none;
  }

  #aside-wrapper > aside > a {
    display: flex;
    padding: var(--padding_x2) var(--padding);
  }

  main {
    width: 80svw;
    padding: 0 var(--padding_x2);
  }

  main > article {
    width: 60vw;
    overflow-x: auto;
  }

  main > article > nav {
    display: none;
  }

  main > aside {
    width: 25%;
  }

  main > article > header {
    padding: var(--padding_x2) var(--padding_x2) var(--padding);
  }

  #content-wrapper > footer > div:first-child {
    width: 60vw;
  }

  #content-wrapper > footer > div:nth-child(2) {
    width: 25%;
  }
}

/* --- article --- */
main > article > header > h1 {
  font-size: 3em;
}

main > article > header > p {
  font-size: 1.25em;
  color: var(--color-fade);
  padding-top: var(--padding);
}
