/* Theme overrides */
:root {
  --theme-color: #0078d7;
  --mono-tint3: #f4f7fc;

  --base-color: #000;
  --base-font-family: "Segoe UI", "Noto Sans", sans-serif;
  --base-font-size: 16px;
  --base-font-weight: 400;
  --base-line-height: 1.8em;

  --code-inline-border-radius: 6px;
  --code-font-weight: bold;

  --pagination-title-font-size: calc(1.15 * var(--base-font-size));

  --link-color: var(--theme-color);

  --heading-color: var(--base-color);

  --heading-margin: 30px 0 20px;

  --heading-h1-font-size: 2.5em;
  --heading-h1-color: var(--theme-color);
  --heading-h1-font-weight: 400;
  --heading-h1-margin: 0 0 0.75em 0;
  --heading-h1-padding: 0.5em 0 0 0;

  --heading-h3-font-size: 1.5em;
  --heading-h3-font-weight: 400;
  --heading-h4-font-size: 1.25em;
  --heading-h5-font-size: 1em;

  --heading-h3-margin: 1.75em 0 1.25em;
  --heading-h4-margin: 1.75em 0 1.25em;

  --strong-color: currentColor;

  --search-margin-top: 1.5rem;
  --search-margin: var(--search-margin-top) 0 0 0;

  --sidebar-width: 25rem;
  --sidebar-border: var(--hr-border);

  --sidebar-nav-pagelink-padding: 0.25em 1.5em 0.25em 0em;
  --sidebar-nav-link-before-content-l3: none;
  --sidebar-nav-strong-border-width: 0;
  --sidebar-nav-strong-font-size: calc(var(--base-font-size) * 1.15);
  --sidebar-nav-strong-margin: 0.5em 0.25em;
  --sidebar-nav-strong-text-transform: none;

  --sidebar-nav-link-border-color--active: transparent;

  --sidebar-nav-pagelink-background-image: none;

  --sidebar-toggle-background: transparent;
  --sidebar-toggle-offset-top: var(--search-margin-top);
  --sidebar-toggle-offset-left: 18px;
  --sidebar-toggle-icon-width: 24px;
  --sidebar-toggle-icon-height: calc(var(--sidebar-toggle-icon-width) / 1.5);
  --sidebar-toggle-icon-stroke-width: 3px;

  --search-result-heading-color: var(--sidebar-nav-link-color);

  --search-result-item-color: var(--sidebar-nav-link-color);
  --search-result-item-border-style: none;

  --search-input-padding: 0.25em 3em;

  --cover-heading-color: var(--heading-h1-color);
  --cover-text-align: left;

  --docsifytabs-tab-color: var(--base-color);
  --docsifytabs-tab-color--active: var(--theme-color);
}

/* Numbered lists */

ol {
  counter-reset: li;
  padding: 1em;
}

ol > li {
  list-style: none;
  padding-left: 1.75em;
  padding-bottom: 1.5em;
  border-left: var(--mono-base) 2px dotted;
}

ol > li:last-of-type {
  padding-bottom: 0;
}

ol > li > p {
  margin: 0em !important;
  padding-bottom: 1em;
}

ol > li > p:last-of-type {
  padding-bottom: 0;
}

ol > li:before {
  content: counter(li);
  counter-increment: li;
  position: absolute;
  background-color: var(--theme-color);
  color: var(--base-background-color);
  border-radius: 1.5em;
  width: 2.25em;
  height: 2.25em;
  font-weight: bold;
  font-size: 0.9em;
  line-height: 1.75em;
  text-align: center;
  margin-left: -3.1em;
  border: var(--base-background-color) 0.25em solid;
  margin-top: -0.125em;
  box-sizing: border-box;
}

ol ul {
  list-style: disc;
}

ul + p {
  padding-top: 1em;
}

/* Don't wrap text in sidebar links */
.sidebar a {
  white-space: unset;
  text-overflow: unset;
}

/* Display footer text at a smaller size than main content text */
footer {
  font-size: calc(var(--base-font-size) * 0.8);
}

/* 
  Position inline images (primarily icon-like images) with `middle` because it
  looks the best in the most situations. 
*/
img {
  vertical-align: middle;
}

/* IE11 CSS fixes for docsify-flexible-alerts */

.callout.tip {
  background: inherit;
}

.markdown-section .tip::before {
  background: none !important;
}

/* IE11 CSS fixes for docsify-pagination */

.pagination-item-label svg {
  width: 10px !important;
}

/* Give all alerts a consistent 1em margin */

.markdown-section .alert,
.markdown-section .tip,
.markdown-section .warn {
  margin: 1em 0;
}

/* Alert customizations */

.alert.flat.tip {
  border-color: #285b2a80 !important;
}

