:root {
    color-scheme: light dark;
    --text: #222;
    --muted: #666;
    --subtle: #ececec;
    --bg: #fdfdfd;
    --link: #0b57d0;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --text: #ddd;
        --muted: #999;
        --subtle: #2c2c2c;
        --bg: #1a1a1a;
        --link: #8ab4f8;
    }
}

body {
    max-width: 42rem;
    margin: 0 auto;
    padding: 2rem 1rem;
    font-family: system-ui, sans-serif;
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

/* Site header and footer */

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 3rem;
}

.site-title {
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.site-header nav {
    display: flex;
    gap: 1rem;
}

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

.site-header nav a:hover,
.site-header nav a[aria-current] {
    color: var(--text);
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 4rem;
    padding-top: 1rem;
    border-top: 1px solid var(--subtle);
    color: var(--muted);
    font-size: 0.875rem;
}

.site-footer a {
    color: inherit;
}

/* Text */

h1,
h2,
h3 {
    line-height: 1.25;
}

h2 {
    margin-top: 2.5rem;
}

h3 {
    margin-top: 2rem;
}

a {
    color: var(--link);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}

a:hover {
    text-decoration-color: currentColor;
}

/* Headings link to themselves (insert_anchor_links = "heading") */
.zola-anchor {
    color: inherit;
    text-decoration: none;
}

.zola-anchor:hover::after {
    content: " #";
    color: var(--muted);
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* Post lists */

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

.post-list li {
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
    margin-bottom: 0.5rem;
}

.post-list time {
    flex: none;
    color: var(--muted);
    font-size: 0.9em;
    font-variant-numeric: tabular-nums;
}

.post-list a {
    text-decoration: none;
}

.post-list a:hover {
    text-decoration: underline;
}

/* Articles */

.post-header {
    margin-bottom: 2rem;
}

.post-header h1 {
    margin-bottom: 0.25rem;
}

.post-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.9em;
}

.toc {
    margin-bottom: 2rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--subtle);
    border-radius: 6px;
    font-size: 0.95em;
}

.toc summary {
    cursor: pointer;
    color: var(--muted);
}

.toc ul {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

.toc ul ul {
    margin-top: 0;
}

/* Code */

code {
    font-family: var(--mono);
    font-size: 0.875em;
}

:not(pre) > code {
    padding: 0.1em 0.3em;
    border-radius: 4px;
    background: var(--subtle);
}

pre {
    padding: 1rem;
    overflow-x: auto;
    border-radius: 6px;
    line-height: 1.45;
}
