/* The theme of the RobustRLlib documentation.
   A bar across the top; below it three columns, centred in the window: the pages on
   a grey ground on the left, the text in the middle, the sections of the page on the
   right. System fonts, no request outside the site.

   Widths are in rem. The window is measured in em of the browser's own font size:
   83em is where the three columns fit, 67em where the pages and the text fit. */

:root {
  /* the palette of the project page (assets/style.css): white ground, ink text, one blue */
  --bk-text: #202428;
  --bk-muted: #666e75;
  --bk-faint: #8a9096;
  --bk-line: #e1e5e8;
  --bk-ground: #f6f7f8;          /* bar, left column, table heads, inline code */
  --bk-current: #e8eef6;         /* the page that is open */
  --bk-hover: #eef1f4;
  --bk-field: #eef1f4;           /* the search field */
  --bk-code: #f6f7f8;
  --bk-primary: #1f5fa8;         /* links and the name: blue */
  --bk-primary-dark: #143f70;
  --bk-primary-soft: #e8f0fa;
  --bk-bg: #ffffff;
  --bk-bar-height: 52px;
  --bk-sidebar-width: 15rem;
  --bk-content-width: 50rem;
  --bk-content-pad: 2rem;
  --bk-toc-width: 14rem;
  --bk-page-width: 83rem;        /* the three columns together */
  --bk-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif,
             "Apple Color Emoji", "Segoe UI Emoji";
  --bk-mono: SFMono-Regular, Menlo, Consolas, Monaco, "Liberation Mono", "Lucida Console", monospace;
}