.alert.flat.note {
  border-color: #02587f80 !important;
}

.alert.flat.attention {
  border-color: #7f231c80 !important;
}

.alert.flat.warning {
  border-color: #852d1280 !important;
}

/* Tab customizations */

.docsify-tabs--material > .docsify-tabs__tab {
  cursor: pointer;
}

/* Navbar customizations */

nav.app-nav {
  position: sticky;
  padding: 0.5em 45px 0.5em 25px;
  top: 0;
  margin-left: 0;
  background-color: var(--theme-color);
}

.app-nav {
  display: flex;
  align-items: center;
}

.app-nav ul.nav-left {
  flex: 0 1 auto;
}

.app-nav ul.nav-right {
  flex: 1 0 auto;
}

.app-nav li.banner h2 > a {
  color: var(--base-background-color);
  font-weight: normal;
  font-size: 1.3em;
  margin: 0;
}

.app-nav li.banner img {
  height: 1.5em;
  margin-right: 0.25em;
  filter: brightness(1.3);
  vertical-align: middle;
}

.app-nav ul > li > a.active {
  color: var(--base-background-color);
}

/* Show sidebar below navbar */

.sidebar {
  top: 75px;
  height: calc(100vh - 75px);
}

/* Set custom padding for page content */

main .markdown-section {
  padding-top: 2rem !important;
}

/* 
  Ensure pagination links stay vertically-aligned and allow long page titles to
  be wrapped.
*/
.pagination-item {
  max-width: 50%;
}

/* Change alert colors */

/* Fix h1 line height */
.markdown-section h1 {
  line-height: calc(var(--base-line-height) * 0.8);
}

/* Make active navigation links bold */
.sidebar li.active > a,
.page-toc div.active > a {
  font-weight: bold;
}

/* Keep page TOC links unbold by default */
.page-toc div a {
  font-weight: 400;
}

/* Keep pagination links unbold by default */
.pagination-item a {
  font-weight: 400 !important;
}

/* Remove underline for headings on hover */
.markdown-section a.anchor:hover {
  text-decoration: none;
}

/* Make links in content bold and not underlined */
.markdown-section a {
  text-decoration: none;
}

details > summary {
  list-style-type: none;
  cursor: pointer;
  user-select: none;
  display: block;
  padding: 1em;
  padding-right: 2.5em;
  margin: -1em;
  background-color: var(--mono-tint3);
}

details[open] > summary {
  margin-bottom: 1em;
  font-weight: bold;
}

details {
  border: var(--hr-border);
  padding: 1em;
  margin-bottom: 1em;
  background-color: var(--base-background-color);
  position: relative;
}

details > summary:before {
  content: "+";
  font-weight: normal;
  font-size: 1.5rem;
  right: 1rem;
  display: block;
  justify-content: center;
  align-items: center;
  position: absolute;
}

details[open] > summary:before {
  content: "-";
}

/* Show an "external link" icon next to exernal links */
article a[href^="http"]:not(:has(img))::after {
  content: "";
  width: 11px;
  height: 11px;
  margin-left: 4px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5z'/%3E%3Cpath fill-rule='evenodd' d='M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0v-5z'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  display: inline-block;
}

/* Rules for mobile devices and other small screens */

@media screen and (max-width: 60em) {
  .sidebar + .content {
    margin-left: 0;
  }

  .sidebar {
    margin-right: var(--sidebar-width);
  }

  .app-nav {
    display: block;
    text-align: center;
    padding: 0.5em !important;
  }

  .app-nav > ul > li {
    width: 100%;
    margin: 0;
  }

  .markdown-section h1 {
    font-size: calc(var(--base-font-size) * 2);
  }
}

/* CSS rules for printing */

@media print {
  /* Force printing of background colors in Chrome/Edge */
  body {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide top navigation bar */
  nav.app-nav {
    display: none;
  }

  /* Disable links and make look like (bolded) normal text */
  a,
  a:visited,
  a:link {
    text-decoration: none;
    color: var(--base-color);
    font-weight: bold;
    cursor: not-allowed;
  }

  /* Ensure each section starts on its own page */
  article h3 {
    page-break-before: always;
  }

  /* Don't start a new page immediately after a heading */
  article h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    page-break-after: avoid;
  }

  /* Hide pagination navigation */
  article div.docsify-pagination-container {
    display: none;
  }

  /* Hide website footer */
  footer {
    display: none;
  }

  /* Prevent page breaks inside of alerts, notes, tips, etc. */
  article div.alert.callout {
    page-break-inside: avoid;
  }

  /* Prevent page breaks inside of blockquotes */
  article blockquote {
    page-break-inside: avoid;
  }
}
