/* reset */

*, *::before, *::after {
    box-sizing: border-box;
}


/* main layout */

html {
    scrollbar-gutter: stable;

}

body {
    max-width: 720px;
    display: flex;
    flex-direction: column;
    margin: 0px auto 0 auto;
    padding: 10px 20px;
    min-height: calc(100dvh);
    font-size: 17px;
    font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, Adwaita Sans, Cantarell, Ubuntu, roboto, noto, helvetica, arial, sans-serif;
}

body > nav {
    margin-bottom: 30px;
}

body > nav:first-child {
    /* lang selector layout */
    display: flex;
    justify-content: space-between;
}
.lang-current {
    text-decoration: underline;
    text-transform: uppercase;
}

body > main {
    margin-bottom: 50px;
}

body > footer {
    margin-top: auto;
    padding: 10px 0;
    border-top: 1px solid black;
}


/* index */

ul.index {
    padding-left: 0;
    padding-top: 1.5lh;
    border-top: 1px solid black;
}

ul.index li {
    display: flex;
    align-items: baseline;
    gap: 1em;
    margin: 0.5lh 0;
}

ul.index li span {
    flex-grow: 1;

}

@media(max-width: 520px) {
    ul.index li {
        flex-direction: column;
        gap: 0;
    }
}

ul.index li.draft .title a {
    color: red !important;
}

ul.index li time {
    white-space: nowrap;
    font-size: smaller;
}
ul.index span.subtitle {
    display: block;
    font-style: italic;
}

ul.index time {
    font-family: monospace;
}


/* tables */

table td {
    padding: 0 10px;
}

table thead td:not(.blank) {
    background-color: lightgray;
}

table.centered {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}


/* article */

@media(min-width: 520px) {
    article > *:has(code) {
        overflow-x: visible;
    }
}
article > * {
    overflow-x: auto;
}

article pre, article pre code {
    font-size: 15px
}

article table {
    margin: 2em 0;
}

article > h1 {
    font-size: 1.3em;
}
article > h2 {
    font-size: 1.1em;
}


/* article header */

article > header > section:has(time) {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.3lh;
    border-bottom: 1px solid black;
    margin-bottom: 1lh;
    padding-bottom: 0.5lh;
}

article > header:has(h2) {
    border-bottom: 1px solid black;
    margin-bottom: 1lh;
}

article > header > h1 {
    font-size: 2em;
    margin-bottom: 0;
}

article > header > h2 {
    font-size: 1.2em;
    font-weight: normal;
}


/* other */

.tags {
    font-size: 16px;
}

time {
    color: grey;
}

a {
    text-decoration: none;
    word-wrap: break-word;
}
a.out:after {
    content: "↗";
}

article a, article a:visited {
    text-decoration: revert;
}

article header a, article header a:visited {
    text-decoration: none;
}


section.comments {
    border-top: 1px solid black;
    padding: 1lh 1em 0.5lh 1em;
    margin-top: 2lh;
    background-color: hsl(0, 0%, 95%);
}

section.comments ul {
    list-style: revert;
}

footer ul.nav {
    margin: 0 0 0.5lh 0;
    padding: 0;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 1em;
}

code {
    /* prevent inlined code wrapping on non white space chars */
    white-space: pre-wrap;
}

pre code {
    /* cancel pre-wrap in code blocks */
    white-space: pre;
}
