@import url("./_reset.css");
@import url("./_fonts.css");

:root {
  --color-aside-background: var(--color-block-background);
  --color-block-background: #fefefe;
  --color-block-dark-background: #000;
  --color-body-background: #ffc764;
  --color-body-font: #050505;
  --color-body-font-dark-background: var(--color-block-background);
  --color-border: #333;
  --color-document-background: var(--color-block-background);
  --color-inline-code-background: #0080ff30;
  --color-link-active: #000;
  --color-link-decoration: var(--color-link-active);
  --color-primary-banner-background: var(--color-block-background);
  --color-primary-banner-font: var(--color-body-font);
  --color-primary-footer-background: var(--color-block-dark-background);
  --color-primary-footer-font: var(--color-body-font-dark-background);
  --color-primary-navigation-background: var(--color-body-background);
  --color-text-decoration-highlight: var(--color-body-font);
  --color-tag-background: transparent;
  --color-tag-border: var(--color-body-font);
  --color-tag-font: var(--color-body-font);
  --font-family-body: "Noto Sans", sans-serif;
  --font-family-monospace: monospace;
  --height-primary-navigation: 70px;
  --height-aside-filter: 70px;
  --height-scrollbar-horizontal: 8px;
  --width-scrollbar-vertical: 8px;
  --z-index-documentation-aside: 1;
  --z-index-documentation-aside-filter: 2;
  --z-index-primary-navigation: 3;
  --z-index-edit-on-github: 4;

  @media screen and (max-height: 1199px) {
    --font-size-bigger: 20px;
    --font-size-base: 18px;
    --font-size-code: 16px;
    --font-size-smaller: 16px;
  }
  @media screen and (min-height: 1200px) {
    --font-size-bigger: 22px;
    --font-size-base: 20px;
    --font-size-code: 18px;
    --font-size-smaller: 18px;
  }
}

::-webkit-scrollbar {
  background-color: transparent;
  height: var(--height-scrollbar-horizontal);
  width: var(--width-scrollbar-vertical);
}

::-webkit-scrollbar-thumb {
  background-color: var(--color-block-dark-background);
}

a {
  transition:
    filter 0.1s ease,
    opacity 0.1s ease;
}

a.active {
  text-decoration: underline;
}

a:active,
.turbo-clicked {
  filter: grayscale(0.5);
  transform: translate3d(1px, 1px, 0);
}

.turbo-clicked {
  opacity: 0.8;
  pointer-events: none;
}

/**
 * Body content
 */

.body-content {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: 100vh;
}

/**
 * Edit on GitHub button
 */

@media screen and (max-width: 1479px) {
  .global-edit-on-github {
    border-top: 1px solid var(--color-border);
    font-size: var(--font-size-smaller);
    padding: 20px;
    text-align: center;

    &:active {
      transform: unset;
    }
  }
}
@media screen and (min-width: 1480px) {
  .global-edit-on-github {
    background-color: var(--color-block-background);
    border: 1px solid var(--color-border);
    padding: 10px 20px;
    position: fixed;
    right: 15px;
    bottom: 15px;
    text-decoration: none;
    font-family: var(--font-family-monospace);
    font-size: var(--font-size-code);
    z-index: var(--z-index-edit-on-github);
  }
}

/**
 * Heading permalink
 */

.heading-permalink {
  color: var(--color-link-active);
  display: inline-block;
  font-size: 1em;
  position: absolute;
  text-decoration: none;
  user-select: none;
}

.heading-permalink:target {
  outline: none;
}

.primary-banner,
.primary-footer,
.primary-navigation {
  font-size: var(--font-size-smaller);
}

/**
 * Primary baner
 */

.primary-banner {
  align-items: center;
  background-color: var(--color-primary-banner-background);
  color: var(--color-primary-banner-font);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  position: sticky;
  top: -100%;

  @media screen and (max-width: 1023px) {
    flex-direction: column;
    padding: 20px;
    row-gap: 20px;
  }
  @media screen and (min-width: 1024px) {
    flex-direction: row;
    justify-content: space-between;
    padding: 10px 20px;
  }
}

.primary-banner > a {
  background-color: var(--color-body-background);
  border: 1px solid var(--color-border);
  font-weight: bold;
  font-size: 1em;
  line-height: 1.5;
  padding: 10px 20px;
  text-decoration: none;
}

.primary-banner__new {
  display: inline-flex;
}

/**
 * Primary footer
 */

.primary-footer {
  align-items: center;
  background-color: var(--color-primary-footer-background);
  border-top: 1px solid var(--color-border);
  color: var(--color-primary-footer-font);
  display: flex;
  flex-direction: column;
  padding: 20px;
  row-gap: 80px;
}

.primary-footer__copyright,
.primary-footer__link-groups {
  max-width: 1600px;
  width: 100%;
}

.primary-footer__copyright {
  text-align: center;
}

/**
 * Primary navigation
 */

.primary-navigation {
  align-items: center;
  background-color: var(--color-primary-navigation-background);
  border-style: solid;
  border-width: 0 0 1px 0;
  border-color: var(--color-border);
  display: flex;
  flex-direction: row;
  grid-gap: 0;
  height: var(--height-primary-navigation);
  max-width: 100vw;
  overflow-x: auto;
  overflow-y: hidden;
  position: sticky;
  top: 0;
  z-index: var(--z-index-primary-navigation);
}

.primary-navigation a {
  padding: 20px 20px;
  text-decoration: none;
  white-space: nowrap;
}

.primary-navigation a:first-of-type {
}

.primary-navigation a.active {
  color: var(--color-link-active);
}

.primary-navigation a.primary-navigation__github-link svg {
  height: 40px;
  width: 40px;
}

@media screen and (max-width: 1023px) {
  .primary-navigation a.primary-navigation__github-link {
    padding: 5px 20px 0;
  }
}
@media screen and (min-width: 1024px) {
  .primary-navigation a.primary-navigation__github-link {
    display: flex;
    margin-left: auto;
    padding: 0px 20px;
  }

  .primary-navigation a.primary-navigation__github-link:active {
    transform: unset;
  }
}

/**
 * Turbo progress bar
 */

.turbo-progress-bar {
  height: 8px;
  background-color: var(--color-link-active);
  position: fixed;
  top: 0;
  width: 100%;
}