/* ---- icons: Font Awesome 4.7, font under the SIL OFL 1.1; only the glyphs in use ---- */
@font-face {
  font-family: "FontAwesome"; font-style: normal; font-weight: 400; font-display: block;
  src: url("../fonts/fontawesome-webfont.woff2") format("woff2"),
       url("../fonts/fontawesome-webfont.woff") format("woff");
}
.fa {
  display: inline-block; font: normal normal normal 14px/1 "FontAwesome"; font-size: inherit;
  text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
.fa-search:before { content: "\f002"; }
.fa-check:before { content: "\f00c"; }
.fa-times:before { content: "\f00d"; }
.fa-clock-o:before { content: "\f017"; }
.fa-adjust:before { content: "\f042"; }
.fa-info-circle:before { content: "\f05a"; }
.fa-arrow-left:before { content: "\f060"; }
.fa-arrow-right:before { content: "\f061"; }
.fa-eye:before { content: "\f06e"; }
.fa-random:before { content: "\f074"; }
.fa-bars:before { content: "\f0c9"; }
.fa-list-ul:before { content: "\f0ca"; }
.fa-files-o:before { content: "\f0c5"; }
.fa-lightbulb-o:before { content: "\f0eb"; }
.fa-check-square:before { content: "\f14a"; }
.fa-cubes:before { content: "\f1b3"; }
.fa-plug:before { content: "\f1e6"; }
.fa-object-group:before { content: "\f247"; }

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0; background: var(--bk-bg); color: var(--bk-text);
  font-family: var(--bk-font); font-size: 1rem; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
a { color: var(--bk-primary); text-decoration: none; }
a:hover { color: var(--bk-primary-dark); text-decoration: underline; }
.bk-skip {
  position: absolute; left: -999px; top: 0; z-index: 100; padding: .5rem 1rem;
  background: var(--bk-primary); color: #fff;
}
.bk-skip:focus { left: 0; color: #fff; }
.bk-icon-button {
  display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem;
  border: 0; border-radius: 6px; background: transparent; color: var(--bk-text);
  font-size: 1.2rem; cursor: pointer;
}
.bk-icon-button:hover { background: var(--bk-hover); color: var(--bk-primary); }

/* ---- the name of the site: in the bar, and again on top of the left column, where
        it stays when the bar has scrolled away ---- */
.bk-brand {
  display: flex; align-items: center; gap: .45rem; height: var(--bk-bar-height);
  padding: 0 1rem; line-height: var(--bk-bar-height); white-space: nowrap;
  font-size: 1.1rem; color: var(--bk-text);
}
.bk-brand:hover { color: var(--bk-text); text-decoration: none; }
.bk-brand .mark { flex: none; width: 32px; height: 32px; margin-right: .2rem; }
.bk-brand-name { font-weight: 700; letter-spacing: -.02em; }
.bk-brand-mark { color: var(--bk-primary); }
.bk-brand-kind { color: var(--bk-muted); }

/* ---- the bar across the top ---- */
.bk-topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 30; height: var(--bk-bar-height);
  background: var(--bk-ground); border-bottom: 1px solid var(--bk-line);
}
.bk-topbar-inner {
  display: flex; align-items: center; height: 100%; max-width: var(--bk-page-width); margin: 0 auto;
}
.bk-topbar .bk-brand { padding-left: 1.5rem; }
.bk-topbar-space { flex: 1 1 auto; }
.bk-topbar-menu { display: none; margin-left: .5rem; }
.bk-topbar-link {
  margin-right: 1rem; padding: .3rem .8rem; border: 1px solid #c9ced3; border-radius: 999px;
  background: #ffffff; font-size: .875rem; color: var(--bk-text); white-space: nowrap;
}
.bk-topbar-link:hover { border-color: var(--bk-primary); color: var(--bk-primary); text-decoration: none; }

/* ---- the three columns ---- */
.bk-page { display: flex; min-height: 100vh; }
.bk-sidebar-drawer {
  display: flex; justify-content: flex-end; flex: 0 0 auto;
  width: calc((100% - var(--bk-page-width)) / 2 + var(--bk-sidebar-width)); min-width: var(--bk-sidebar-width);
  background: var(--bk-ground); border-right: 1px solid var(--bk-line);
}
.bk-sidebar {
  position: sticky; top: 0; width: var(--bk-sidebar-width); height: 100vh; overflow-y: auto;
  padding-bottom: 2rem; scrollbar-width: thin;
}
.bk-sidebar .bk-brand { padding-left: 1.5rem; }
.bk-main { display: flex; flex: 1 1 0; min-width: 0; padding-top: var(--bk-bar-height); }
.bk-content {
  flex: 0 1 auto; width: calc(var(--bk-content-width) + 2 * var(--bk-content-pad)); min-width: 0;
  padding: 0 var(--bk-content-pad); position: relative;
}
.bk-toc-drawer { flex: 0 0 var(--bk-toc-width); width: var(--bk-toc-width); background: var(--bk-bg); }
.bk-toc {
  position: sticky; top: 0; max-height: 100vh; overflow-y: auto; padding: 2.5rem 1rem 2rem 0;
  scrollbar-width: thin;
}

/* ---- left: search, pages ---- */
.bk-search-button {
  display: flex; align-items: center; gap: .8rem; width: calc(100% - 1.5rem); margin: .7rem .75rem 0;
  padding: .55rem .9rem; border: 1px solid var(--bk-line); border-radius: 6px;
  background: var(--bk-field); color: var(--bk-muted); font: inherit; font-size: 1rem;
  cursor: pointer; text-align: left;
}
.bk-search-button:hover { border-color: var(--bk-primary); color: var(--bk-text); }
.bk-search-button .fa { font-size: .95rem; }

.bk-nav { margin: 1.2rem .5rem 0; font-size: .875rem; line-height: 1.15; }
.bk-caption {
  margin: 1rem 0 0; padding: .5rem 1rem; font-size: .875em; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--bk-text);
}
.bk-nav-list { list-style: none; margin: 0; padding: 0; }
.bk-nav-depth-2, .bk-nav-depth-3 { margin-left: 1rem; }
.bk-nav-link, .bk-nav-group > details > summary {
  display: block; padding: .5rem 1rem; border-radius: 6px; color: var(--bk-text);
}
.bk-nav-depth-2 .bk-nav-link, .bk-nav-depth-3 .bk-nav-link,
.bk-nav-depth-2 .bk-nav-group > details > summary { color: var(--bk-muted); }
.bk-nav-link:hover, .bk-nav-group > details > summary:hover {
  background: var(--bk-hover); color: var(--bk-text); text-decoration: none;
}
.bk-nav-link.is-active { background: var(--bk-current); color: var(--bk-text); font-weight: 700; }
.bk-nav-group > details > summary {
  position: relative; padding-right: 2.2rem; cursor: pointer; list-style: none; user-select: none;
}
.bk-nav-group > details > summary::-webkit-details-marker { display: none; }
.bk-nav-group > details > summary::after {
  content: ""; position: absolute; right: 1rem; top: 50%; width: .45rem; height: .45rem;
  margin-top: -.34rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); transition: transform .15s ease;
}
.bk-nav-group > details[open] > summary::after { transform: rotate(-135deg); margin-top: -.1rem; }

