:root {
    --content-width: 50rem;
    --menu-width: 15rem;
    --content-padding: 1rem;
    --padding: 1rem;

    --red: #a60000;
    --orange: #ff8800;
    --green: #006300;

    --background: lavender;
    --sub-background: rgba(255, 255, 255, 0.5);
}

body {
    margin: 0;
    width: 100%;
    background: var(--background);
    line-height: 1.4;
    font-family: sans-serif;
}

#preamble, #content, #postamble {
    max-width: var(--content-width);
    padding: var(--padding);
    z-index: 1;
}
#postamble {
    background: var(--sub-background);
    font-size: .75rem;
    text-align: center;
}
#postamble .logo img {
    width: 2rem;
    margin: 0 0 1rem 0;
}
#content {
    position: relative;
    padding: var(--content-padding);
    background: white;
    box-shadow: 0 0 var(--padding) #ddd;
    z-index: 2;
    overflow-x: hidden;
}
#content:after {
    content: "EOF";
    font-size: .75em;
    color: rgba(0,0,0,.25);
    display: block;
    text-align: center;
    position: absolute;
    bottom: .5rem;
    left: 0;
    right: 0;
}
div#content > div:after {
    clear: both;
    display: block;
    content: '';
}
p, li, dl, figure, table {
    margin-top: 0;
    margin-bottom: 1em;
}



/* headings */

h1.title {
    margin: 0 0 .5em 0;
    line-height: 1;
}

.subtitle {
    font-style: italic;
}


h2, h3, h4, h5 {
    margin: 1.5em 0 .5em 0;
    border-bottom: solid #ddd 1px;
    padding-bottom: 4px;
    clear: both;
}

.todo { background: var(--red); color: white; }
.busy { color: var(--orange); }
.done { color: var(--green); }

.org-left { text-align: left; }
.org-right { text-align: right; }
.org-center { text-align: center; }
.underline { text-decoration: underline; }





/* images */

figure { margin: 0; padding: 1.5rem; }
figure img { box-shadow: 0 0 var(--padding) #ddd; }
img { max-width: 100%; }
figure:has(img.align-right) {
    width: 50%;
    float: right;
    margin: var(--padding) 0 var(--padding) var(--padding);
}
figure { text-align: center; }
figure img { display: inline-block; }
figcaption { text-align: center; }



/* lists */

ul, ol {
    list-style-position: outside;
    padding: 0;
    margin: 0 0 0 1em;
}

li > ul {
    margin-top: 1em;
}

li > div {
    margin-top: .5em;
}

dt {
    font-weight: bold;
    margin-top: .5rem;
}
dt:first-child {
    margin-top: 0;
}




/* links */

a:link {
    color: #000000;
    text-decoration: underline;
}

a:visited {
    color: #444444;
}



/* tables */

table {
    border-collapse: collapse;
    width: 100%;
    caption-side: bottom;
}
table.align-right {
    width: 50%;
    float: right;
    margin: var(--padding) 0 var(--padding) var(--padding);
}
td, th {
    border: solid black 1px;
    padding: .25em 0.5em;
    vertical-align:top;
}
thead {
    background: #e0e0e0;
}
tbody tr:nth-child(even) {
    background: #f8f8f8;
}
thead, tbody {
    border-bottom: solid black 2px;
}
thead:last-child, tbody:last-child {
    border-bottom: none;
}




/* code blocks */

pre {
    font-size: .8rem;
    overflow: auto;
    padding: .25em .5em;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    font-family: monospace;
}

/* navigation */

#preamble nav ul {
    padding: 0;
    line-height: 1.8;
    margin-left: 0;
}
#preamble nav ul ul {
    padding-left: 1rem;
}
#preamble nav li {
    list-style: circle inside;
    font-style: italic;
    padding: .25em .75em;
    margin-bottom: .5em;
    background: var(--sub-background);
}
#preamble nav a:link {
    text-decoration: none;
    color: black;
    display: inline-block;
    padding: 0 .25rem;
    width: calc(100% - 2rem);
}
#preamble nav a:visited {
    color: black;
}

#preamble nav .current {
    list-style: disc inside;
    background: white;
}
#preamble nav .current a {
    font-weight: bold;
}



@media (min-width: 82rem) { /* big screen */
    :root {
        --content-padding: 3rem;
    }

    #preamble nav ul {
        margin-top: 0;
    }
    #preamble nav li {
        border-top-left-radius: .75em;
        border-bottom-left-radius: .75em;
    }

    body {
        display: grid;
        grid-template-areas: ". preamble content postamble .";
        grid-template-columns: 1fr var(--menu-width) var(--content-width) var(--menu-width) 1fr;
    }
    #preamble {
        grid-area: preamble;
        padding-right: 0;
        padding-bottom: calc(var(--padding) + 1rem);
    }
    #content {
        grid-area: content;
        border-radius: 0 0 calc(var(--padding) / 2) calc(var(--padding) / 2);
        margin-bottom: var(--padding);
    }
    #postamble {
        grid-area: postamble;
        background: none;
        padding: 0;
    }
    #postamble > div {
        padding: var(--padding);
        margin-top: var(--padding);
        margin-bottom: calc(var(--padding) * 2);
        border-top-right-radius: .75em;
        border-bottom-right-radius: .75em;
        background: var(--sub-background);
    }
    #preamble, #content, #postamble {
        display: inline-block;
        vertical-align: top;
    }
}
