/* a minimalist set of CSS resets */

/* @import url("https://cdn.jsdelivr.net/npm/normalize.css@8.0.1/normalize.css"); */

/* @import url('https://cdn.jsdelivr.net/gh/fonsp/Pluto.jl@0.18.0/frontend/vollkorn.css'); */
/* @import url('https://fonts.googleapis.com/css2?family=Jaldi:wght@400;700&display=swap'); */
/* @import url('https://fonts.googleapis.com/css2?family=Jaldi:wght@400;700&family=Work+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700;1,800;1,900&family=Yantramanav:wght@400;500;700;900&display=swap'); */

/* default to border-box */
html {
    box-sizing: border-box;
    font-size: 17px;
}

/* COLOR */

#pages-layout {
    /* --bg-color: set by pluto */
    --sidebar-bg: #fafafa;
    --sidebar-color: rgb(82, 82, 82);
    --sidebar-li-active-bg: rgb(236, 234, 213);
    --sidebar-li-hover-bg: rgb(235, 235, 235);
}
@media (prefers-color-scheme: dark) {
    #pages-layout {
        --sidebar-bg: #303030;
        --sidebar-color: rgb(255, 255, 255);
        --sidebar-li-active-bg: rgb(149, 88, 178);
        --sidebar-li-hover-bg: rgb(82, 82, 82);
    }
}

/* LAYOUT */

#pages-layout {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    align-items: stretch;
}

#pages-sidebar {
    position: sticky;
    font-family: system-ui;
    flex: 0 0 auto;
    width: 16rem;
    font-weight: 400;
    z-index: 23400;
}

#pages-content {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
}

#pages-sidebar > div {
    top: 1rem;
    margin: 1rem;
    padding: 0.5rem;
    padding-bottom: 2rem;
    border-radius: 1rem;
    background: var(--sidebar-bg);
    color: var(--sidebar-color);
}

#toggle-nav {
    display: none;
}

/* SIDEBAR COLLAPSING */

#pages-content::after {
    content: "";
    z-index: 23400;
    touch-action: none;
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: background-color 0.2s ease-out;
}

@media screen and (max-width: 768px) {
    #pages-layout {
        flex-direction: column;
    }
    #toggle-nav {
        display: inline-flex;
        align-self: start;
        border: none;
        background: none;
    }
    #toggle-nav::after {
        --size: 40px;
        content: " ";
        display: inline-block;
        width: var(--size);
        height: var(--size);
        background-image: url(https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/menu-outline.svg);
        background-size: var(--size) var(--size);
        filter: var(--image-filters);
    }
    #pages-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        right: 100%;
        overflow-y: auto;
        transition: transform 300ms cubic-bezier(0.18, 0.89, 0.45, 1.12);
    }
    @media (prefers-reduced-motion) {
        #pages-sidebar {
            transition: none;
        }
    }

    .pages_show_sidebar #pages-sidebar {
        transform: translateX(100%);
        z-index: 23401;
    }
    .pages_show_sidebar #pages-content::after {
        display: block;
        background-color: rgba(0, 0, 0, 0.5);
    }
}

/* SIDEBAR */

#pages-sidebar > div > ul {
    margin-block-start: 0px;
    margin-block-end: 0px;
}

#pages-sidebar li,
#pages-sidebar ul {
    padding: 0px;
    list-style-type: none;
}

#pages-sidebar a {
    color: unset;
    text-decoration: none;
}

#pages-sidebar li li a,
#pages-sidebar li h3 {
    border-radius: 0.5em;
    padding: 0.2em 0.6em;
}

#pages-sidebar li h3 {
    opacity: 0.6;
    font-variant-caps: all-petite-caps;
    margin-block-end: 0;
}

#pages-sidebar li:first-of-type h3 {
    margin-block-start: 0;
}

#pages-sidebar li,
#pages-sidebar ul {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

#pages-sidebar li li.active a {
    background-color: var(--sidebar-li-active-bg);
}
#pages-sidebar li li:hover a {
    background-color: var(--sidebar-li-hover-bg);
}

/* SIDEBAR LOGO */

#pages-sidebar .home_link img {
    width: 2.5em;
}
#pages-sidebar a.home_link {
    font-size: 1.2rem;
    padding: 0.3em;
    font-weight: 800;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.8ch;
}

/* Markdown content */

.pages-markdown main {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 5rem;
}

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

:root {
    --system-fonts: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
        system-ui, sans-serif;
    --system-fonts-mono: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
/* adjust typography defaults */
body {
    /* background: url(bg.svg); */
    /* background-color: hsl(231deg 14% 57%); */
    /* background-size: cover; */
    font-size: 17px;
    font-family: var(--system-fonts);
    margin: 0;
    padding: 0;
    width: 100vw;
    overflow-x: hidden;
    background: white;
    color: var(--pluto-output-color);
    word-break: break-word;
}

p,
ol {
    line-height: 1.5;
}

h1,
h2 {
    font-weight: 800;
}

.admonition > ul {
    padding-left: 0;
    margin-left: 1em;
}

pre {
    tab-size: 4;
    white-space: pre-wrap;
    word-break: break-word;
}

pre,
code {
    font-family: var(--system-fonts-mono);
}

/* images and videos max out at full width */
img,
video {
    height: auto;
    max-width: 100%;
}

a {
    font-weight: 500;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
h1 a,
h2 a,
h3 a {
    font-weight: inherit;
}

a.arrow {
    font-weight: 700;
}
a.arrow::after {
    content: " →";
}
card-text > a.arrow {
    margin-top: auto;
}

/* SIDEBAR LOGO */

a.pluto_home_link img {
    width: 2.5em;
}
a.pluto_home_link {
    font-size: 1.2em;
    font-weight: 800;
    color: inherit;
    padding: 0.3em;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.8ch;
}