/* ---- middle: the text ---- */
.bk-tools { display: none; position: sticky; top: .6rem; z-index: 10; float: right; margin: .9rem -1rem 0 .5rem; }
.bk-tools .bk-icon-button { background: var(--bk-bg); border: 1px solid var(--bk-line); box-shadow: 0 1px 3px rgba(16, 24, 40, .08); }
.bk-article { padding: 2rem 0 0; line-height: 1.5; overflow-wrap: break-word; }
.bk-article > :first-child { margin-top: 0; }
.bk-article h1, .bk-article h2, .bk-article h3, .bk-article h4, .bk-article h5 {
  margin: 2rem 0 1rem; font-weight: 700; line-height: 1.25; color: var(--bk-text);
}
.bk-article h1 { font-size: 2.2rem; margin-top: 0; }
.bk-article h2 { font-size: 1.7rem; }
.bk-article h3 { font-size: 1.35rem; margin-top: 1.7rem; }
.bk-article h4 { font-size: 1.15rem; margin-top: 1.5rem; }
.bk-article h5 { font-size: 1rem; margin-top: 1.3rem; }
.bk-article p { margin: 0 0 .85rem; }
.bk-article ul, .bk-article ol { margin: 0 0 .85rem; padding-left: 1.4rem; }
.bk-article li { margin: .15rem 0; }
.bk-article li > ul, .bk-article li > ol { margin-bottom: 0; }
.bk-article li > p { margin-bottom: .4rem; }
.bk-article hr { border: 0; border-top: 1px solid var(--bk-line); margin: 2rem 0; }
.bk-article img { max-width: 100%; height: auto; }
.bk-article .headerlink {
  margin-left: .4rem; color: var(--bk-faint); font-weight: 400; opacity: 0;
  transition: opacity .12s ease;
}
.bk-article .headerlink:hover { text-decoration: none; color: var(--bk-primary); }
.bk-article :is(h1, h2, h3, h4, h5):hover .headerlink, .bk-article .headerlink:focus { opacity: 1; }

.bk-article dl { margin: 0 0 .85rem; }
.bk-article dt { font-weight: 700; }
.bk-article dd { margin: 0 0 .7rem 1.5rem; color: var(--bk-muted); }

/* tables: as wide as their content, scrolling sideways when that is wider than the text */
.bk-article table {
  display: block; width: max-content; max-width: 100%; overflow-x: auto;
  margin: 0 0 1.2rem; border-collapse: collapse; border-spacing: 0; border-radius: .2rem;
  box-shadow: 0 .2rem .5rem rgba(0, 0, 0, .05), 0 0 .0625rem rgba(0, 0, 0, .1);
  font-size: .9rem; line-height: 1.45; font-variant-numeric: tabular-nums;
}
.bk-article th, .bk-article td {
  padding: .45rem .7rem; border-bottom: 1px solid var(--bk-line); border-right: 1px solid var(--bk-line);
  text-align: left; vertical-align: top;
}
.bk-article th:last-child, .bk-article td:last-child { border-right: 0; }
.bk-article tbody tr:last-child td { border-bottom: 0; }
.bk-article thead th { background: var(--bk-ground); font-weight: 700; vertical-align: bottom; white-space: nowrap; }
.bk-article td:first-child a { white-space: nowrap; }
.bk-article td img { vertical-align: middle; max-width: none; }

