/* Page chrome around github-markdown-css. Every color comes from its light/dark variables. */

body.markdown-body {
  box-sizing: border-box;
  max-width: 1012px;
  margin: 0 auto;
  padding: 12px 16px 48px;
}

@media (min-width: 768px) {
  body.markdown-body {
    max-width: 1044px;
    padding: 24px 32px 64px;
  }
}

/* Header: breadcrumbs and the search link. */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.crumbs {
  min-width: 0;
  font-size: 14px;
  color: var(--fgColor-muted);
  overflow-wrap: anywhere;
}

.markdown-body .crumbs a {
  color: var(--fgColor-muted);
}

.crumbs .sep {
  padding: 0 6px;
}

.search-link {
  display: inline-flex;
  flex-shrink: 0;
  padding: 10px;
  margin: -10px;
  border-radius: 6px;
}

.markdown-body .search-link {
  color: var(--fgColor-muted);
}

.search-link svg {
  fill: currentColor;
}

/* Document pages: files line and outline. */
.files {
  font-size: 14px;
  color: var(--fgColor-muted);
}

.toc-inline {
  margin-bottom: 24px;
  padding: 10px 14px;
  font-size: 15px;
  background: var(--bgColor-muted);
  border: 1px solid var(--borderColor-default);
  border-radius: 6px;
}

.markdown-body .toc-inline summary {
  font-weight: 600;
}

.markdown-body .toc-inline ul,
.markdown-body .toc-side ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.markdown-body .toc-inline ul {
  margin-top: 6px;
}

.markdown-body .toc-inline li {
  margin: 0;
  padding: 7px 0;
}

.markdown-body .toc-inline .depth-3,
.markdown-body .toc-side .depth-3 {
  padding-left: 16px;
}

.toc-side {
  display: none;
}

@media (min-width: 1200px) {
  body.markdown-body.has-outline {
    max-width: 1344px;
  }

  .has-outline .page {
    display: grid;
    grid-template-columns: minmax(0, 980px) 260px;
    gap: 40px;
  }

  .has-outline .toc-inline {
    display: none;
  }

  .toc-side {
    display: block;
    position: sticky;
    top: 24px;
    align-self: start;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    font-size: 13px;
  }

  .toc-side .toc-title {
    margin: 0 0 8px;
    font-weight: 600;
  }

  .markdown-body .toc-side li {
    margin: 0;
    padding: 3px 0;
  }

  .markdown-body .toc-side a {
    color: var(--fgColor-muted);
  }

  .markdown-body .toc-side a:hover {
    color: var(--fgColor-accent);
  }
}

/* Directory pages: file listing. */
.markdown-body .listing ul {
  padding-left: 0;
  list-style: none;
}

.markdown-body .listing li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid var(--borderColor-muted);
}

.markdown-body .listing li:first-child {
  border-top: 0;
}

.listing a {
  min-width: 0;
  overflow-wrap: anywhere;
}

.listing .size {
  font-size: 14px;
  color: var(--fgColor-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Display math: a formula wider than the screen scrolls sideways inside its own box. */
.markdown-body .math {
  margin-bottom: 16px;
  padding: 2px 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.markdown-body .math .katex-display {
  margin: 0;
}

/* Phones: fit more of a wide table on screen; it still scrolls sideways inside its own box. */
@media (max-width: 767px) {
  .markdown-body table {
    font-size: 14px;
  }

  .markdown-body table th,
  .markdown-body table td {
    padding: 6px 10px;
  }
}

/* Search page: Pagefind's UI in GitHub's colors. */
.search #search {
  --pagefind-ui-scale: 0.9;
  --pagefind-ui-font: inherit;
  --pagefind-ui-primary: var(--fgColor-accent);
  --pagefind-ui-text: var(--fgColor-default);
  --pagefind-ui-background: var(--bgColor-default);
  --pagefind-ui-border: var(--borderColor-default);
  --pagefind-ui-tag: var(--bgColor-muted);
}
