/* Fonts */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/IBMPlexMono-Italic.woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/IBMPlexMono-SemiBoldItalic.woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/IBMPlexMono-Regular.woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/IBMPlexMono-SemiBold.woff2');
}

:root {
    --main-bg-color: #fefefe;
    --main-color: #444;
    --link-visited-color: #0000ff;
    --link-color: #0645ad;
    --link-hover-color: #06e;
    --link-active-color: #faa700;
    --selection-bg-color: rgba(0, 120, 255, 0.3);
    --selection-color: #000;
    --header-color: #111;
    --blockquote-color: #666;
    --code-bg-color: #eee;
    --code-color: #ff7373;
    --ins-bg-color: #ff9;
    --ins-color: #000;
    --mark-bg-color: #ff0;
    --mark-color: #000;
    --separator-color: #ccc;
    --menu-border-color: #ddd;
    --logo-filter: invert(0);
}

[data-theme="dark"] {
    --main-bg-color: #2e3b42;
    --main-color: #bdb7af;
    --link-visited-color: #0080FF;
    --link-color: #66b1fa;
    --link-hover-color: #518dc8;
    --link-active-color: #faa700;
    --selection-bg-color: rgba(160, 220, 255, 0.8);
    --selection-color: #000;
    --header-color: #eee;
    --blockquote-color: #666;
    --code-bg-color: #555;
    --code-color: #0080FF;
    --ins-bg-color: #ff9;
    --ins-color: #000;
    --mark-bg-color: #ff0;
    --mark-color: #000;
    --separator-color: #eee;
    --menu-border-color: #5a6165;
    --logo-filter: invert(0);
}

html {
    font-size: 100%;
    overflow-y: auto;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    height: 100%;
}

body {
    color: var(--main-color);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    line-height: 1.7;
    background-color: var(--main-bg-color);
    height: 100%;
    margin: 0;
}

.box {
    display: flex;
    flex-flow: column;
    height: 100%;
    max-width: 780px;
    margin: auto;
}

.box .content {
    flex: 1 1 auto;
    margin: 10px;
}

.box .footer {
    flex: 0 1 40px;
    margin: 0 10px 0 10px;
}

a {
    color: var(--link-color);
    text-decoration: none;
}

a:visited {
    color: var(--link-visited-color);
}

a:hover {
    color: var(--link-hover-color);
}

a:active {
    color: var(--link-active-color);
}

*::-moz-selection {
    background: var(--selection-bg-color);
    color: var(--selection-color);
}

*::selection {
    background: var(--selection-bg-color);
    color: var(--selection-color);
}

a::-moz-selection {
    background: var(--selection-bg-color);
    color: var(--link-color);
}

a::selection {
    background: var(--selection-bg-color);
    color: var(--link-color);
}

p {
    margin: 1em 0;
}

img {
    max-width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--header-color);
    line-height: 125%;
    margin-top: 2em;
    font-weight: bold;
    margin-left: 8px;
}

h1 {
    font-size: 2.5em;
}

h2 {
    font-size: 2em;
}

h3 {
    font-size: 1.5em;
}

h4 {
    font-size: 1.2em;
}

h5 {
    font-size: 1em;
}

h6 {
    font-size: 0.9em;
}

blockquote {
    color: var(--blockquote-color);
    margin: 0;
    padding-left: 3em;
    border-left: 0.5em var(--blockquote-color) solid;
}

hr {
    display: block;
    height: 2px;
    border: 0;
    border-top: 1px solid #aaa;
    border-bottom: 1px solid #eee;
    margin: 1em 0;
    padding: 0;
}

pre, code, kbd, samp {
    font-family: 'courier new', monospace;
    font-size: 0.98em;
}

code:not(.sourceCode) {
    background-color: var(--code-bg-color);
    color: var(--code-color);
}

pre {
    white-space: pre;
    white-space: pre-wrap;
    word-wrap: break-word;
}

b, strong {
    font-weight: bold;
}

