@import url("syntax.css");

@font-face {
    font-family: 'Monaspace Argon';
    src: url('/fonts/MonaspaceArgon-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Monaspace Argon';
    src: url('/fonts/MonaspaceArgon-Italic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Monaspace Argon';
    src: url('/fonts/MonaspaceArgon-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Monaspace Argon';
    src: url('/fonts/MonaspaceArgon-BoldItalic.woff2') format('woff2');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

:root {
    --font-family: 'Monaspace Argon', ui-monospace, 'SFMono-Regular', 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace, "Apple Color Emoji", "Segoe UI Emoji";
    --bg-color: #ffffff;
    --text-color: #212121;
    --link-color: #007acc;
    --separator-color: #e0e0e0;
    --code-bg-color: #fbf1c7;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --text-color: #e0e0e0;
        --link-color: #64b5f6;
        --separator-color: #333333;
        --code-bg-color: #282828;
    }
}

html {
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s;
    min-width: 0;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    margin-top: 2em;
    margin-bottom: 0.5em;
}

p {
    margin-bottom: 1.2em;
}

a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom 0.2s;
}

a:hover {
    border-bottom: 1px solid var(--link-color);
}

pre, code {
    font-family: var(--font-family);
    background-color: var(--code-bg-color);
    border-radius: 6px;
}

pre {
    padding: 1em;
    overflow-x: auto;
    white-space: pre;
    text-indent: 0;
    margin: 1.2em 0;
}

pre code {
    display: block;
    padding: 0;
    background: transparent;
}

code {
    padding: 0.2em 0.4em;
}

.site-wrapper {
    display: grid;
    grid-template-columns: 130px 1px minmax(0, 850px); /* nav | separator | content */
    gap: 2rem;
    padding: 3rem 2rem;
    max-width: 1060px; /* Adjust this to control overall width */
    margin-left: calc(3vw + 1.5rem); /* This creates a proportional off-center, left-weighted feel */
}

.sidebar-nav {
    position: sticky;
    top: 10rem;
    align-self: start;
    text-align: right;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.separator {
    background-color: var(--separator-color);
    width: 1px;
    height: 100%;
    transition: background-color 0.3s;
}

.main-content {
    width: 100%;
}

.main-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* small screens */
@media (max-width: 1200px) {
    .site-wrapper {
        margin-left: auto;
        margin-right: auto;
    }
}

/* mobile */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .site-wrapper {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 0;
        margin: 0;
        max-width: 100vw;
        width: 100%;
        box-sizing: border-box;
    }

    .sidebar-nav {
        position: static;
        margin-bottom: 2rem;
        border-bottom: 1px solid var(--separator-color);
        padding-bottom: 1.5rem;
        text-align: left;
    }

    .sidebar-nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .separator {
        display: none;
    }

    .main-content {
        overflow-wrap: break-word;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .main-content * {
        max-width: 100%;
        box-sizing: border-box;
    }

    pre {
        overflow-x: auto;
        max-width: 100%;
    }

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

    table {
        width: 100%;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }

    h1, h2, h3, h4, h5, h6 {
        overflow-wrap: break-word;
    }
}
