/*
This CSS is adapted from https://pmarsceill.github.io/just-the-docs/
Copyright Patrick Marsceill, MIT license
https://github.com/pmarsceill/just-the-docs/blob/master/LICENSE.txt
(MIT licensed)
*/

:root {
  /* -- Color Palette -- */
  --primary-bg-color:    #0d1b2a;
  --primary-text-color:  #c5d3e0;
  --link-color:          #6aaed6;
  --primary-dark:        #091422;
  --secondary-bg-color:  #122032;
  --border-color:        #1e3a52;
  --heading-color:       #e8eef4;
  --body-text-color:     #bdcad8;
  --link-color-main:     #4a90c4;

  /* -- Layout -- */
  --sidebar-width:       180px;     /* medium screens (≥50 rem)            */
  --sidebar-width-wide:  200px;     /* wide screens   (≥66.5 rem)          */
  --header-height:       80px;
  --content-min-width: 480px;
  --content-max-width: 1300px;

  /* -- Github Logo -- */
  --github-logo-width: 36px;
  --github-logo-height: 36px;
}

/* ================================================================== */
/*  BASE                                                                */
/* ================================================================== */

html {
  font-family: sans-serif;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  font-size: 15px !important;
}
@media (min-width: 31.25rem) {
  html { font-size: 17px !important; }
}

body {
  margin: 0;
  position: relative;
  padding-bottom: 4rem;
  font-family: -apple-system,"helvetica neue",helvetica,roboto,noto,"segoe ui",arial,sans-serif;
  font-size: inherit;
  line-height: 1.5;
  color: var(--body-text-color);
  background-color: var(--primary-bg-color);
}
@media (min-width: 50rem) {
  body {
    position: static;
    padding-bottom: 0;
  }
}

h1 {
  font-size: 2em;
  margin: 0.67em 0;
  text-align: center;
}
sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
sup { top: -0.5em; }
sub { bottom: -0.25em; }
img { border: 0; }

p,h1,h2,h3,h4,h5,h6,ol,ul,pre,address,blockquote,dl,div,fieldset,form,hr,noscript,table {
  margin-top: 0;
}
h1,h2,h3,h4,h5,h6 {
  margin-top: 1.2em;
  margin-bottom: 0.8em;
  font-weight: 500;
  line-height: 1.15;
  color: var(--heading-color);
}
p { margin-bottom: 1em; }
a { color: var(--link-color-main); text-decoration: none; }
pre { overflow: auto; margin: 0; margin-bottom: 0.8em; }

