/** General CSS **/

html {
}


body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;

    font-family: monospace, monospace;
    font-size: 15px;
    line-height: 1.15;
}

nav {
    position: fixed;
    z-index: 1;
    top: 0;
    left: 0;
    width: 350px;
    height: 100%;
    overflow-x: hidden;
    padding: 0.5em;
    font-size: 0.9rem;
    background: #ddd;
}

main {
    width: auto;
    margin-left: 350px;
    padding: 1em 2em;

    /* never allow text to overflow */
    overflow-wrap: normal;
    overflow-x: hidden;
}


/* on the first level of TOC in the nav, don't make it a list */
nav > ul  {
    list-style: none;
    /* padding-left: 0; */
    padding: 0;
    /* padding: 0.5em; */
    margin: 0;
    display: block;
}


/* and, add an hr divider psuedo-element after each top-level list item */
nav > ul > li::after {
    content: "";
    display: block;
    border-bottom: 1px solid #222;
    margin: 0.5em 0;
}


/* second level, make it use the first-level list style */
nav ul ul {
    list-style: initial;
    padding-left: 1.6em;
    margin: 0;
}


/* color links, but don't underline them */
nav a {
    text-decoration: none;
    color: #0f52aa;
}


dt {
    font-family: monospace;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 0.25em;
}

dd {
    margin-bottom: 1.25em;
    margin-left: 2.0em;
}
/* code {
    line-height: 1.4;
    font-size: 110%;
    background-color: #f0f0f0;
    padding: 0.1em;
} */

pre {
    /* font-size: 1.05em; */
    background-color: #f0f0f0;
    margin: 0.25em 0;
}



.anchor-link {
    margin: 0 0.25em;
    color: #0f52aa;

    /* don't copy the text when copying */
    user-select: none;

    /* don't show by default */
    visibility: hidden;

    /* don't underline the link */
    text-decoration: none;

}

.anchor-link::after {
        
    /* use section symbol */
    content: "§";

}

h1:hover > .anchor-link,
h2:hover > .anchor-link,
h3:hover > .anchor-link,
h4:hover > .anchor-link,
h5:hover > .anchor-link,
dt:hover > .anchor-link {
    /* show when hovering over header */
    visibility: visible;
}

*:hover > .anchor-link {
    /* show when hovering over header */
    visibility: visible;
}


/* on mobile and small screens */
@media screen and (max-width: 768px) {
    main {
        margin-left: 0;
        padding: 1em;
    }
    nav {
        display: none;
    }
}


/*
@media screen and (max-width: 768px) {
    main {
        margin-left: 40vw;
    }
    nav {
        width: 40vw;
    }
}

*/




/* for printing to a physical page, we style it differently */
@media print {
    /* hide the nav, since it will show up on each page */
    nav {
        display: none;
    }

    /* don't need any margin on the main content */
    main {
        margin: 0;
    }

    /* overflow would be hidden, since there is no scrollbar */
    pre {
        white-space: pre-wrap;
    }

    /* and each actual page should have some padding as well */
    @page {
        padding: 1em;
    }
}





/* Highlight.js Line Numbers Styling */

/* for block of numbers */
.hljs-ln-numbers {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;

    text-align: center;
    color: #333;
    border-right: 1px solid #333;
    vertical-align: top;
    /* padding-right: 5px; */

    /* your custom style here */
}

/* for block of code */
.hljs-ln-code {
    padding-left: 5px !important;
}


.hljs-ln td {
    /* padding: 0 !important; */
}


.hljs-ln-n {
    padding-right: 5px !important;
    text-align: right !important;
}


/** Code Highlighting **/

pre code.hljs {
    background-color: transparent !important;
    display: block;
    overflow-x: auto;
    background: white;
    color: #272727;
    padding: 0.5em;
}

.hljs-emphasis {
    font-style: italic;
}
.hljs-strong {
    font-weight: bold;
}

.hljs-comment,
.hljs-quote {
    color: #407e7e;
}

.hljs-meta,
.hljs-link {
    color: #c82829;
}

.hljs-variable,
.hljs-template-variable,
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-regexp,
.hljs-deletion {
    color: #c82829;
}

.hljs-built_in,
.hljs-builtin-name,
.hljs-type,
.hljs-params {
    color: #0048ce;
}

.hljs-attribute {
    color: #eab700;
}

.hljs-number,
.hljs-literal {
    color: #1f85ce;
}

.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
    color: #3e9616;
}

.hljs-title,
.hljs-section {
    color: #108e97;
}

.hljs-keyword,
.hljs-selector-tag {
    color: #7d1cec;
}
