/* Libre Plantin */
@font-face {
    font-family: 'Prolog';
    src: url('Prolog-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box;
}

:root {
    --background-color: rgb(247, 246, 242);
    --posts-color: rgb(181, 19, 181);
    --projects-color: rgb(101, 127, 255);

    --blockquote-background-color: rgb(255, 254, 251);
    --blockquote-indent-color: rgb(218, 213, 194);

    --link-color: rgb(54, 54, 54);
    --link-visited-color: rgb(8, 8, 8);
    --link-hover-color: rgb(123, 123, 123);
}

::selection {
  color: white;
  background: black;
}

body {
    background: var(--background-color);
    /* Changed padding to handle resize better, strict spacing moved to nav/content */
    padding: 3em; 
    padding-left: 8em;
    font: 20px 'Prolog', sans-serif;
    margin: 0px;
    position: relative;
    min-height: 100vh;
    /* Prevents horizontal scroll if canvas sticks out */
    overflow-x: hidden; 
}

a {
    color: var(--link-color);
    padding-top: 2px;
    transition: padding 0.1s;
}
a:visited {
    color: var(--link-visited-color);
}
a:hover {
    color: var(--link-hover-color);
    padding-top: 0px;
    padding-bottom: 2px;
}
a.nolinkstyle {
    color: unset;
    padding-top: unset;
    padding-bottom: unset;
    transition: unset;
    text-decoration: none;
}

#content {
    display: flex;
    flex-direction: column;
    gap: 1em;
    width: 100%;
    max-width: 600px; 
    background: rgb(247, 246, 242);
    box-shadow: 0px 0px 30px 30px rgb(247, 246, 242);
    position: relative;
    z-index: 1; /* Ensures text sits above canvas on overlap */
}

#content > header {
    font-size: 1.1em;
    margin-left: -1em;
    margin-right: -1em;
}
.post-header {
    font-size: 1.3em;
    margin-top: 0.8em;
    margin-bottom: -0.5em;
    font-style: italic;
}

canvas {
    width: 640px;
    max-width: 100%; 
    height: auto;
    
    image-rendering: pixelated;
    position: absolute;
    right: 6em;
    bottom: 0px;
    z-index: 0;
    background-color: transparent;
    pointer-events: none; 
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: end;
    flex-wrap: wrap; /* Allows wrapping on tiny screens */
}

.list header {
    border-radius: 2px;
    color: white;
    padding: 3px 6px 3px 6px;
    width: fit-content;
}
.list ul li {
    display: flex;
    gap: 1em;
    margin-bottom: 4px;
    align-items: start;
}
.date {
    background-color: #444;
    border-radius: 2px;
    color: white;
    padding: 1px 3px 1px 3px;
    width: fit-content;
    flex-shrink: 0; 
}

p.multiline {
    white-space: pre-wrap;
    margin: 0px;
    word-break: break-word; 
    line-height: 1.4;
}
div.markdown {
    line-height: 1.4;
}

blockquote {
    background: var(--blockquote-background-color);
    border-left: 10px solid var(--blockquote-indent-color);
    margin: 1.5em 10px;
    padding: 0.5em 20px;
    border-radius: 2px;
}

table {
    background: var(--blockquote-background-color);
    border-collapse: collapse;
}
table, th, td {
    border: 1px solid var(--blockquote-indent-color);
    padding: 10px;
} 

img, image, video, iframe {
    border-radius: 4px;
    max-width: 100%;
}

@media (max-width: 768px) {
    body {
        padding: 1.5em !important;
        padding-bottom: 400px !important;
        font-size: 18px;
    }

    nav > span {
        flex: 0 0 100%;
    }

    #content {
        max-width: 100%;
    }

    #content > header {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    canvas {
        position: absolute; 
        width: 100%;
        right: 0;
        bottom: 0;
        width: 100%;
    }
}