code {
  font-family: "SFMono-Regular",Menlo,Consolas,Monospace;
  font-size: 12px;
  line-height: 1.4;
  padding: 0.2em 0.15em;
  font-weight: 400;
  background-color: var(--secondary-bg-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
}
li:not(:last-child) { margin-bottom: 5px; }
img { max-width: 100%; height: auto; }
hr {
  height: 1px;
  padding: 0;
  margin: 2rem 0;
  background-color: var(--border-color);
  border: 0;
}

@media (min-width: 50rem) {
  .page-wrap {
    position: absolute;
    top: 0; left: 0;
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
  }
}

/* ================================================================== */
/*  SIDE BAR                                                            */
/* ================================================================== */

.side-bar {
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  background-color: var(--primary-bg-color);   /* ← brand color */
  color: var(--primary-text-color);
}

.side-bar .header {
  display: flex;
  min-height: var(--header-height);
  align-items: center;
}

.side-bar .header .title {
  padding: .75rem 1rem;
  flex-grow: 1;
  display: flex;
  height: 100%;
  align-items: center;
  color: var(--primary-text-color);            /* ← brand text */
  font-size: 18px !important;
  line-height: 1.15em;
}

.show-menu {
  cursor: pointer;
  appearance: none;
  display: flex;
  height: 100%;
  padding: 1rem 2rem 1rem 1rem;
  align-items: center;
  color: var(--link-color-main);
  text-transform: uppercase;
  background-color: var(--primary-bg-color);
  text-align: right;
  border: 0;
  width: calc(100% - 220px);
}

.side-bar .menu {
  width: 100%;
  padding-right: 1rem;
  padding-left: 1rem;
}

/* ── menu lists ── */
.menu-list {
  padding: 0;
  margin-top: 0;
  margin-bottom: 0;
  list-style: none;
}

.menu-list-child-list {
  padding-left: .5em;
  margin-top: 0.5em;
  padding-bottom: 0.5em;
  line-height: 0.9em;
  list-style: none;
}

.menu-list-child-list .menu-list-link {
  color: var(--link-color);                    /* ← brand link */
}

.menu-list-child-list .menu-list-item { position: relative; }

.menu-list-child-list .menu-list-item::before {
  position: absolute;
  margin-top: 0.3em;
  margin-left: -0.8em;
  color: rgba(228, 208, 198, 0.35);            /* faded --primary-text-color */
  content: "- ";
}

.menu-list-child-list .menu-list-item.active::before {
  color: var(--primary-text-color);
}

.menu-list-item {
  font-size: 14px !important;
  margin: 0;
}

.menu-list-parent .menu-list-child-list { display: none; }
.menu-list-parent.active .menu-list-child-list { display: block; }

.menu-list-item.active a {
  font-weight: 600;
  color: var(--primary-text-color);            /* ← brand text for active */
  text-decoration: none;
}

.menu-list-link {
  display: block;
  padding-top: .25rem;
  padding-bottom: .25rem;
  color: var(--link-color);                    /* ← brand link */
}

ul.menu-list-child-list li {
  font-size: 80%;
  padding-left: 1em;
}

ul.menu-list-child-list a.menu-list-link {
  font-size: 14px !important;
}

/* ── sidebar footer ── */
.side-bar .footer {
  width: 150px;
  font-size: 13px;
  padding: 1rem;
  position: absolute;
  bottom: 0; left: 0;
  color: var(--link-color);                    /* ← brand text */
}

/* ── checkbox toggle ── */
input[type=checkbox] { display: none; }
input[type=checkbox]:checked ~ #side-menu { display: block; }

/* ── narrow: sidebar on top ── */
@media (max-width: 49.99rem) {
  .side-bar .menu { display: none; padding-left: 35px; padding-bottom: 15px; }
  .side-bar { border-bottom: 1px solid var(--primary-dark); }
  .side-bar .header { padding-left: 15px; width: 150px; }
  .show-menu { display: block; }
  .side-bar .footer { display: none; }
}

/* ── medium: sidebar on side ── */
@media (min-width: 31.25rem) {
  .side-bar .header .title { font-size: 24px !important; }
  .menu-list-item { font-size: 16px !important; }
}

.side-bar {
  z-index: 1;
}

@media (min-width: 50rem) {
  .side-bar {
    flex-wrap: nowrap;
    position: absolute;
    width: var(--sidebar-width);               /* ← variable */
    height: 100%;
    flex-direction: column;
    align-items: flex-end;
    border-right: 2px solid var(--primary-dark);
  }
  .side-bar .header {
    z-index: 101;
    height: var(--header-height);              /* ← variable */
    max-height: var(--header-height);
    border-bottom: 1px solid var(--primary-dark);
    padding-right: 1.5rem;
    padding-left: 1rem;
  }
  .side-bar .header .title {
    font-size: 24px !important;
    padding-top: .5rem;
    padding-bottom: .5rem;
  }
  .show-menu { display: none; }
  .side-bar .menu {
    width: 140px;
    padding-right: 1rem;
    padding-top: 2rem;
    padding-bottom: 1rem;
    overflow-y: auto;
    flex: 1 1 auto;
  }
  .side-bar .footer {
    padding-right: 1rem;
    padding-left: 1rem;
    position: static;
  }
}

/* ── wide: sidebar on side ── */
@media (min-width: 66.5rem) {
  .side-bar {
    width: var(--sidebar-width-wide);          /* ← variable, fixed (no grow) */
    min-width: var(--sidebar-width-wide);
  }
}

/* ================================================================== */
/*  MAIN CONTENT                                                        */
/* ================================================================== */

.main-content {
  background-color: var(--primary-dark);
  position: relative;
  z-index: 2;
}

.main-content-wrap {
  background-color: var(--primary-dark);
}

@media (min-width: 50rem) {
  .main-content-wrap {
    position: absolute;
    top: 0;
    left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    height: 100%;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
    overflow-y: scroll;
  }
  .main-content {
    position: relative;
    width: clamp(var(--content-min-width), 85%, var(--content-max-width));
    margin: 0 auto;
  }
}

@media (min-width: 66.5rem) {
  .main-content-wrap {
    left: var(--sidebar-width-wide);
    width: calc(100% - var(--sidebar-width-wide));
  }
  .main-content {
    width: clamp(var(--content-min-width), 85%, var(--content-max-width));
    margin: 0 auto;
  }
}

/* ── main header ── */
.main-header {
  padding: 0 1rem;
  display: none;
  background-color: var(--secondary-bg-color);
  height: var(--header-height);
  line-height: var(--header-height);
  position: relative;
  z-index: 2;
}

@media (min-width: 50rem) {
  .main-header {
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    width: 100%;
  }
}

@media (min-width: 66.5rem) {
  .main-header {
    width: calc(100vw - var(--sidebar-width-wide));
  }
}

/* ── header title ── */
.header-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--link-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;   /* graceful truncation on narrow viewports */
  line-height: var(--header-height);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.header-divider {
  color: lightgray;
}

#github {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--github-logo-width);
  height: var(--github-logo-height);
  /* border: 1px solid var(--border-color);
  border-radius: 6px; */
  background-color: var(--primary-dark);
}

