@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600;700&display=swap');

:root {
    --brand-color: #EF3939;
    --brand-color-outline: rgba(239, 57, 57, 0.1);
    --brand-color-dark: #9c2525;
    --background-color: #ffffff;
    --text-color: #856464;
    --devider-light-color: #bbb;
}

.light {
    --fg: #333;
    --links: #c42f2f;
    --sidebar-active: var(--links);
}

.coal {
    --links: #ee6f6f;
    --sidebar-active: var(--links);
}

pre > code {
    border-radius: 5px;
    padding: 1.5rem;
}

.meta-data {
    position: relative;
    font-size: 87.5%;
    display: grid;
    grid-template-columns: 70px auto;
    gap: 0.8rem 2rem;
    align-items: flex-start;
    margin: 2rem 0 4rem;
}

.meta-data > div:nth-child(2n + 1) {
    opacity: 0.5;
}

.meta-data .wasm-size-note {
    opacity: 0.5;
}

.meta-data .wasm-size-help {
    display: inline-flex;
    vertical-align: -0.15em;
    cursor: help;
}

.meta-data .wasm-size-help:focus:not(:focus-visible) {
    outline: none;
}

.meta-data .wasm-size-help svg {
    opacity: 0.5;
}

.meta-data .wasm-size-help:hover svg,
.meta-data .wasm-size-help:focus svg {
    opacity: 1;
}

.meta-data .wasm-size-tooltip {
    position: absolute;
    z-index: 10;
    /* below the meta data, so it fits on narrow screens */
    top: calc(100% + 6px);
    left: 0;
    max-width: min(420px, 100%);
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--theme-popup-border);
    border-radius: 6px;
    background: var(--theme-popup-bg);
    color: var(--fg);
    font-size: 0.9em;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.15s;
}

.meta-data .wasm-size-help:hover .wasm-size-tooltip,
.meta-data .wasm-size-help:focus .wasm-size-tooltip {
    visibility: visible;
    opacity: 1;
}

.sidebar {
    top: 3.8rem;
}

.sidebar .sidebar-scrollbox {
    padding: 10px 10px 10px 20px;
}

.chapter li.chapter-item {
    margin: 0;
}

.chapter li.part-title {
    margin-top: 20px;
}

li.chapter-item > .chapter-link-wrapper > a:not(.chapter-fold-toggle) {
    padding: 0.1em 1em;
    margin: 0.4em 0 0;
    border-left: 1px solid transparent;
}

li.chapter-item > .chapter-link-wrapper {
    position: relative;
}

/* continuous vertical line along the chapters */
li.chapter-item > .chapter-link-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    border-left: 1px solid var(--fg);
    opacity: 0.1;
}

li.chapter-item > .chapter-link-wrapper > a.active {
    position: relative;
    border-left-color: currentColor;
    font-weight: 600;
}

li.part-title + li.chapter-item > .chapter-link-wrapper > a {
    margin-top: 0;
}

li.chapter-item.affix > .chapter-link-wrapper::before {
    content: none;
}

li.chapter-item.affix > .chapter-link-wrapper > a {
    padding-left: 0;
}

li.chapter-item.affix > .chapter-link-wrapper > a.active {
    border-left: 0 none;
}

/* headings of the current page, styled like the chapters instead of mdbook's thick bar */
.chapter .on-this-page {
    position: relative;
    margin-left: 1em;
    padding-left: 0;
    border-inline-start: none;
}

.chapter .on-this-page::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    border-left: 1px solid var(--fg);
    opacity: 0.1;
}

.chapter .on-this-page a.header-in-summary {
    position: relative;
    padding: 0 1em;
    border-left: 1px solid transparent;
    font-size: 0.95em;
}

.chapter .on-this-page a.current-header {
    border-left-color: currentColor;
}

#header-logo-container, h1.menu-title {
    font-family: 'Quicksand', sans-serif;
    letter-spacing: -0.7px;
}

h1, h2, h3, h4, h5, h6, li.part-title {
    font-family: 'Quicksand', sans-serif;
}

h1 {
    font-weight: 700;
}

h2, h3, h4 {
    font-weight: 600;
}

#searchbar {
    font-size: 1.6rem;
}

.banner > *,::after,::before,::backdrop,::file-selector-button {
  box-sizing: border-box;
  border: 0 solid;
  margin: 0;
  padding: 0;
}

.banner {
    display: none;
    isolation: isolate;
    overflow: hidden;
    position: relative;
    padding: 1rem 1.25rem;
    column-gap: 1.5rem;
    align-items: center;
    background-color: rgb(249 250 251);
    z-index: 999999;
}

.banner:before {
  content: "";
  flex: 1
}

.bg-blur {
  position: absolute;
  top: 50%;
  filter: blur(40px);
  z-index: -10;
  transform: translateY(-50%);
  transform: translate3d(0, -50%, 0) rotate(0) skewX(0) skewY(0) scaleX(1.6) scaleY(1.6);
}

.bg-blur > div {
  background: linear-gradient(to right, mediumvioletred 0%, cornflowerblue 100%);
  opacity: 0.3;
  aspect-ratio: 577/310;
  width: 36.0625rem;
}

.first-bg-blur {
  left: max(-9rem, 50% - 72rem);
}

.second-bg-blur {
  left: max(65rem, 50% + 25rem);
}

.banner-content {
    font-size: 1.4rem;
    line-height: 2rem;
    font-weight: 500;
    color: #222;
}

.banner-content > a:hover {
  transition: 0.5s;
  filter: drop-shadow(0 0 23px #6b4bff)
}

.banner-content > a > span > svg {
  vertical-align: middle;
  height: 2rem;
  width: 15rem;
  margin-left: 0.25rem
}

.banner-close-button {
    display: flex;
    flex: 1 1 0;
    justify-content: flex-end;
}

.banner-close-button > button {
    -webkit-appearance: button;
    background-color: rgba(0, 0, 0, 0);
    background-image: none;
    text-transform: none;
    cursor: pointer;
    box-sizing: border-box;
    border: 0 solid;
    font-size: 100%;
    padding: 0.875rem;
    margin: -0.875rem;
}

.banner-close-button > button > svg {
    width: 2rem;
    height: 2rem;
    color: #111827;
}

.banner-close-button > button:focus-visible {
  outline-offset: -4px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

@media (min-width: 640px) {
    .banner {
        display: flex;
    }
}