@font-face {
    font-family: "Latin Modern Roman";
    font-style: normal;
    font-weight: 400;
    src: url("fonts/CMUSerif-Roman.woff2") format("woff2");
}
@font-face {
    font-family: "Latin Modern Roman";
    font-style: italic;
    font-weight: 400;
    src: url("fonts/CMUSerif-Italic.woff2") format("woff2");
}
@font-face {
    font-family: "Latin Modern Roman";
    font-style: normal;
    font-weight: 700;
    src: url("fonts/CMUSerif-Bold.woff2") format("woff2");
}

:root {
    --page-margin: 2.54cm;
    --text-width: 16cm;
}

@media screen and (max-width: 640px) {
    :root {
        --page-margin: 5vw;
    }
}

* { box-sizing: border-box; }

html {
    font-size: 16pt;
    background: #fff;
}

body {
    font-family: "Latin Modern Roman", "Computer Modern Serif", "Times New Roman", Times, serif;
    line-height: 1.15;
    color: #000;
    max-width: calc(var(--text-width) + 2 * var(--page-margin));
    margin: 0 auto;
    padding: var(--page-margin);
    text-align: justify;
    hyphens: auto;
}

article > :first-child { margin-top: 0; }

p {
    margin: 0 0 0.35em;
    text-indent: 1.5em;
}

article > p:first-of-type,
h1 + p, h2 + p, h3 + p, h4 + p,
li p, blockquote p, hr + p {
    text-indent: 0;
}

h1, h2, h3, h4 {
    font-weight: bold;
    text-align: left;
    text-indent: 0;
    page-break-after: avoid;
}

h1 {
    font-size: 1.4em;
    text-align: center;
    margin: 0 0 1.2em;
}

h2 { font-size: 1.2em; margin: 1.4em 0 0.6em; }
h3 { font-size: 1.05em; margin: 1.2em 0 0.5em; }
h4 { font-size: 1em; margin: 1em 0 0.4em; font-style: italic; }

a { color: #000; text-decoration: underline; }
a:visited { color: #666; text-decoration: underline; }

strong, b { font-weight: bold; }
em, i { font-style: italic; }

blockquote {
    margin: 0.8em 2em;
    padding: 0;
    font-size: 0.95em;
}

blockquote p { text-indent: 0; }

ul, ol {
    margin: 0.5em 0 0.8em;
    padding-left: 2em;
}

li { margin: 0.2em 0; }

hr {
    border: none;
    border-top: 0.4pt solid #000;
    margin: 1.5em 0;
}

code {
    font-family: "Latin Modern Mono", "Courier New", monospace;
    font-size: 0.92em;
}

pre {
    font-family: "Latin Modern Mono", "Courier New", monospace;
    font-size: 0.85em;
    margin: 0.8em 0;
    padding: 0.6em 0.8em;
    overflow-x: auto;
    border: 0.4pt solid #ccc;
}

pre code { font-size: inherit; }

table {
    border-collapse: collapse;
    margin: 0.8em auto;
    font-size: 0.95em;
}

th, td {
    border: 0.4pt solid #000;
    padding: 0.25em 0.5em;
}

nav.back {
    font-size: 0.9em;
    margin-bottom: 2em;
    text-align: left;
    text-indent: 0;
}

nav.back a { text-decoration: none; }
nav.back a:hover { text-decoration: underline; }

article footer {
    margin-top: 2em;
    padding-top: 1em;
    border-top: 0.4pt solid #000;
    font-size: 0.85em;
    text-align: left;
}

article footer > :first-child { margin-top: 0; }

article footer h2 {
    font-size: 1.05em;
    margin: 1em 0 0.4em;
}

article footer p,
article footer li {
    text-indent: 0;
}

article ul li { text-indent: 0; }

ul.index li.article {
    margin: 0.5em 0 0.8em;
}

ul.index li.article .pubdate {
    display: block;
    font-size: 0.75em;
    color: #666;
    margin-top: 0.15em;
}
