@font-face {
    font-family: "Silkscreen";
    src: 
        local("Silkscreen"),
        url("/static/fonts/Silkscreen/Silkscreen-Regular.ttf");
}

:root {
    color-scheme: light dark;
    --c-black: #000; 
    --c-white: #FFF;
    --c-gray: light-dark(#EEE, #333);
    --c-red: light-dark(#DA1C32, #FF6A7B);
    --c-green: light-dark(#149723, #1CDA32); 
    --c-blue: light-dark(#1C2FDA, #B4CEFF);
    --c-yellow: light-dark(#ADAA00, #DAD61C);
    --c-brown: #91683f;

    --f-default: "ui-sans-serif", "sans-serif";
    --f-pixel: "Silkscreen";

    --mask-border: linear-gradient(#000 0 0) center / 100% calc(100% - 16px) no-repeat, linear-gradient(#000 0 0) center / calc(100% - 16px) 100% no-repeat;
}

html {
    height: 100%;
    width: 100%;
}

html, body {
	margin: 0;
	padding: 0;
    font-size: 16px;
	font-family: var(--f-default);
    min-height: 100%;

    color: light-dark(var(--c-black), var(--c-white));
    background: light-dark(var(--c-white), var(--c-black));
}

    details summarymarker {
        content: ""
        display: none;
    }

body {
    display: grid;
    grid-template-columns: minmax(10rem, 1fr) 50rem minmax(10rem, 1fr);
    gap: 8px;

    .nav-mobile, .nav-desktop {
        position: relative;
        background-color: var(--c-gray);

        nav {
            display: grid;
            grid-template-columns: 100%;
            gap: 8px;
            align-content: start;
        }

        svg.nav-decoration { position: absolute; }

        hr {
            padding-top: 16px; 
            border: none;
        }
    }

    .nav-mobile { 
        display: none; 
        position: sticky;
        top: 0;
        z-index: 2;
        border-bottom: 4px solid light-dark(var(--c-black), var(--c-white));

        nav { padding: 8px 32px 32px 32px; }

        summary {
            list-style:none;
            padding: 8px 32px;
            height: 32px;
            text-align: right;

            svg {
                width: 32px;
                height: 32px;
            }
        }

        svg.nav-decoration {
            pointer-events: none;
            bottom: 0;
            left: 0;
            transform: rotate(-90deg);
            width: 64px;
            height: 64px;
            color: light-dark(var(--c-black), var(--c-white));
        }
    }


    .nav-desktop {
        height: 100%;

        > nav {
            padding: 32px;
            padding-top: 64px;
            text-align: right;
        }

        svg.nav-decoration {
            top: 0;
            right: 0;
            width: 128px;
            height: 128px;
            color: var(--c-gray);
            transform: translateX(100%);
        }
    }

    > main { 
        position: relative; 
        padding: 32px;

        pre {
            text-overflow: ellipsis;
            overflow: hidden;
        }

        code {
            white-space: pre-wrap;
            background: var(--c-gray);
        }

        h1,h2,h3,h4,h5,h6 {
            margin: 0;
            font-family: var(--f-pixel);
            color: var(--c-blue);
        }

        time { font-style: italic; }

        article {
            header {
                h1,h2,h3 {
                    font-size: 48px;
                    color: var(--c-red);
                }
            }

            blockquote {
	            margin-left: 0;
	            border-left: 8px solid var(--c-blue);
	            padding-left: 8px;
	            font-style: italic;
            }
        }

        .neofetch {
            display: grid;
            grid-template-columns: 1fr 1fr;
            font-family: var(--f-default);

            > .neofetch-left {
                justify-self: center;
                svg {
                    width: 256px;
                    height: 256px;
                }
            }
            > .neofetch-right {
                > h1 { margin-bottom: 16px; }

                > .neofetch-right-overview {
                    display: grid;
                    grid-template-columns: auto 1fr;
                    gap: 16px;

                    > *:nth-child(odd) {
                        border-left: 16px solid #F00;
                        padding-left: 8px;

                        &:nth-child(8n) { border-color: var(--c-red); }
                        &:nth-child(8n + 1) { border-color: var(--c-yellow); }
                        &:nth-child(8n + 3) { border-color: var(--c-blue); }
                        &:nth-child(8n + 5) { border-color: var(--c-green); }
                    }
                }
                span {
                    display: block;
                    font-size: 16;
                }
            }
        }

        .writeup-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;

            > a {
                display: block;
                position: relative;
                height: 64px;
                border: 8px solid var(--c-blue);
                mask: var(--mask-border);
                padding-left: 8px;
                box-sizing: border-box;
                color: inherit;

                > svg {
                    position: absolute;
                    top: 8px;
                    right: 8px;
                    height: 32px;
                    width: 32px;
                    filter: grayscale(100%);
                }

                > header {
                    display: grid;
                    font-size: 24px;
                    font-family: var(--f-pixel);
                    line-height: .8em;
                    margin-top: 4px;

                    > time {
                        font-size: 16px;
                        font-family: var(--f-default);
                    }
                }

                &.writeup-easy { border-color: var(--c-green); }
                &.writeup-medium { border-color: var(--c-yellow); }
                &.writeup-hard { border-color: var(--c-red); }
                &.writeup-insane { /* TODO Hier wil ik een rainbow effect van maken */ border-color: var(--c-red); }

                &:hover{
                    > svg {
                        filter: grayscale(0%);
                    }

                }
            }
        }
    }
}

svg { vertical-align: center; }

a {
    text-decoration: none;
    color: var(--c-blue);

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

pre {
    padding: 16px 8px;
    background: var(--c-gray);
    mask: var(--mask-border);

    /* Hacky, typst support geen css vars voor syntax thema's dus hier worden
     * heel specifiek de thema kleuren overschreven met de CSS vars */
    > code {
        span[style="color: #ff0000"] { color: var(--c-red) !important; }
        span[style="color: #0000ff"] { color: var(--c-blue) !important; }
        span[style="color: #ff00ff"] { color: var(--c-yellow) !important; }
        span[style="color: #00ff00"] { color: var(--c-green) !important; }
    }
}

@media(max-width: 1000px) {
    body {
        display: block;

        > .nav-desktop { display: none; };
        > .nav-mobile { display: block; };

        > main { 
            padding: 8px;
            .writeup-container { grid-template-columns: 1fr; } 
        }

        .neofetch {
            display: block;

            > .neofetch-left { display: none; }
        }

    }
}

/*
 *
 * > nav {
        background-color: var(--c-gray);
        height: 100%;
        position: relative;
        display: grid;
        grid-template-columns: 100%;
        gap: 8px;
        align-content: start;
        text-align: right;
        padding: 32px;

        > svg {
            color: var(--c-gray);
            position: absolute;
            right: 0;
            transform: translateX(100%);
            width: 128px;
            height: 128px;
        }

        hr { 
            padding-top: 16px; 
            border: none;
        }
    }

    */
