@font-face {
    font-family: 'LibertineR';
    src: url('../font/LinLibertine_R.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'LibertineRB';
    src: url('../font/LinLibertine_RB.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Bitter';
    src: url('../font/Bitter-Regular.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Libertine_aBS';
    src: url('../font/LinLibertine_aBS.ttf') format('truetype');
    font-display: swap;
}

:root {
    --background: #eae1c7;
    --post-background: #f4f4e8;
    --font-color: #432818;
    --muted-font-color: #66584d;
    --rule-color: #d8ccb0;
    --code-background: #ece6d5;
}

body {
    background-color: var(--background);
    margin: 0;
}

#header {
    padding-top: 3vh;
    padding-bottom: 3vh;
    text-align: center;
    font-family: 'Libertine_aBS';
    color: #432818;
    background-color: #eae1c7;
}

#header #ashtree {
    font-size: 60px;
}

#header #ashtree a {
    color: #432818;
}

#logo {
    margin-left: auto;
    margin-right: auto;
    width: auto;
    max-width: 90vw;
    height: 120px;
    display: block;
    object-fit: contain;
}

a {
    color: #2d7774;
    text-underline-offset: 0.16em;
}

a:hover {
    color: #225d5b;
}

.post {
    margin-top: 10px;
    padding-top: 10px;
    padding-bottom: 20px;
    padding-left: 30px;
    padding-right: 30px;

    font-size: 18px;
    width: 85%;
    margin-left: auto;
    margin-right: auto;
    max-width: 800px;
    color: var(--font-color);
    background-color: var(--post-background);
    font-family: 'Bitter';
    border-radius: 4px;
    font-kerning: 0.8;
    line-height: 1.65;
}

.post #title {
    font-family: 'LibertineRB';
    font-size: 36px;
    line-height: 1.12;
    margin-bottom: 0.6rem;
}

.post #byline {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 5px;
    text-align: right;
    font-size: 18px;
    color: var(--muted-font-color);
}

.index-posts {
    padding-top: 26px;
    padding-bottom: 26px;
}

.index-posts #title {
    margin-top: 0;
    margin-bottom: 1.1rem;
}

.post p,
.post ul,
.post ol,
.post pre {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.post ul,
.post ol {
    padding-left: 1.6rem;
}

.post li + li {
    margin-top: 0.35rem;
}

.postlink {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-family: 'LibertineRB';
    font-size: 24px;
    padding-top: 0.85rem;
    padding-bottom: 0.95rem;
}

.postlink + .postlink {
    border-top: 1px solid var(--rule-color);
}

.postlink .date {
    text-align: right;
    color: var(--muted-font-color);
}

.postlink .description {
    flex-basis: 100%;
    font-family: 'Bitter';
    font-size: 20px;
    line-height: 1.45;
    margin-top: 0.2rem;
    margin-bottom: 0;
}

#backtoindex {
    font-style: italic;
    text-align: right;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

pre {
    white-space: pre-wrap;
    overflow-x: auto;
    padding: 1rem;
    background-color: var(--code-background);
    border-left: 3px solid var(--rule-color);
    border-radius: 3px;
    line-height: 1.45;
}

code {
    overflow-wrap: anywhere;
}

p code,
li code {
    padding: 0.05rem 0.25rem;
    background-color: var(--code-background);
    border-radius: 3px;
}

.post video,
.post embed {
    display: block;
    width: calc(100vw - 24px);
    max-width: 1142px;
    height: auto;
    margin-left: 50%;
    margin-right: 0;
    margin-top: 20px;
    margin-bottom: 10px;
    transform: translateX(-50%);
}

@media (max-width: 760px) {
    #header {
        padding-top: 2vh;
        padding-bottom: 2vh;
    }

    #header #ashtree {
        font-size: 42px;
    }

    #logo {
        margin-left: auto;
        margin-right: auto;
        width: auto;
        max-width: 45vw;
        height: 90px;
        display: block;
        border-radius: 10px;
    }

    .post {
        width: auto;
        margin: 10px 8px;
        padding: 16px;
        font-size: 17px;
        line-height: 1.6;
    }

    .index-posts {
        padding-top: 22px;
    }

    .post #title {
        font-size: 31px;
    }

    .post #byline {
        justify-content: flex-start;
        text-align: left;
        font-size: 16px;
    }

    .postlink {
        gap: 0.25rem 0.75rem;
        font-size: 22px;
    }

    .postlink .description {
        font-size: 18px;
    }
}
