:root {
    --universal-margin: 0.5em;
    --universal-padding: 0.5em;
    --universal-border-radius: 0.2em;
    --a-link-color: blue;
    --a-visited-color: #551A8B;
}

a:link { color: #0000EE; }
a:visited { color: #551A8B; }
a:visited:hover { color: blue; }

html {
    font-family: sans-serif;
}

body {
    background: #f0f0f0;
}

article,
#footnotes,
#content > :not(article):not(#table-of-contents) {
    max-width: 40em;
    margin: var(--universal-padding);
    padding: calc(var(--universal-padding) * 2);
    background: #fefefe;
    box-shadow: 0 1px 0px rgba(0,0,0,.1);
    position: relative;
    border-radius: var(--universal-border-radius);
    border: 1px solid #cfcfcf;
}

article p {
  word-break: break-word;
  hyphens: auto;
}

.footdef {
    margin-bottom: 0;
}

article h2 {
    margin-top: 0;
    text-transform: uppercase;
    font-size: 1.2em;
}

.navbar {
    display: flex;
    flex-direction: row;
    border: 0;
    position: relative;
    z-index: 999;
    font-size: 0.9em;
}

.navbar a {
    text-transform: none;
    background: #fefefe;
    border: 1px solid rgba(0,0,0,.25);
    box-shadow: 0 2px 0px rgba(0,0,0,.1);
    border-radius: var(--universal-border-radius);
    text-decoration: underline;
    padding: 4px 2.5em;
    margin-right: 6px;
    flex-shrink: 0;
    font-weight: 600;
    text-transform: uppercase;
}

#preamble {
    max-width: 42em;
    margin: var(--universal-margin);
}

#postamble {
    margin: var(--universal-margin);
    max-width: 50.5em;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    font-size: 10pt;
}

#postamble p {
    margin-top: 0;
}

#postamble ul {
    display: flex;
    list-style: inside;
    margin: 0;
    padding-left: 0;
}

@media only screen and (max-width: 500px) {
    #postamble ul {
	flex-direction: column;
    }

    #postamble ul li:first-child {
	list-style: inside !important;
    }
}

#postamble ul li {
    margin: 0 0.5em;
}

#postamble ul li:first-child {
    list-style: none;
}

#meta p {
    text-align: right;
}

@media screen and (max-width: 120ch) {
    #table-of-contents {
        display: none !important;
    }
}

#table-of-contents {
    display: block;
    z-index: 1050;
    position: fixed;
    left: 45em;
    background: #fefefe;
    box-shadow: 0 1px 0px rgba(0,0,0,.1);
    border-radius: var(--universal-border-radius);
    border: 1px solid #cfcfcf;
    max-height: calc(100% - 3 * (var(--universal-margin) + 0.5em) - 5em);
    max-width: 45m;
    padding-right: 1em;
}

#table-of-contents * {
    padding: none;
}

#table-of-contents a:visited {
    color: blue;
}

#table-of-contents h2 {
    font-size: 12pt;
    margin: var(--universal-margin);
    margin-top: calc(2 * var(--universal-margin));
    font-weight: 400;
    padding: .05em .5em;
}

#text-table-of-contents ul li {
    font-size: 11pt;
    width: 100%;
}

.licenses {
    text-align: center;
    margin-top: 0.3em !important;
}

.licenses a:not(:first-child) {
    margin-left: 0.5em;
}

nav * {
    padding: 0.1em 0;
}

.abstract {
    background: var(--nav-hover-back-color);
    border-radius: 0.05em;
    margin: 0 -1em;
    padding: 0.25em 1em;
}

pre {
    border: 1px solid #ccc;
    box-shadow: none;
    padding: 8pt;
    overflow: auto;
    margin: var(--universal-margin);
    border-radius: var(--universal-border-radius);
}

.figure {
    text-align: center;
}

.org-svg {
    width: auto;
    max-width: 100%;
}

.asciicast {
    text-align: center;
}

img {
    max-width: 100%;
    border-radius: var(--universal-border-radius);
    box-shadow: 0 2px 1px rgba (0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.2);
}

video {
    max-width: 100%;
    max-height: 40em;
    display: block;
    margin: 0 auto;
}

#content {
    margin: 0 !important;
}

audio {
    display: block;
    width: calc(100% - var(--universal-padding) * 2);
    margin: 0 var(--universal-padding);
}

table tr td:nth-child(1) {
    width: 20%;
}

a {
    text-decoration: underline;
}

a:hover {
    background: #ddd;
    box-shadow: 2px 2px 0px;
}

a:active {
    color: purple;
    background: #ccc;
}

.abstract {
    background: rgba(0,0,0,.1);
}

/* Org-mode */
.done {color: green;}
.todo {color: red;}

dt {
    font-weight: bold;
}

dt::before {
    content: "• ";
}

.org-dl dd, article p {
    margin-top: var(--universal-margin);
    margin-bottom: var(--universal-margin);
}

sup::before { content: "[" }
sup::after  { content: "]" }
.footpara   { display: inline }