dfn {
    font-style: italic;
}

ins {
    background-color: var(--ins-bg-color);
    color: var(--ins-color);
    text-decoration: none;
}

mark {
    background: var(--mark-bg-color);
    color: var(--mark-color);
    font-style: italic;
    font-weight: bold;
}

sub, sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sup {
    top: -0.5em;
}

sub {
    bottom: -0.25em;
}

ul, ol {
    margin: 1em 0;
    padding: 0 0 0 2em;
}

li p:last-child {
    margin-bottom: 0;
}

ul ul, ol ol {
    margin: .3em 0;
}

dl {
    margin-bottom: 1em;
}

dt {
    font-weight: bold;
    margin-bottom: .8em;
}

dd {
    margin: 0 0 .8em 2em;
}

dd:last-child {
    margin-bottom: 0;
}

img {
    border: 0;
    -ms-interpolation-mode: bicubic;
    vertical-align: middle;
}

figure {
    display: block;
    text-align: center;
    margin: 1em 0;
}

figure img {
    border: none;
    margin: 0 auto;
}

figcaption {
    font-size: 0.8em;
    font-style: italic;
    margin: 0 0 .8em;
}

table {
    margin-bottom: 2em;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #ddd;
    border-spacing: 0;
    border-collapse: collapse;
    max-width: 100%;
}

table th {
    padding: .2em 1em;
    background-color: #eee;
    border-top: 1px solid #ddd;
    border-left: 1px solid #ddd;
}

table td {
    padding: .2em 1em;
    border-top: 1px solid #ddd;
    border-left: 1px solid #ddd;
    vertical-align: top;
}

@media (max-width: 768px) {
    table * {
        display: contents;
    }
    table {
        display: flex;
        flex-direction:column;
    }
    th, td {
        display:block;
        text-align:center;
    }
    tr > *:nth-child(1) { order:1;}
    tr > *:nth-child(2) { order:2;}
    tr > *:nth-child(3) { order:3;}
    tr > *:nth-child(4) { order:4;}
    tr > *:nth-child(5) { order:5;}
    tr > *:nth-child(6) { order:6;}
    tr > *:nth-child(7) { order:7;}
    tr > *:nth-child(8) { order:8;}
}

.author {
    font-size: 0.9em;
}

@media only screen and (min-width: 480px) {
    body {
        font-size: 14px;
    }
}

@media only screen and (min-width: 768px) {
    body {
        font-size: 16px;
    }
}

@media print {
    * {
        background: transparent !important;
        color: black !important;
        filter: none !important;
        -ms-filter: none !important;
    }

    body {
        font-size: 12pt;
        max-width: 100%;
    }

    a, a:visited {
        text-decoration: underline;
    }

    hr {
        height: 1px;
        border: 0;
        border-bottom: 1px solid black;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }

    abbr[title]:after {
        content: " (" attr(title) ")";
    }

    .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after {
        content: "";
    }

    pre, blockquote {
        border: 1px solid #999;
        padding-right: 1em;
        page-break-inside: avoid;
    }

    tr, img {
        page-break-inside: avoid;
    }

    img {
        max-width: 100% !important;
    }

    @page :left {
        margin: 15mm 20mm 15mm 10mm;
    }

    @page :right {
        margin: 15mm 10mm 15mm 20mm;
    }

    p, h2, h3 {
        orphans: 3;
        widows: 3;
    }

    h2, h3 {
        page-break-after: avoid;
    }
}

.metadata {
    font-size: 0.8em;
}

.tags {
    border-top: solid 1px var(--separator-color);
    font-size: 0.8em;
}

footer {
    margin-top: 50px;
    width: 100%;
    text-align: center;
}

.title-block-header {
    border-bottom: solid 1px var(--separator-color);
}

.navbar {
    display: block;
    padding: 4px;
    background-color: var(--main-bg-color);
    min-height: 3rem;
    line-height: 3rem;
    border-bottom: solid 1px var(--menu-border-color);
    position: fixed;
    width: 100%;
    z-index: 1000;
}