#github img {
  width: var(--github-logo-width);
  height: var(--github-logo-height);
}

.main-footer {
  font-size: 14px;
  color: darkgray;
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
}

/* ── content area ── */
.franklin-content {
  padding: 1rem;
  line-height: 1.5;
}
@media (min-width: 50rem) {
  .franklin-content { padding: 2rem; }
}

/* ================================================================== */
/*  FRANKLIN / JUDOC SPECIFICS                                         */
/* ================================================================== */

.franklin-content a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.franklin-content ul, ol { line-height: 1em; }
.franklin-content li { margin-top: 0.3em; line-height: 1.3em; }
.franklin-content ul, .franklin-content ol { padding-left: 1.5em; }
.franklin-content h1:first-of-type { margin-top: 0.5em; }
.franklin-content h1,h2,h3,h4,h5,h6 { position: relative; }

td.fndef-backref { min-width: 20px; }

.franklin-content table {
  margin: 0 auto 1em;
  border-collapse: collapse;
  text-align: center;
}
.franklin-content tr, th, td {
  padding: 10px;
  border: 1px solid var(--border-color);
}
.franklin-content table tbody tr td { border: 1px solid var(--border-color); }

.franklin-content blockquote {
  background: lemonchiffon;
  border-left: 7px solid #a8a8a8;
  margin: 1.5em 10px;
  padding: 0.5em 10px;
  font-style: italic;
}
.franklin-content blockquote p { display: inline; }

.franklin-content .row { display: block; }
.franklin-content .left { float: left; margin-right: 15px; }
.franklin-content .right { float: right; }
.franklin-content .container img { width: auto; padding-left: 0; border-radius: 10px; margin-bottom: 1em; }

/* footnotes */
.franklin-content .fndef table { margin: 0 0 1em; border: 0; }
.franklin-content .fndef tr { padding: 0; border: 0; text-align: left; }
.franklin-content .fndef td { padding: 0; border: 0; }
.franklin-content .fndef td.fndef-backref { vertical-align: top; font-size: 80%; padding-left: 5px; }
.franklin-content .fndef td.fndef-content { font-size: 90%; padding-left: 10px; }
.franklin-content .fndef tr { border-left: 2px solid lightgray; }

.franklin-content img { 
  width: 70%;
  max-width: 600px;
  text-align: center; 
  padding-left: 10%; 
}

.franklin-content .img-small img { width: 50%; text-align: center; padding-left: 20%; }

.franklin-content .center {
  display: block;
  text-align: center;
}

.franklin-content .center img {
  padding-left: 0 !important;
  display: block;
  margin: 0 auto;
  width: 60%;
  max-width: 600px;
  height: auto;
}

/* ================================================================== */
/*  KATEX                                                               */
/* ================================================================== */

body { counter-reset: eqnum; }
.katex { font-size: 1em !important; }
.katex-display .katex { display: inline-block; }
.katex-display::after {
  counter-increment: eqnum;
  content: "(" counter(eqnum) ")";
  position: relative;
  float: right;
  padding-right: 5px;
}
.nonumber .katex-display::after { counter-increment: nothing; content: ""; }

