/* Replace the default navbar icons with Minecraft sprites. */

#mdbook-search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Hide the Font Awesome magnifying glass. */
#mdbook-search-toggle > .fa-svg {
  display: none;
}

/* Inject the spyglass sprite. */
#mdbook-search-toggle::after {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  background-image: url("/img/gui/spyglass.png");
  background-repeat: no-repeat;
  background-size: contain;
  image-rendering: pixelated;
}

#mdbook-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Hide the Font Awesome palette. */
#mdbook-theme-toggle > .fa-svg {
  display: none;
}

/* Inject the brush sprite. */
#mdbook-theme-toggle::after {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  background-image: url("/img/gui/brush.png");
  background-repeat: no-repeat;
  background-size: contain;
  image-rendering: pixelated;
}

/* Minecraft-flavoured theme popup. */
.theme-popup {
  border: 4px solid transparent;
  border-image: url("/img/gui/tooltip_frame.png") 2 / 4px / 0 stretch;
  border-radius: 0;
  background-color: var(--bg);
}

.theme-popup .theme {
  font-family: "IllyriaRP", "Open Sans", sans-serif;
  color: var(--fg);
}

.theme-popup .theme:hover,
.theme-popup .theme.theme-selected {
  color: var(--sidebar-active);
}

/* IllyriaRP for search input + results. */
#mdbook-searchbar,
#mdbook-searchresults-header,
#mdbook-searchresults-outer {
  font-family: "IllyriaRP", "Open Sans", sans-serif;
  text-shadow: 2px 2px 0 rgb(0 0 0 / 60%);
}

#mdbook-searchbar {
  border-radius: 0;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-fg);
  border: 4px solid transparent;
  border-image: url("/img/gui/tooltip_frame.png") 2 / 4px / 0 stretch;
}

#mdbook-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Hide the Font Awesome bars icon. */
#mdbook-sidebar-toggle > .fa-svg {
  display: none;
}

/* Inject the closed knowledge-book sprite (sidebar hidden). */
#mdbook-sidebar-toggle::after {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  background-image: url("/img/gui/knowledge_book_closed.png");
  background-repeat: no-repeat;
  background-size: contain;
  image-rendering: pixelated;
}

/* Swap to the open variant when the sidebar is visible. */
html.sidebar-visible #mdbook-sidebar-toggle::after {
  background-image: url("/img/gui/knowledge_book_open.png");
}

/* Add breathing room between parts in the table of contents. */
.chapter li.part-title {
  margin-top: 2rem;
}

/* No extra space before the very first part. */
.chapter .chapter-item:has(> .part-title):first-of-type .part-title {
  margin-top: 0;
}

/* Minecraft tooltip styling for the "Copied!" popup. */
.tooltiptext {
  font-family: "IllyriaRP", "Open Sans", sans-serif;
  border-radius: 0;
  border: 4px solid transparent;
  border-image: url("/img/gui/tooltip_frame.png") 2 / 4px / 0 stretch;
  background-color: rgb(25 22 21 / 94%);
  text-shadow: 2px 2px 0 rgb(0 0 0 / 60%);
  padding: 6px 10px;
}

/* Minecraft-style border on the sidebar. */
.sidebar {
  border-right: 4px solid transparent;
  border-image: url("/img/gui/tooltip_frame.png") 2 / 4px / 0 stretch;
}

[dir="rtl"] .sidebar {
  border-right: none;
  border-left: 4px solid transparent;
  border-image: url("/img/gui/tooltip_frame.png") 2 / 4px / 0 stretch;
}