.navbar > .container {
  width: auto;
  max-width: 1200px;
  text-align: center;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}

.navbar a {
    color: var(--header-color);
}

.navbar a:hover {
    color: var(--link-hover-color);
}

.navbar a:active {
    color: var(--link-active-color);
}


.nav-center,
.nav-left,
.nav-right {
    display: flex;
    flex: 1;
    align-items: center;
}

.nav-left {
    justify-content: flex-start;
}

.nav-center {
    justify-content: center;
}

.nav-right {
    justify-content: flex-end;
}

@media screen and (max-width: 480px) {
    .navbar {
        width: auto;
        position: initial;
    }

    .navbar > .container {
        flex-wrap: wrap;
    }

    .nav-left,
    .nav-right {
        flex-basis: calc(100% / 3);
    }

    .nav-center {
        flex-basis: 100%;
        order: 3;
    }
}

.nav-left > *, .nav-right > *, .nav-center > * {
    margin-left: 2px;
    margin-right: 2px;
}

.menu {
    display: flex;
    font-size: 0.90em;
    justify-content: flex-start;
    margin: 0;
    padding: 0;
    list-style: none;
}

ul.menu > li {
    display: flex;
    align-items: flex-start;
    padding: 0 10px;
    border-left: solid 1px var(--separator-color);
}

ul.menu > li:first-child {
    border-left: none;
    padding-left: 0;
}

ul.index > li {
    display: block;
    border-bottom: 1px solid var(--separator-color);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.rss {
    width: 15px;
}

.logo {
    width: 48px;
    height: 32px;
    filter: var(--logo-filter);
}

.github-logo {
    width: 22px;
}

input[type=checkbox] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

input[type=checkbox]:focus {
    outline: 0;
}

#theme-color-switch {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

#theme-color-switch > span {
    font-size: 30px;
    display: inline-block;
    margin-right: 8px;
}

#theme-color-switch svg {
    width: 24px;
    height: 24px;
    margin: 0 4px;
}

#theme-color-switch input[type=checkbox] {
    height: 0;
    width: 0;
    visibility: hidden;
}

#theme-color-switch label {
    cursor: pointer;
    text-indent: -9999px;
    width: 42px;
    height: 21px;
    border-radius: 30px;
    background: var(--menu-border-color);
    /* var(--color-toggle-accent); */
    display: block;
    position: relative;
    margin: 0;
}

#theme-color-switch label:after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 15px;
    height: 15px;
    background: #fff;
    border-radius: 90px;
    transition: 0.3s;
}

#theme-color-switch input:checked + label:after {
    left: calc(100% - 3px);
    transform: translateX(-100%);
}

#theme-color-switch label:active:after {
    width: 30px;
}

/* Toc */
.toc-container {
    position: fixed;
    padding-top: 6rem;
    top: 95px;
    right: 2em;
    width: 15rem;
}

.toc {
    overflow-y:auto
}

.toc > .toc-list {
    overflow:hidden;
    position:relative;
    list-style: none;
}

.toc > .toc-list li {
    list-style:none
}

.toc-list {
    margin:0;
    padding-left:10px
}

a.toc-link {
    color: var(--main-color);
    height:100%
}

.is-collapsible {
    max-height:1000px;
    overflow:hidden;
    transition:all 300ms ease-in-out
}

.is-collapsed {
    max-height:0
}

.is-position-fixed {
    position:fixed !important;
    top:0
}

.is-active-link {
    font-weight:700
}

.toc-link::before {
    background-color:#EEE;
    content:' ';
    display:inline-block;
    height:inherit;
    left:0;
    margin-top:-1px;
    position:absolute;
    width:2px
}

.is-active-link::before{
    background-color: var(--link-color);
}

@media screen and (max-width: 480px) {
    .toc {
        position: initial;
        width: auto;
        padding-top: 0;
    }
}