/* code */
.bk-article code {
  padding: .1em .2em; border: 1px solid var(--bk-line); border-radius: .2em;
  background: var(--bk-ground); font-family: var(--bk-mono); font-size: .8125em;
}
.bk-article a code { color: inherit; }
.bk-article div.highlight {
  position: relative; margin: 0 0 1.2rem; border-radius: .2rem; background: var(--bk-code);
}
.bk-article div.highlight pre {
  margin: 0; padding: .875rem; overflow-x: auto; font-family: var(--bk-mono);
  font-size: .8125rem; line-height: 1.5; background: transparent;
}
.bk-article div.highlight pre code {
  padding: 0; border: 0; background: transparent; font-size: inherit; color: inherit;
}
.bk-article div.highlight span.filename {
  display: block; padding: .4rem .875rem; border-bottom: 1px solid var(--bk-line);
  font-size: .8rem; font-weight: 700; color: var(--bk-muted);
}
.bk-copy {
  position: absolute; top: .3rem; right: .3rem; width: 1.9rem; height: 1.9rem;
  border: 1px solid var(--bk-line); border-radius: 4px; background: var(--bk-bg);
  color: var(--bk-muted); font-size: .9rem; cursor: pointer; opacity: 0; transition: opacity .12s ease;
}
.bk-article div.highlight:hover .bk-copy, .bk-copy:focus { opacity: 1; }
.bk-copy:hover { color: var(--bk-primary); border-color: var(--bk-primary); }
.bk-copy.is-done { color: #3d9a57; border-color: #3d9a57; opacity: 1; }

/* notes and tips */
.bk-article .admonition {
  margin: 0 0 1.2rem; border-left: .2rem solid var(--bk-primary); border-radius: .2rem;
  background: var(--bk-bg); font-size: .9rem; overflow: hidden;
  box-shadow: 0 .2rem .5rem rgba(0, 0, 0, .05), 0 0 .0625rem rgba(0, 0, 0, .1);
}
.bk-article .admonition > .admonition-title {
  margin: 0; padding: .45rem .8rem .45rem 2.4rem; position: relative; font-weight: 700;
  background: var(--bk-primary-soft);
}
.bk-article .admonition > .admonition-title::before {
  content: "\f05a"; font-family: "FontAwesome"; font-weight: 400; position: absolute; left: .8rem;
  color: var(--bk-primary);
}
.bk-article .admonition > :not(.admonition-title) { margin: .7rem .8rem; }
.bk-article .admonition.tip { border-left-color: #3d9a57; }
.bk-article .admonition.tip > .admonition-title { background: #e9f5e6; }
.bk-article .admonition.tip > .admonition-title::before { content: "\f0eb"; color: #3d9a57; }

/* ---- middle: below the text ---- */
.bk-footer { margin-top: 2.5rem; padding: 0 0 2rem; font-size: .875rem; }
.bk-related { display: flex; justify-content: space-between; gap: 1rem; margin: 0 0 1.5rem; }
.bk-related a { display: flex; align-items: center; gap: .9rem; max-width: 48%; color: var(--bk-muted); }
.bk-related a:hover { text-decoration: none; }
.bk-related a:hover .bk-related-title { text-decoration: underline; }
.bk-related .bk-next { margin-left: auto; text-align: right; }
.bk-related .fa { color: var(--bk-faint); }
.bk-related-label { display: block; font-size: .8rem; color: var(--bk-muted); }
.bk-related-title { display: block; font-size: 1.1rem; color: var(--bk-primary); }
.bk-footnote { margin: 0; padding-top: 1rem; border-top: 1px solid var(--bk-line); color: var(--bk-faint); }

/* ---- right: the sections of the page ---- */
.bk-toc-title {
  margin: 0 0 .5rem; padding-left: 1.5rem; font-size: .7rem; text-transform: uppercase;
  color: var(--bk-faint);
}
.bk-toc-tree { padding-left: .5rem; border-left: 1px solid var(--bk-line); font-size: .8125rem; line-height: 1.3; }
.bk-toc-list { list-style: none; margin: 0; padding: 0; }
.bk-toc-depth-2 { padding-left: 1rem; }
.bk-toc-link { display: block; padding: .3rem 0 .3rem 1rem; color: var(--bk-muted); overflow-wrap: anywhere; }
.bk-toc-link:hover { color: var(--bk-text); text-decoration: underline; }
.bk-toc-link.is-active { color: var(--bk-primary-dark); font-weight: 700; }

/* ---- what lies over the page: backdrop, search ---- */
.bk-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(15, 23, 42, .45); }
.bk-search {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 1rem 1rem; background: rgba(15, 23, 42, .45);
}
.bk-search-panel {
  width: 100%; max-width: 44rem; max-height: 76vh; display: flex; flex-direction: column;
  border-radius: 10px; background: var(--bk-bg); box-shadow: 0 20px 50px -12px rgba(15, 23, 42, .5);
  overflow: hidden;
}
.bk-search-field {
  display: flex; align-items: center; gap: .7rem; padding: .5rem .6rem .5rem 1.1rem;
  border-bottom: 1px solid var(--bk-line); color: var(--bk-muted);
}
.bk-search-field input {
  flex: 1 1 auto; min-width: 0; height: 2.5rem; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 1.05rem; color: var(--bk-text);
}
.bk-search-field input::-webkit-search-cancel-button { display: none; }
.bk-search-results { overflow-y: auto; padding: .4rem .6rem; }
.bk-search-results:empty { display: none; }
.bk-search-results article { position: relative; padding: .55rem .7rem .6rem; border-radius: 6px; }
.bk-search-results article:hover, .bk-search-results article:focus-within { background: var(--bk-primary-soft); }
.bk-search-results h3 { margin: 0 0 .1rem; font-size: 1rem; font-weight: 700; }
.bk-search-results h3 a:hover { text-decoration: none; }
/* the whole entry is the link */
.bk-search-results h3 a::after { content: ""; position: absolute; inset: 0; }
.bk-search-results article p {
  margin: 0; font-size: .85rem; line-height: 1.5; color: var(--bk-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bk-search-results > p { margin: 0; padding: .8rem .7rem; color: var(--bk-muted); }

/* ---- large windows: larger type ---- */
@media (min-width: 97em) {
  html { font-size: 110%; }
}

/* ---- the three columns no longer fit: the sections of the page move behind a button ---- */
@media (max-width: 83em) {
  .bk-toc-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; flex: none; width: min(18rem, 86vw);
    box-shadow: -8px 0 30px -12px rgba(15, 23, 42, .4); border-left: 1px solid var(--bk-line);
    transform: translateX(105%); transition: transform .2s ease; visibility: hidden;
  }
  .bk-toc { position: static; max-height: 100%; height: 100%; padding: 1.5rem 1rem 2rem .75rem; }
  .bk-toc-open .bk-toc-drawer { transform: none; visibility: visible; }
  .bk-tools { display: block; }
  .bk-main { justify-content: center; }
}

/* ---- the pages and the text no longer fit: the pages move behind a button too,
        and the bar stays in place so that both buttons are at hand ---- */
@media (max-width: 67em) {
  html { scroll-padding-top: calc(var(--bk-bar-height) + 1rem); }
  .bk-topbar { position: fixed; }
  .bk-topbar-inner { justify-content: space-between; }
  .bk-topbar-menu { display: inline-flex; }
  .bk-topbar-space { display: none; }
  .bk-topbar .bk-brand { padding: 0 .5rem; }
  .bk-sidebar-drawer {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; width: min(18rem, 86vw); min-width: 0;
    box-shadow: 8px 0 30px -12px rgba(15, 23, 42, .4);
    transform: translateX(-105%); transition: transform .2s ease; visibility: hidden;
  }
  .bk-sidebar { position: static; width: 100%; height: 100%; }
  .bk-nav-open .bk-sidebar-drawer { transform: none; visibility: visible; }
  .bk-tools { top: calc(var(--bk-bar-height) + .6rem); margin-right: -.5rem; }
}
@media (max-width: 46em) {
  .bk-content { padding: 0 1rem; }
  .bk-tools { margin-right: 0; }
  .bk-article h1 { font-size: 1.9rem; }
  .bk-article h2 { font-size: 1.5rem; }
  .bk-article h3 { font-size: 1.25rem; }
  .bk-brand-kind { display: none; }
  .bk-topbar-link { margin-right: .6rem; padding: .25rem .6rem; font-size: .8rem; }
  .bk-related { flex-direction: column; }
  .bk-related a { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bk-sidebar-drawer, .bk-toc-drawer { transition: none; }
}

/* ---- on paper: the text only ---- */
@media print {
  .bk-topbar, .bk-sidebar-drawer, .bk-toc-drawer, .bk-tools, .bk-related, .bk-backdrop, .bk-search, .bk-copy, .bk-skip { display: none !important; }
  .bk-page, .bk-main { display: block; padding: 0; }
  .bk-content { width: auto; padding: 0; }
  .bk-article table { display: table; width: auto; overflow: visible; box-shadow: none; }
}
