// font-family, color

body {
  --custom-color-font: #3C3C43;
  --custom-color-pale: #e2e2e2;
  --custom-color-background: #f6f6f6;
  --custom-color-background-md: #ffffff;
  --custom-font-family: 'Inter', 'SF Pro Text', 'Helvetica', 'Roboto', 'Arial', 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Kaku Gothic Pro', 'Yu Gothic UI', 'Meiryo', sans-serif;
  --custom-font-family-code: 'Noto Sans Mono', 'ui-monospace', 'SFMono-Regular', 'SF Mono', 'Roboto Mono', 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;

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

@media (prefers-color-scheme: dark) {
  body {
    --custom-color-font: #fffffd;
    --custom-color-pale: #2e2e32;
    --custom-color-background: #161618;
    --custom-color-background-md: #1b1b1f;
  }
}

code {
  font-family: var(--custom-font-family-code);
}

.book-page, .book-toc {
  background-color: var(--custom-color-background-md);
}

// weight, spacing, line-height, color

.ao-stable-beta {
  font-weight: 800;
}

.book-brand {
  font-weight: 800;
}

.book-section-flat span {
  font-weight: 800;
}

.markdown {
  letter-spacing: normal;
  font-weight: 500;

  h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    line-height: 1.25;

    code {
      font-family: var(--custom-font-family);
      font-weight: 800;
      font-size: 1em;
      background: none;
      border-width: 0 !important;
      padding: 0 !important;
      margin: 0 !important;
    }

    code::before {
      content: " \"";
    }

    code::after {
      content: "\" ";
    }
  }

  span {
    font-weight: 800;
  }

  h2 {
    margin-top: 64px;
  }

  p, a, li {
    line-height: 28px;
  }

  code {
    font-weight: 400;
  }

  code span {
    font-weight: 400;
  }

  a {
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  a:visited {
    color: var(--color-link);
  }
}

// layout

.markdown {
  margin-left: 60px;
  margin-right: 60px;

  .book-hint {
    padding: 12px 18px;
  }
}

#TableOfContents {
  border-left: 1px solid var(--custom-color-pale);
  padding: 10px;
}

.book-section-flat {
  border-top: 1px solid var(--custom-color-pale);
  padding-top: 1em;
}

// inline code

.markdown code:not(.language-bash) {
  border-color: var(--custom-color-pale);
  border-style: solid;
  border-width: 2px;
  margin: 0.4em;
  padding-left: 0.2em;
  padding-right: 0.2em;
  padding-top: 0.1em;
  padding-bottom: 0.1em;
}

// heading

.markdown {
  h2 {
    position: relative;
    border-top: none;
    margin-bottom: 1.5em;
  }

  h2::after {
    position: absolute;
    content: '';
    background: linear-gradient(to right, #E65A5A 25%, var(--custom-color-pale) 25%);
    width: 100%;
    height: 4px;
    left: 0;
    bottom: -0.5em;
  }
}

// menu

.book-menu .book-menu-content {
  scrollbar-width: thin;
  background-color: var(--custom-color-background);

  #book-search-input {
    background-color: var(--custom-color-background-md);
    border: 2px solid var(--custom-color-pale);
  }
}

// animation for #

.markdown {
  h1 .anchor,
  h2 .anchor,
  h3 .anchor,
  h4 .anchor,
  h5 .anchor,
  h6 .anchor {
    transition: cubic-bezier(0.215, 0.61, 0.355, 1) 0.3s !important;
    opacity: 0;
    font-size: 1em !important;
  }

  h1:hover .anchor,
  h2:hover .anchor,
  h3:hover .anchor,
  h4:hover .anchor,
  h5:hover .anchor,
  h6:hover .anchor {
    opacity: 1;
  }
}
