:root {
  font-family: Inter, sans-serif;
  font-feature-settings: 'liga' 1, 'calt' 1; /* fix for Chrome */
}
@supports (font-variation-settings: normal) {
  :root { font-family: InterVariable, sans-serif; }
}

/* colors */
@media (prefers-color-scheme: light) {
    :root {
	/* --content-title: rgb(0, 32, 64); */
	--content-primary: rgb(36, 36, 36);
	--content-secondary: rgb(117, 117, 117);
	--background: rgb(255, 255, 255);
	--code-background: rgb(249, 249, 249);
	--code-border: rgb(229, 229, 229);
    }
}
@media (prefers-color-scheme: dark) {
    :root {
	/* --content-title: rgb(20, 147, 251); */
	--content-primary: rgb(218, 218, 218);
	--content-secondary: rgb(140, 140, 140);
	--background: rgb(20, 20, 20);
	--code-background: rgb(30, 30, 30);
	--code-border: rgb(50, 50, 50);
    }
}

/* styles */

html {
    scroll-behavior: smooth;
    /* font-size: 75%; */
    font-size: 110%;
}

body {
    font-family: var(--font-body);
    font-weight: var(--body-font-weight);
    margin: auto;
    max-width: var(--main-width);
    padding-left: var(--main-padding);
    padding-right: var(--main-padding);
    color: var(--content-primary);
    background: var(--background);
}

.content {
    min-height: var(--content-height) !important;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

/* General styles */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--heading-font-weight);
}

h1 {
    margin-top: var(--h1-margin-top);
    margin-bottom: var(--h1-margin-bottom);
    font-size: var(--h1-font-size);
    font-weight: var(--h1-font-weight);
}

h2 {
    margin-top: var(--h2-margin-top);
    margin-bottom: var(--h2-margin-bottom);
    font-size: var(--h2-font-size);
    font-weight: var(--h2-font-weight);
}

h3{
    font-size: var(--h3-font-size);
    font-weight: var(--h3-font-weight);
    margin-top: var(--hx-margin-top)
}

h4 {
    font-size: var(--h4-font-size);
    font-weight: var(--h4-font-weight);
}

h5,
h6 {
    font-size: var(--hx-font-size);
    font-weight: var(--hx-font-weight);
}

h3, h4, h5, h6 {
    margin-top: var(--hx-margin-top);
}


p {
    margin-top: var(--p-margin-top);
    margin-bottom: var(--p-margin-bottom);
    font-size: var(--p-font-size);
    font-weight: var(--p-font-weight);
    line-height: var(--p-line-height);
}

a {
    text-decoration: underline;
    color: var(--content-primary);
}

li {
    margin-left: var(--li-indent);

    &:has(> input[type="checkbox"]) {
	list-style-type: none;
    }

    &>input[type="checkbox"] {
	width: var(--li-checkbox-size);
	height: var(--li-checkbox-size);
	margin: 0 0.2em 0.15em -1.25em;
	vertical-align: middle;
    }
    font-weight: var(--li-font-weight);
}

ol > li {
    padding-bottom: 0.5rem;
}


.todo {
    font-family: var(--font-mono);
    color: green;
    float: right;
}

.done {
    font-family: var(--font-mono);
    font-weight: 700;
    color: red;
    float: right;
}

#table-of-contents {

    margin-bottom: 2rem;

    h2 {
	margin-bottom: 0;
	font-size: 1.3rem;
    }

    ul {
	list-style-type: none;
	padding-bottom: inherit;
	padding-left: 20px;
	margin-top: 0;
	font-size: 0.9rem;
    }

    li {
	padding-bottom: inherit;
    }
}

hr {
    border: none;
    height: 1px;
    background: var(--content-secondary);
    margin-top: 2rem;
    margin-bottom: 2rem;
}

figure {
    aspect-ratio: var(--w) / var(--h);
    max-height: var(--figure-img-max-height);
    width: auto;
    margin-inline: auto;
    /* border-radius: 6px; */

    img {
	display: block;
	max-width: 100%;
	height: auto;
	/* border-radius: 6px; */
    }
}

figcaption {
    color: var(--content-secondary);
    padding-left: var(--caption-padding);
    padding-right: var(--caption-padding);
    font-size: var(--caption-font-size);
    font-style: italic;
    margin-top: 1rem;
    /* margin-bottom: 1rem; */
    line-height: 1rem;
}

.figure-number {
    display: none;
}

/* floating images in text? */
.right {
    float: right;
    max-width: 250px;
    padding-right: -25px;
    padding-left: 25px;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.left {
    float: left;
    max-width: 250px;
    padding-left: -20px;
    padding-right: 20px;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

blockquote {
    margin: 1.5rem;
    margin-left: 0;
    margin-right: 0;
    border-left: 2px solid;
    color: var(--content-secondary);
}

blockquote p {
    margin-left: 1rem;
    margin-right: 1rem;
}

.info {
    margin-top: 1.5rem;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 2rem;
    border-left: 2px solid var(--content-primary);
    padding-left: 6px;
    font-style: italic;
    color: var(--content-secondary);
}

#footnotes {
    font-size: 0.9rem;
    margin-top: 3rem;
    border-style: none;
    border-top: 1px solid var(--content-secondary);
}

#footnotes > h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
}