/* ================================================================== */
/*  CODE / HIGHLIGHT.JS                                                 */
/* ================================================================== */

.hljs {
  font-size: 80%;
  line-height: 1.35em;
  border-radius: 10px;
  padding: 1em 1.2em;
}
.hljs-meta, .hljs-metas, .hljs-metap { font-weight: bold; }
.hljs-meta   { color: rgb(25, 179, 51); }
.hljs-metas  { color: red; }
.hljs-metap  { color: rgb(51, 131, 231); }
.hljs-string { color: #ca4418; }
.hljs-subst  { color: inherit; }

code.language-yaml .hljs-attr   { color: #ca4418; }
code.language-yaml .hljs-string { color: green; }

.page-foot {
  margin-top: 2em;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  padding-bottom: 15px;
  color: gray;
  font-size: 90%;
}

/*center and left align toc*/
/* .franklin-toc {
  width: fit-content;   /* shrink-wrap to content width   */
  margin: 0 auto;       /* center the block horizontally  */
  text-align: left;     /* keep the list text left-aligned */
} 
*/

.franklin-toc ol > li > ol { list-style-type: lower-alpha; }
.franklin-toc ol > li > ol > li > ol { list-style-type: lower-roman; }

/* ================================================================== */
/*  LUNR SEARCH                                                         */
/* ================================================================== */

.result-title a { text-decoration: none; }
.result-title a:hover { text-decoration: underline; }
.result-preview { color: #808080; }
.resultCount { color: #808080; }
.result-query { font-weight: bold; }
#lunrSearchForm { margin-top: 1em; }

/* ================================================================== */
/*  PAGE-DIVS                                                           */
/* ================================================================== */

.blank { height: 1.5em; }

.flist p { display: inline; }
.flist ul { list-style: none; }
.flist a#goto { padding-right: 10px; margin-left: -15px; }
.flist a#goto #arrow { display: none; }
.flist a#goto:hover #check { display: none; }
.flist a#goto:hover #arrow { display: inline; }
.tlist p { display: inline; }

.note {
  margin: 1.5em auto 1em;
  width: 95%;
  background-color: aliceblue;
  border-radius: 5px;
}
.note .content { padding: 10px 12px; }
.note .title {
  font-size: 105%;
  border-radius: 5px 5px 0 0;
  padding: 2px 7px;
  color: white;
  background: cornflowerblue;
}

.warning {
  margin: 1.5em auto 1em;
  width: 95%;
  background-color: #f1b3b1;
  border-radius: 5px;
}
.warning .content { padding: 10px 12px; }
.warning .title {
  font-size: 105%;
  border-radius: 5px 5px 0 0;
  padding: 2px 7px;
  color: white;
  background: crimson;
}

.definition {
  background-color: aliceblue;
  border-left: 5px solid cornflowerblue;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 1em;
}

.important {
  background-color: lemonchiffon;
  padding: 0.5em;
  margin-bottom: 1em;
}

.silly-formatting {
  width: 50%;
  text-align: center;
  color: magenta;
  border: 1px solid black;
}

.ccols {
  margin: 1.5em auto;
  width: 60%;
  text-align: center;
}
.ccols svg { width: 30px; }

.lalign td { text-align: left; }
.lalign tr:first-of-type > td { text-align: center; }

.lalignb td { text-align: left; }
.lalignb tr:first-of-type > td { text-align: center; }
.lalignb th:nth-child(1) { width: 100px; }

/* ── misc ── */
.small-img { width: 50%; margin: 0 auto; }

.franklin-content h1 > a { white-space: normal; }
.franklin-content h2 > a { white-space: normal; }
.franklin-content h3 > a { white-space: normal; }

/* References */
.reference-list {
    padding-left: 1.5em;  /* was 0 */
    list-style: decimal;  /* was none */
}
.reference-list li {
    margin-bottom: 0.6em;
    font-size: 0.9em;
    line-height: 1.5;
    color: var(--body-text-color);
}

.reference-list p {
    margin-bottom: 0.6em;
    font-size: 0.9em;
    line-height: 1.5;
    color: var(--body-text-color);
}
.ref-num {
    color: var(--link-color);
    font-weight: 600;
    margin-right: 0.5em;
}