:root {
  --fg:  #dddddd;
  --fg2: #bbbbbb;
  --bg:  #222222;
  --bg2: #333333;
  --hi-gray:   #7f7f7f;
  --hi-purple: #af5fff;
  --hi-green:  #43f343;
  --hi-red:    #d7005f;
  --hi-blue:   #5c5cff;
}

html {
    background-color: var(--bg);
    color: var(--fg);
    font-size: 12pt;
    font-family: sans-serif;
    text-align: justify;
}

body {
    margin: 1rem;
}

header h1 {
    text-align: center;
    margin-bottom: 1rem;
    font-family: monospace;
}

footer {
    text-align: center;
}

main {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
}

article {
    max-width: 50rem;
}

p {
    text-indent: 1rem;
}

.footnotes p, blockquote p {
    text-indent: 0;
}



hr {
    color: var(--bg2);
}

a {
    color: var(--hi-blue);
}

a:visited {
    color: var(--hi-purple);
}

a.no-decoration {
    color: inherit;
    text-decoration: none;
}

section {
    margin-bottom: 3rem;
}

.header-section-number {
    display: none;
}

.header-section-number::after,
.toc-section-number::after {
    content: '.';
}

h1 {
    margin: 0;
    font-size: 2rem;
    font-family: serif;
}

h1 .header-section-number {
    display: inline;
}

h2 {
    font-size: 1.2rem;
    padding-left: 1em;
}

.title {

}

table {
    margin: auto;
    border-collapse: collapse;
}

th, td {
    border: solid var(--bg2) 1px;
    padding: 0.5rem;
}

thead {
    background-color: var(--bg2);
}


blockquote {
    border-left: solid var(--bg2) 0.5rem;
    border-radius: 0.25rem;
    margin: 1rem 0;
    padding: 0 1rem;
}

.date, figcaption, blockquote {
    color: var(--fg2);
    font-style: italic;
}

.date {
    margin: 0;
}

img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    margin: auto;
    display: block;
    padding: 1rem 0;
}

.box, pre.sourceCode {
    border-radius: 0.5rem;
    background-color: var(--bg2);
    margin-bottom: 1rem;
    padding: 1rem;
    overflow: scroll;
}

code:not(.sourceCode) {
    background-color: var(--bg2);
    padding: 0 0.2rem;
    border-radius: 0.2rem;
}

.prevent-float {
    width: 100%;
}

pre.prevent-float {
    width: calc(100% - 2rem);
}

figure {
    margin: 0;
}

figcaption {
    text-align: center;
    margin-bottom: 0.5rem;
}

/* Pandoc implicit figures are weird, float class is added to the img inside
the figure but not the figure, and with an empty alt is doesn't make a figure
but just the img. */
@media(min-width:50rem) {
    figure:has(.float), .float {
        float: right;
        max-width: 20rem;
        margin: 1rem 0 1rem 1rem;
    }
}

.toc {
    position: sticky;
    top: 1rem;
    margin-left: 2rem;
    width: 20rem;
    order: 1;
}

@media(max-width:70rem) {
    .toc {
        display: none;
    }
}

.toc h2 {
    margin: 0;
    padding: 0;
}

.toc ul {
    padding-left: 1rem;
}

.toc li {
    color: var(--fg2);
}

.toc a {
    color: inherit;
    text-decoration: none;
}

.toc ul {
    list-style-type: none;
}


.dt                     { color: var(--hi-blue); }
.pp, .cf, .kw           { color: var(--hi-red); }
.st, .im                { color: var(--hi-green); }
.dv, .bn, .fl, .sc, .ch { color: var(--hi-purple); }
.co                     { color: var(--hi-gray); }

.pp, .cf, .kw, .dt      { font-weight: bold; }
.co                     { font-style: italic; }
.er                     { background-color: var(--hi-red); }