.footnotes > ol > li {
    padding-bottom: 0px;
}

.footpara {
    display: inline;
    margin: 4px;
}

table {
    border-collapse: collapse;
    margin-top: var(--table-margin-top);
    margin-bottom: var(--table-margin-bottom);
    font-size: var(--p-font-size);
    line-height: var(--p-line-height);
    color: var(--content-primary);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--code-border);
    border-radius: var(--code-border-radius);
}

th,
td {
    padding: var(--table-cell-padding);
    text-align: left;
}

th {
    background-color: var(--code-background);
    /* font-weight: bold; */
}

tbody tr {
    border-top: 1px solid var(--code-border);
}

.contact {
    border-collapse: collapse;
    border-radius: 0;
    align: left;

    thead {
	display: none;
    }
    td, th {
	border: 1px solid var(--content-secondary);
	padding: 0.5rem;
    }
    .table-number {
	display: none;
    }
}

/* header */
header {
    /* padding-top: var(--header-top-gap); */
    margin-bottom: var(--header-bottom-gap);
    /* border-bottom: 1px solid var(--content-secondary); */
}

.title {
    /* color: var(--content-title); */
    font-size: 2.0em;
    font-weight: 400;
}

.article-meta {
    margin-top: -1rem;
    margin-bottom: -1.5rem;

    time {
	/* font-family: var(--font-mono); */
	color: var(--content-secondary);
    }
}

/* index/homepage */

.banner {
    margin-top: -1rem;
    /* margin-bottom: 2rem; */
}

nav > ul {
    font-family: var(--font-mono);
    list-style-type: none;
    margin-right: var(--header-menu-side-gap);
    display: flex;
    flex-direction: row;
    padding-right: 0px;
    padding-left: 0px;
}

nav > ul li {
    margin-right: var(--header-menu-side-gap);
    margin-left: 0px;
}

.blog-entries > ul {
    list-style-type: none;
    padding-left: 0px;
}

.blog-entries {

    .datetime {
	font-size: 0.8rem;
	font-family: var(--font-mono);
	min-width: 130px;
	max-width: 130px;
	text-align: right;
	padding-right: 1rem;
	margin-top: 0rem;
	margin-bottom: 0rem;
    }
}

.blog-entries > .org-ul > li {
    display: flex;
    align-items: baseline;
    margin-bottom: 8px;
    margin-left: 0px;
}

/* Code blocks */

.copy-code-button {
    background-color: var(--background);
    font-family: var(--font-mono);
    padding: 3px 6px;
    font-size: 0.8em;
    border-radius: var(--copy-code-button-border-radius);
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    display: none;
    border: 1px solid var(--code-border);
}

pre:hover .copy-code-button {
    display: block;
}

pre {
    position: relative;
    padding: var(--code-padding);
    padding-top: 2rem;
    border: 1px solid var(--code-border);
    overflow: scroll;
    border-radius: var(--code-border-radius);
    margin-top: var(--code-margin-top);
    margin-bottom: var(--code-margin-bottom);
    background-color: var(--code-background) !important;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    line-height: 1.3em;
    font-family: var(--font-mono);
    font-size: .85rem;
}

/* display language on hover */
pre.src {
    position: relative;
    overflow: auto;
}
pre.src:before {
    font-size: 0.8em;
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 6px;
    color: var(--content-primary);
    background-color: var(--code-background);
}

pre.src:hover:before { display: inline;}
pre.src-C:before { content: 'C'; }
pre.src-clojure:before { content: 'Clojure'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-sh:before { content: 'Shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-xml:before { content: 'XML'; }
pre.src-conf:before { content: 'Conf'; }
pre.src-html:before { content: 'HTML'; }
pre.src-html+:before { content: 'HTML+'; }
pre.src-R:before { content: 'R'; }
pre.src-rust:before { content: 'Rust'; }
pre.src-yaml:before { content: 'Yaml'; }

pre::-webkit-scrollbar {
    display: none;
}

code span {
    display: inline !important;
}

code {
    -webkit-font-smoothing: antialiased;
    -moz-font-feature-settings: "liga=1, dlig=1";
    -ms-font-feature-settings: "liga", "dlig";
    -webkit-font-feature-settings: "liga", "dlig";
    -o-font-feature-settings: "liga", "dlig";
    font-feature-settings: "liga", "dlig";
    font-variant-ligatures: contextual;
    font-family: var(--font-mono);
    font-size: .9em;
}

li code,
table code,
p code {
    background-color: var(--code-background);
    border-radius: 3px;
    padding: 2px;
}

/* footer */

.comments {
    font-family: var(--font-body);
    font-size: inherit;
    /* font-style: italic; */
    color: var(--content-secondary);
    margin-bottom: 3rem;
}

.bottom {
    font-size: 0.8rem;
    font-family: var(--font-mono);
    border-top: 1px solid var(--content-secondary);
    margin-top: 3rem;
    /* text-align: center; */
    color: var(--content-secondary);
}

#org-div-home-and-up {
    display: none;
}
