/* Ivory: the Planet app's website (www.planetable.xyz, 2022) as a Planet template. */
:root {
    --sidebar-background-color: #efefe0;
    --main-background-color: #fffff0;

    --backdrop-blur-radius: 10px;
}

* {
    box-sizing: border-box;
}

html, body {
    padding: 0px;
    margin: 0px;
    font-family: system-ui;
    font-size: 14px;
}

code {
    font-size: 0.9em;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 2px 4px;
    border-radius: 2px;
    line-break: anywhere;
}

pre code {
    background-color: transparent;
    padding: 0;
}

a:link, a:visited {
    text-decoration: none;
    color: #336bad;
}

a:hover {
    text-decoration: underline;
}

.wrapper {
    width: 100%;
    min-height: 100vh;
}

#app {
    width: 100%;
    min-height: 100vh;
    display: flex;
}

#sidebar {
    width: 40%;
    background-color: var(--sidebar-background-color);
    display: flex;
    flex-direction: row-reverse;
}

.sidebar-inner {
    width: 100%;
    max-width: 400px;
    background-color: transparent;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo {
    display: block;
    width: 100%;
}

.logo img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
}

a.site-name:link, a.site-name:visited {
    color: #111;
    text-align: center;
    font-family: system-ui;
    font-size: 3em;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
}

#main {
    width: 60%;
    min-height: 100vh;
    background-color: var(--main-background-color);
    display: flex;
    align-items: center;
    flex-direction: column;
}

#nav {
    width: 100%;
}

.nav-inner {
    margin-left: auto;
    margin-right: auto;
    max-width: 600px;
    height: 40px;
    background-color: var(--main-background-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 40px 40px 20px 40px;
}

.nav-item {
    font-size: 1.2em;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.nav-item:hover {
    text-decoration: none;
    border-bottom: 2px solid #336bad;
}

.nav-item.active {
    color: #222;
    border-bottom: 2px solid #222;
}

.main-inner {
    flex: 1;
    width: 100%;
    max-width: 600px;
    padding: 40px;
}

.markdown-content p {
    font-size: 1.2em;
    font-family: system-ui;
    line-height: 150%;
}

.markdown-content ul {
    line-height: 150%;
}

.markdown-content h1, .markdown-content h2,  .markdown-content h3 {
    margin-top: 2.5em;
    margin-bottom: 1.25em;
}

/* the first and the last block of the page, of the About and of a post's text sit flush */
.markdown-content > :first-child, .about > :first-child {
    margin-top: 0;
}

.markdown-content > :last-child, .about > :last-child, .content > :last-child {
    margin-bottom: 0;
}

.markdown-content p.page-info {
    font-size: 1em;
    color: #888;
    margin-top: -0.5em;
}

.content img {
    max-width: 100%;
    height: auto;
}

.content video, .content audio {
    width: 100%;
    display: block;
}

hr {
    border: 0;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    margin-bottom: 20px;
}

.toc {
    margin-top: 20px;
    margin-bottom: 1.5em;
    padding-inline-start: 1em;
    padding-top: 1.5em;
    padding-bottom: 1.5em;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    list-style: none;
    line-height: 150%;
}

.toc ul {
    list-style: none;
}

.toc li::before {
    content: "\2022";
    color: rgba(0, 0, 0, 0.2);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.posts {
    list-style: none;
    padding: 0;
}

.markdown-content .posts li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1em;
    font-size: 1.2em;
    line-height: 150%;
    margin: 0.5em 0;
}

.posts .date {
    color: #888;
    font-size: 0.8em;
    white-space: nowrap;
}

.tags a {
    margin-right: 0.5em;
}

.pager {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    font-size: 1.2em;
}

.footer {
    width: 100%;
    max-width: 600px;
    padding: 0 40px 40px 40px;
    color: #888;
    text-align: center;
}

.screenshot {
    max-width: 100%;
}

figcaption {
    margin-top: 10px;
    font-size: 14px;
    color: #888;
    text-align: center;
}

figure {
    margin-top: 20px;
    margin-bottom: 20px;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
}

.scroll-top {
    z-index: 99;
    width: 60px;
    height: 30px;
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    border-radius: 6px;
    background-color: rgba(240, 240, 220, 0.25);
    border: 2px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(var(--backdrop-blur-radius));
    -webkit-backdrop-filter: blur(var(--backdrop-blur-radius));
}

.scroll-top.shown {
    display: block;
}

.scroll-top:hover {
    cursor: pointer;
}

.scroll-top span {
    transform: rotate(-90deg);
    display: inline-block;
    color: rgba(0, 0, 0, 0.2);
    font-size: 1.5em;
    margin-top: -2px;
}

pre {
    padding: 10px;
    border-radius: 3px;
    white-space: pre-wrap;
    font-size: 12px;
    line-height: 1.6;
    background-color: #2b303b;
    color: #c0c5ce;
}

@media (max-width: 600px) {
    #app {
        flex-direction: column;
    }

    #sidebar {
        width: 100%;
        flex-direction: row;
    }

    .sidebar-inner {
        width: 100%;
        max-width: 100%;
    }

    #main {
        width: 100%;
        min-height: 1vh;
        align-items: initial;
    }

    .nav-inner {
        overflow-x: auto;
    }
}
