@font-face {
    font-family: "EB Garamond";
    src: url('/fonts/EBGaramond-Medium.woff2') format('woff2');
    font-weight: 600;
}

@font-face {
    font-family: "EB Garamond";
    src: url('/fonts/EBGaramond-MediumItalic.woff2') format('woff2');
    font-weight: 600;
    font-style: italic;
}

@font-face {
    font-family: "EB Garamond";
    src: url('/fonts/EBGaramond-Regular.woff2') format('woff2');
}

@font-face {
    font-family: "EB Garamond";
    src: url('/fonts/EBGaramond-Italic.woff2') format('woff2');
    font-style: italic;
}

:root {
    --background-color: #F4F1EA;
    --primary-text: #44403C;
    --muted-text: #A39989;
    --red: #ED2100;
}

html {
    font-size: 100%;
}

html,
body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-size: 1.3rem;
    font-family: "EB Garamond", serif;
    font-variant-numeric: oldstyle-nums;
    line-height: 1.6;
    color: var(--primary-text);
    background-color: var(--background-color);
    background-image: url("img/bg.jpg");
    background-repeat: repeat;
    background-attachment: fixed;
    background-size: 400px 400px;
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 5px;
}


div#wrapper {
    max-width: min(35em,95svw);
    min-width: 50%;
    border: 3px solid var(--primary-text);
    padding: 5px;
    box-sizing: border-box;
}

main {
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0;
    border: 2px solid var(--primary-text);
    box-sizing: border-box;
    overflow-x: scroll;
}

p {
    margin: 0.5em;
}

p + p {
    margin-top: 0;
}

p, li {
    text-align: justify;
    hyphens: auto;
}

strong {
    font-variant: small-caps;
    font-weight: normal;
}

ul { margin: 0.5em 0; }

h1, h2, h3 {
    font-weight: 600;
    text-transform: uppercase;
    font-variant-numeric: normal;
    letter-spacing: min(1vw, 0.3em);
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.25rem;
}

h3 {
    font-size: 0.95rem;
}

h1 + h2, h2 + h3 {
    margin-top: 0;
}

h1.heading,
h2.heading {
    display: flex;
    flex-direction: column;
    text-align: center;
    line-height: 2;
    margin: 20px;

    & .small {
        font-size: 0.7em;
    }

    & .medium {
        font-size: 0.8em;
    }
}

a.heading {
    text-decoration: none;
    outline: none;
}

img#logo {
    width: 20%;
    max-width: 100px;
    height: auto;
}

img#meise {
    height: 50px;
    max-width: 20%;
}

hr {
    border: none;
    background-image: url("/img/rule.png");
    background-size: auto 1.25ex;
    width: calc(1.25ex * 1856 / 194);
    height: 1.25ex;
}

.prevnext {
    margin-right: 10px;
    margin-left: 11px;
}

a.prevnext {
    text-decoration: none;
}

a.prevnext:hover {
    text-decoration: underline;
}

#lunaio {
    line-height: 1.1;
    border-collapse: collapse;
    border: none;
    flex-grow: 0;
    margin: 20px 0;

    & span.pointer {
        vertical-align: middle;
    }

    & th {
        font-weight: normal;
        font-size: 1em;
        padding: 0 5px 5px 5px;
    }

    & tbody tr:last-of-type td {
        padding-bottom: 5px;
    }

    & thead tr:first-of-type th {
        font-variant: small-caps;
    }

    & thead tr:nth-of-type(3) th {
        font-style: italic;
        font-size: 0.9em;
    }

    & tr.today td {
        font-weight: bold;
    }

    & td {
        padding: 5px 5px 0 5px;
    }

    & td:first-of-type,
    & th:first-of-type,
    & td:last-of-type,
    & th:last-of-type {
        border-right: 2px solid var(--primary-text);
    }

    & tbody tr:last-of-type td:not(:first-of-type) {
        border-bottom: 2px solid var(--primary-text);
    }

    & thead tr:first-of-type th:not(:first-of-type) {
        border-top: 2px solid var(--primary-text);
    }

    & thead tr th:not(:first-of-type) {
        border-bottom: 1px solid var(--primary-text);
    }

    & td:nth-of-type(2),
    & td:nth-of-type(3),
    & td:nth-of-type(6),
    & th:nth-of-type(2) {
        border-right: 1px solid var(--primary-text);
    }

    & td:nth-of-type(4),
    & tr:first-of-type th:nth-of-type(2) {
        border-right: 4px double var(--primary-text);
    }

    & td:nth-of-type(3) {
        text-align: center;
    }

    & td:nth-of-type(1),
    & td:nth-of-type(2),
    & td:nth-of-type(3),
    & td:nth-of-type(4) {
        vertical-align: top;
    }

    & td:nth-of-type(5),
    & td:nth-of-type(7) {
        padding-right: 0;
        vertical-align: top;
    }

    & td:nth-of-type(6),
    & td:nth-of-type(8) {
        padding-left: 0;
        font-size: 0.85em;
        vertical-align: super;
    }
}

.parfix {
    font-size: 1.4em;
}

a,
a:visited {
    color: inherit;
    text-decoration: underline;
    outline: none;
}

a:hover {
    text-decoration: none;
}

body>nav {
    >a {
        margin: 0 10px;
        text-decoration: none;
    }

    >a:hover {
        text-decoration: underline;
    }

    padding-bottom: 5px;
    font-style: italic;
    font-size: 0.9em;
}

nav {
    text-align: center;
}

h2+nav {
    margin-top: -20px;
    margin-bottom: 20px;
}

blockquote.proverbio {
    border: 6px double var(--primary-text);
    padding: 0.5em;
    margin: 0.5em;
    font-style: italic;
    font-size: 1.2em;

    & .translation {
        margin: 0 auto;
        width: fit-content;
        font-style: normal;
        font-size: 0.85em;
        color: var(--muted-text);
    }
}

h2+blockquote.proverbio {
    margin-top: 0;
}

.proverbi {
    line-height: 1.2;
    font-style: italic;

    & a {
        text-decoration: none;
    }

    & a:hover {
        text-decoration: underline;
    }

    & small.translation {
        font-size: 0.85em;
        color: var(--muted-text);
        font-style: normal;
    }
}

#quotation {
    align-self: flex-end;
    margin: 2em 0;
    text-align: right;
    > blockquote {
        font-style: italic;
        margin: 0;
    }
    > .citation {
        text-align: right;
        font-size: 0.9em;
        margin-top: 0;
        > cite { font-style: italic; }
    }
}



@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #121212;
        --primary-text: #E0E0E0;
        --muted-text: #9E9E9E;
        --red: #CF6679;
    }

    body {
        background-color: var(--background-color);
        background-image: url("img/bg-dark.jpg");
    }

    img,
    hr {
        filter: invert(100%);
    }
}
