/* The presence of this file overrides Pandoc's default CSS in the default HTML template */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Serif:ital,wght@0,400;0,700;1,400;1,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Exo+2:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inconsolata&display=swap');

:root {
    --solarized-base03: #002b36;
    --solarized-base02: #073642;
    --solarized-base01: #586e75;
    --solarized-base00: #657b83;
    --solarized-base0: #839496;
    --solarized-base1: #93a1a1;
    --solarized-base2: #eee8d5;
    --solarized-base3: #fdf6e3;
    --solarized-yellow: #b58900;
    --solarized-orange: #cb4b16;
    --solarized-red: #dc322f;
    --solarized-magenta: #d33682;
    --solarized-violet: #6c71c4;
    --solarized-blue: #268bd2;
    --solarized-cyan: #2aa198;
    --solarized-green: #859900;

    /* Font scale
    0.875 rem 14 px captions and notes
    1     rem 16 px body
    1.25  rem 20 px heading 2
    1.375 rem 22 px heading 1
    2     rem 32 px title */
    --fs-note: 0.875rem;
    --fs-body: 1rem;
    --fs-h2: 1.25rem;
    --fs-h1: 1.375rem;
    --fs-title: 2rem;

    /* Figuring out a good width for the type block: I’d like to display lines of 100 monospaced
    characters within the type block, and testing shows that Iosevka, Inconsolata, and IBM Plex Mono
    start to look pretty bad on screen at sizes below 14px. It turns out that Iosevka and
    Inconsolata have exactly the same sizes, and that the width of a character is half the font size
    — so at 14px, the characters are 7px wide, meaning we need a type block of 700px. Assuming 1rem
    = 16px, a type block of 44rem gives us 704px. */

    /* Page layout: The main column, a gutter, and the marginal column */
    --pg-main: 44rem;
    --pg-gutter: 2rem;
    --pg-margin: 22rem;
}

body {
    margin: 0 auto 0 auto;
    background-color: var(--solarized-base3);
    color: var(--solarized-base03);
    width: var(--pg-main);
    padding: 0 calc(var(--pg-gutter) + var(--pg-margin)) 0 0;
    position: relative;
    font-family: 'IBM Plex Serif', serif;
    line-height: 1.5;
}

/* Title blocks */
header>h1 {
    font-size: var(--fs-title);
    font-style: normal;
    font-weight: bold;
    font-variant: small-caps;
}

header>.subtitle {
    font-size: var(--fs-body);
    font-style: italic;
    font-weight: bold;
    text-indent: 2rem;
}

header>p.date {
    text-align: right;
    font-family: 'Exo 2', sans-serif;
    font-style: italic;
    font-size: var(--fs-note);
}

/* Sections */
h1 {
    font-size: var(--fs-h1);
    font-style: italic;
    font-weight: bold;
}

h2 {
    font-size: var(--fs-h2);
    font-style: italic;
    font-weight: normal;
}

/* Full width content */
.fullwidth,
header,
footer {
    width: calc(var(--pg-main) + var(--pg-gutter) + var(--pg-margin));
}

/* Marginal content */
aside,
span.aside {
    display: block;
    float: right;
    clear: both;
    /* position: relative; */
    width: var(--pg-margin);
    margin: 0 calc(-1 * var(--pg-gutter) - var(--pg-margin)) 1rem 0;
    padding: 0 0 0 calc(var(--pg-gutter) / 2);
    border-left: thin solid var(--solarized-base0);
    line-height: 1.25;
    font-family: 'Exo 2', sans-serif;
    font-size: var(--fs-note);
    font-weight: 300;
}

/* This just does not work well */
/* Shift the box up by its height, plus one additional line */
/* aside {
    transform: translateY(calc(-100% - 1em));
} */

aside>*:first-child,
span.aside>*:first-child {
    margin-top: 0;
    margin-bottom: 0;
}

aside>*:last-child,
span.aside>*:last-child {
    margin-bottom: 0;
}

/* General typography */
a {
    color: var(--solarized-orange);
    text-decoration-line: none;
    text-decoration-style: none;
    border-radius: 4px;
    transition: background-color 0.25s ease-in-out 0s;
}

a:visited {
    color: var(--solarized-orange);
}

a:hover {
    background-color: var(--solarized-base2);
}

a:active {
    background-color: var(--solarized-base1);
}

/* Except, note links should not be colorful */
a.footnote-ref,
a.footnote-back {
    color: inherit;
    background-color: none;
}

/* These are phrasing content; don’t adjust sizes or spacing */
tt,
code,
kbd,
samp,
pre {
    font-family: 'Inconsolata', monospace;
}

pre {
    font-size: var(--fs-note);
    line-height: 1.2;
    /* Add a hanging decoration next to code blocks to help set them off visually */
    border-left-color: var(--solarized-base2);
    border-left-width: 1rem;
    border-left-style: solid;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    padding-left: 1rem;
    margin-left: calc(-1rem - 1rem);
}

div.output>pre {
    /* Override the border color for Jupyter output cells */
    border-left-color: var(--solarized-base0);
}

div.epigraph,
div.summary {
    font-style: italic;
}

table {
    /* Center tables by default */
    margin-left: auto;
    margin-right: auto;
    /* Add space between columns. I *think* the default value here is 0; normal keywords like
    `inherit` or `100%` don't work. */
    border-spacing: 1em 0;
    /* This came from Pandoc's default CSS; not sure what it does */
    font-variant-numeric: lining-nums tabular-nums;
}

img {
    /* Prevent images from spilling outside their parent by default */
    max-width: 100%;
}

/* The master calendar at /log */
table.masterlog {
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    font-family: "Exo 2", sans-serif;
    font-size: 10px;
}

.masterlog th.col_heading.level0 {
    text-align: center;
}

.masterlog th.row_heading.level0 {
    rotate: -90deg;
}

.masterlog td {
    text-align: right;
    padding-right: 0.25em;
    padding-left: 0.25em;
    min-width: 1.5em;
    height: 1.2em;
}

/* tr:nth-of-type(7n) > th, tr:nth-of-type(7n) > td {{ border-bottom: 12px solid transparent; }} */
.masterlog tr:nth-of-type(7n-1) {
    background-color: var(--solarized-base2);
}

.masterlog tr:nth-of-type(7n) {
    background-color: var(--solarized-base2);
}

.masterlog tr:nth-of-type(7n)>th,
.masterlog tr:nth-of-type(7n)>td {
    border-bottom: thin solid black;
}

.masterlog td.month-change-left {
    border-left: thin solid var(--solarized-base1);
}

.masterlog td.month-change-above {
    border-top: thin solid var(--solarized-base1);
    border-left: thin solid var(--solarized-base1);
}



/* Bibliographies */
div#refs {
    font-family: "Exo 2", sans-serif;
    font-size: var(--fs-note);
    color: var(--solarized-base01);
}

/* The rest copied from https://github.com/jgm/pandoc-templates/blob/master/styles.html */
div.hanging-indent {
    margin-left: 1.5em;
    text-indent: -1.5em;
}

/* div.csl-bib-body { } */
div.csl-entry {
    clear: both;
    margin-bottom: 1em;
}

.hanging div.csl-entry {
    margin-left: 2em;
    text-indent: -2em;
}

div.csl-left-margin {
    min-width: 2em;
    float: left;
}

div.csl-right-inline {
    margin-left: 2em;
    padding-left: 1em;
}

div.csl-indent {
    margin-left: 2em;
}