/* Light theme defaults */
:root {
    --bg: #fdfdfd;
    --bg2: #f5f5f5;
    --fg: #1a1a1a;
    --fg2: #2e2e2e;

    --link: #0066cc;
    --link-visited: #5a2ca0;
    --link-hover: #004a99;

    --code-bg: #f0f0f0;
    --code-fg: #1a1a1a;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1e1e1e;
        --bg2: #2b2b2b;
        --fg: #e6e6e6;
        --fg2: #cecece;

        --link: #4da6ff;
        --link-visited: #c792ea;
        --link-hover: #3399ff;

        --code-bg: #2d2d2d;
        --code-fg: #e6e6e6;
    }
}

/* Generic website style */
body {
    margin: 40px auto;
    max-width: 750px;
    line-height: 1.6;
    font-size: 18px;
    color: var(--fg);
    background: var(--bg);
    padding: 0 10px;
    text-align: justify;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

h1, h2, h3, h4, h5 {
    line-height: 1.2;
}

/* Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.site-header a {
    color: var(--fg);
}

.site-header a:visited {
    color: var(--fg);
    text-decoration: none;
}

.site-header a:hover {
    color: var(--fg2);
    text-decoration: none;
}

.logo {
    display: flex;
    flex-direction: column;
    font-family: monospace;
    font-size: 4rem;
    text-align: justify;
    margin: 0;
    line-height: 1;
}

.moto-text {
    font-size: 1.2rem;
    color: var(--fg);
    margin: 0;
    font-style: italic;
}

.menu-bar .menu {
    display: flex;
    justify-content: space-between;
    font-size: 1.5rem;
    list-style: none;
}

.menu a {
    color: var(--fg);
}

.menu a:visited {
    color: var(--fg);
    text-decoration: none;
}

.menu a:hover {
    color: var(--fg2);
    text-decoration: none;
}


/* article header */
.article-meta {
    display: flex;
    justify-content: space-between;
}

/* Links */
a {
    color: var(--link);
    text-decoration: none;
}
a:visited {
    color: var(--link-visited);
}
a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}
a:active {
    opacity: 0.85;
}

/* For code snippets */
.codehilite {
    background: var(--code-bg);
    color: var(--code-fg);
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 0.8em;
    line-height: 1.4;
    align-items: flex-end;
}
