/* ==================================================================
   Design System — Notion/Obsidian-inspired, near-monochrome
   Light: white paper, #37352f ink, hairline #e9e9e7 borders.
   Dark: #1e1e1e page, #202020 panels, #d4d4d4 text.
   One restrained accent — muted chili red — used sparingly: link
   hovers, the active nav item, and the "View all posts" link.
   ================================================================== */

/* ---- Theme tokens ---- */
:root,
[data-theme="light"] {
    --bg: #ffffff;
    --bg-secondary: #f7f7f5;
    --text: #37352f;
    --text-muted: #787774;
    --border: #e9e9e7;
    --border-strong: #d3d1cb;
    /* Muted chili red, 5.7:1 on white (AA for normal text). */
    --accent: #b3402a;
    --accent-hover: #8f3220;

    --code-bg: #f7f6f3;
    --code-border: #e9e9e7;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
        "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono",
        Menlo, Consolas, monospace;

    /* ONE container: header, hero, post list, sidebar and footer all
       share the same left/right edges on every page. */
    --container: 1120px;
    --max-width: 700px;

    /* 8px spacing scale (structural layout; 4px half-step for micro gaps). */
    --space-05: 4px;
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-5: 40px;
    --space-6: 48px;
    --space-8: 64px;

    --radius: 6px;
    --header-height: 60px;
}

[data-theme="dark"] {
    --bg: #1e1e1e;
    --bg-secondary: #202020;
    --text: #d4d4d4;
    --text-muted: #9b9b9b;
    --border: #2f2f2f;
    --border-strong: #454545;
    /* Lighter chili tone for dark surfaces, 6.6:1 on #1e1e1e (AA). */
    --accent: #eb8a63;
    --accent-hover: #f5a786;

    --code-bg: #202020;
    --code-border: #333333;
}

/* ---- Focus: always visible for keyboard users ---- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---- Base ---- */
html {
    /* Base bumped 16px → 17.5px: every rem-based size (headings, body,
       sidebar, footer) scales up proportionally with it. */
    font-size: 17.5px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Links sit in the ink color with a soft underline; the chili-red
   accent appears on hover (and on the active nav item / View-all link). */
a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--text) 35%, transparent);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

a:hover {
    color: var(--accent);
    text-decoration-color: currentColor;
}

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

/* ---- Headings: weight 600, generous rhythm ---- */
h1 {
    font-size: 1.875rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
}

h2 {
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

h3 {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

h4,
h5,
h6 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

/* ==================================================================
   Header
   ================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.header-inner {
    /* Same container as .site-main and .footer-inner — shared edges. */
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--space-3);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    font-weight: 700;
    font-size: 1.15rem;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.site-logo:hover {
    opacity: 0.8;
}

.header-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* ---- Reading progress bar (post pages) ---- */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--accent);
    z-index: 1000;
    width: 0%;
    transition: width 0.1s ease-out;
    pointer-events: none;
}

/* ---- Nav ---- */

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-shrink: 0;
}

.site-nav a {
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    padding: var(--space-1) 0;
    transition: color 0.15s ease;
    white-space: nowrap;
}

.site-nav a:hover {
    color: var(--text);
}

/* Current page, set by the small script in base.html. */
.site-nav a.nav-active {
    color: var(--accent);
}

/* ---- Theme toggle ---- */

.theme-toggle {
    background: none;
    border: none;
    border-radius: var(--radius);
    /* Comfortable click target (≥40px) with a visible hover state. */
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1rem;
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

/* Sun icon (shown in dark mode — click to go light) */
[data-theme="dark"] .theme-icon::before {
    content: "☀";
}

/* Moon icon (shown in light mode — click to go dark) */
[data-theme="light"] .theme-icon::before {
    content: "☽";
}

/* ---- Mobile header ---- */
@media (max-width: 640px) {
    .header-inner {
        gap: 0.75rem;
        /* Match .site-main's side padding so edges stay aligned on phones. */
        padding: 0 var(--space-3);
    }

    .site-nav a {
        font-size: 0.92rem;
        font-weight: 600;
    }

    .site-nav {
        gap: 0.75rem;
    }
}


/* ==================================================================
   Main content area
   ================================================================== */

.site-main {
    flex: 1;
    width: 100%;
    /* ONE container everywhere: same left/right edges as the header
       and footer (bookends). Post/docs pages keep a capped reading
       measure on their prose via .post-content / .docs-content. */
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-5) var(--space-3) var(--space-6);
}

/* ==================================================================
   Right-hand categories sidebar (desktop only)
   Home + blog listing split the shared container into a two-column
   grid: main ~2/3, sidebar ~1/3, consistent 64px gap. The hero on the
   home page spans the full row above the grid, so the Categories
   heading top-aligns with the "Latest Posts" heading. Post pages keep
   their own ToC layout and never include the sidebar.
   ================================================================== */

/* Hidden by default; only shown at the desktop breakpoint below. */
.categories-sidebar {
    display: none;
}

/* Content column inside the two-column grid (home + blog listing).
   min-width:0 lets long words/URLs shrink instead of blowing out the track. */
.main-col {
    min-width: 0;
}

@media (min-width: 1024px) {
    .site-main.with-sidebar {
        display: grid;
        /* main ≈ 2/3 (688px), sidebar ≈ 1/3 (300px) of the 1072px content. */
        grid-template-columns: minmax(0, 2fr) 300px;
        column-gap: var(--space-8);
        align-items: start;
        max-width: var(--container);
    }

    /* Hero spans the full container width, above the two columns. */
    .bio {
        grid-column: 1 / -1;
    }

    .categories-sidebar {
        display: block;
        position: sticky;
        top: calc(var(--header-height) + var(--space-5));
        align-self: start;
    }
}

/* Sidebar content (shared look with the docs sidebar) */
.categories-list {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-05);
}

.category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-1);
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--text-muted);
    padding: var(--space-05) var(--space-1);
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
}

.category-link:hover {
    color: var(--text);
    background: var(--bg-secondary);
    text-decoration: none;
}

.category-link.active {
    color: var(--accent);
    font-weight: 600;
    background: color-mix(in srgb, var(--accent) 8%, var(--bg));
}

/* Zero-count categories: dimmed, no hover emphasis, still crawlable. */
.category-link.is-empty {
    opacity: 0.55;
}

.category-link.is-empty:hover {
    color: var(--text-muted);
    background: transparent;
}

.category-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 0.5em;
    /* Uniform badge width so counts right-align in one column. */
    min-width: 1.75em;
    text-align: center;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
    flex-shrink: 0;
}

.category-link.active .category-count {
    color: var(--accent);
}


/* ==================================================================
   Footer
   ================================================================== */

.site-footer {
    border-top: 1px solid var(--border);
    padding: var(--space-3) 0;
}

.footer-inner {
    /* Same container + padding as .header-inner and .site-main:
       copyright and social links line up with the content edges. */
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--space-3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-copy {
    margin: 0;
}

.footer-links {
    display: flex;
    gap: var(--space-3);
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    padding: var(--space-1) 0;
}

.footer-links a:hover {
    color: var(--text);
    text-decoration: underline;
}

@media (max-width: 640px) {
    .footer-inner {
        flex-direction: column;
        gap: var(--space-1);
        text-align: center;
    }
}


/* ==================================================================
   About page
   ================================================================== */

.about-page {
    max-width: var(--max-width);
}

.about-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.about-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.about-intro h1 {
    margin-bottom: 0.25rem;
}

.about-tagline {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin: 0;
}

.about-social {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 0.5rem;
}

.about-social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text);
}

.about-social-link svg {
    width: 20px;
    height: 20px;
    fill: var(--text-muted);
    transition: fill 0.15s ease;
}

.about-social-link:hover {
    color: var(--text);
}

.about-social-link:hover svg {
    fill: var(--text);
}

@media (max-width: 640px) {
    .about-hero {
        flex-direction: column;
        text-align: center;
    }
}


/* ==================================================================
   Home — hero + latest posts
   On desktop the hero spans the full container width (a grid row
   above the two-column area); the avatar is vertically centered with
   the text block and the tagline uses the full column width.
   ================================================================== */

.bio {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-3);
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-5);
    border-bottom: 1px solid var(--border);
}

.bio-avatar {
    flex-shrink: 0;
}

.bio-avatar img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
}

[data-theme="dark"] .bio-avatar img {
    filter: invert(1);
}

.bio-name {
    font-size: 1.5rem;
    letter-spacing: -0.01em;
    margin-bottom: var(--space-05);
}

/* No max-width: the tagline wraps naturally across the full column. */
.bio-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

@media (max-width: 640px) {
    .bio {
        flex-direction: column;
        text-align: center;
    }
}

/* ---- Section labels: one consistent size/weight/case everywhere ---- */

.section-heading,
.sidebar-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

.view-all-link {
    display: inline-block;
    margin-top: var(--space-3);
    font-size: 0.9rem;
    font-weight: 500;
    /* One of the three sanctioned accent uses. */
    color: var(--accent);
    text-decoration: none;
}

.view-all-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ---- Post row meta: date + tags share one consistent baseline ---- */

.post-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-1);
}

.post-card-date {
    /* Fixed width so dates, tags, titles and excerpts line up
       identically in every row. */
    min-width: 9em;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}


/* ==================================================================
   Blog list
   ================================================================== */

.blog-list h1 {
    margin-bottom: var(--space-3);
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-05);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-05) 10px;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.filter-pill:hover {
    color: var(--text);
    border-color: var(--border-strong);
    text-decoration: none;
}

.filter-pill.active {
    color: var(--accent);
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--bg));
}

.filter-pill-count {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.filter-pill.active .filter-pill-count {
    color: var(--accent);
    opacity: 0.75;
}

.post-card {
    display: block;
    position: relative;
    text-decoration: none;
    color: var(--text);
    /* Bleed the row slightly past the text edges so the hover tint
       reads as a full row (Notion-style), while text stays aligned. */
    padding: var(--space-2) var(--space-3);
    margin: 0 calc(-1 * var(--space-3));
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius);
    transition: background 0.15s ease;
}

.post-card:hover {
    background: var(--bg-secondary);
}

.post-card:hover .post-card-title {
    color: var(--accent);
}

.post-card-link {
    color: inherit;
    text-decoration: none;
}

.post-card-link:hover {
    color: var(--text);
}

.post-card-link::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
}

.post-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 var(--space-05);
    line-height: 1.4;
    transition: color 0.15s ease;
}

.post-card-summary {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--space-1);
    line-height: 1.55;
}

.post-card-thumbnail {
    display: none;
}

/* ---- Tag pills: one small, neutral style everywhere ---- */

.post-card-tags,
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    position: relative;
    z-index: 2;
}

.tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1px var(--space-1);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease, border-color 0.15s ease;
}

/* Neutral hover — pills never compete with titles for attention. */
a.tag:hover {
    color: var(--text);
    border-color: var(--border-strong);
}


/* ==================================================================
   Blog post
   ================================================================== */

.post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: var(--space-6);
    align-items: start;
}

@media (max-width: 900px) {
    .post-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    #toc-container {
        display: none;
    }
}

/* Capped reading measure inside the shared container (ToC sits to the
   right of it). */
.post-content {
    max-width: var(--max-width);
    min-width: 0;
}

#toc-container {
    position: sticky;
    top: calc(var(--header-height) + 2rem);
    font-size: 0.85rem;
    padding-left: 1.25rem;
    border-left: 1px solid var(--border);
}

#toc-container ul {
    list-style: none;
    padding-left: 0;
}

#toc-container ul ul {
    padding-left: 1rem;
    margin-top: 0.35rem;
}

#toc-container li {
    margin-bottom: 0.45rem;
    line-height: 1.45;
}

#toc-container a {
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.15s ease;
}

#toc-container a:hover {
    color: var(--accent);
}

.header-anchor {
    text-decoration: none;
    color: var(--border-strong);
    margin-left: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
    font-weight: normal;
}

h2:hover .header-anchor,
h3:hover .header-anchor,
h4:hover .header-anchor {
    opacity: 1;
}

.header-anchor:hover {
    color: var(--accent);
}

.post-hero-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    display: block;
}

.post-header {
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
    max-width: var(--max-width);
}

.post-header time {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

.post-footer {
    margin-top: var(--space-6);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}

.post-footer a {
    font-size: 0.9rem;
    font-weight: 500;
}


/* ==================================================================
   Prose — rendered Markdown content
   ================================================================== */

.prose p {
    margin-bottom: 1.25rem;
}

.prose ul,
.prose ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.35rem;
}

.prose blockquote {
    border-left: 3px solid var(--border-strong);
    padding-left: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.prose hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

.prose img {
    margin: 1.5rem 0;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* Inline code */
.prose code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 4px;
    padding: 0.15em 0.35em;
}

/* Code blocks */
.prose pre {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin-bottom: 1.25rem;
    line-height: 1.55;
}

.prose pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85rem;
}

/* Tables */
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.prose th,
.prose td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.prose th {
    font-weight: 600;
}


/* ==================================================================
   Docs layout
   ================================================================== */

.docs-layout {
    display: flex;
    gap: var(--space-5);
}

.docs-sidebar {
    flex-shrink: 0;
    width: 180px;
    position: sticky;
    top: calc(var(--header-height) + var(--space-4));
    align-self: flex-start;
}

/* .sidebar-title shares the unified section-label style defined with
   .section-heading above. */

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-05);
}

.sidebar-link {
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--text-muted);
    padding: var(--space-05) var(--space-1);
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
}

.sidebar-link:hover {
    color: var(--text);
    background: var(--bg-secondary);
    text-decoration: none;
}

.sidebar-link.active {
    color: var(--accent);
    font-weight: 600;
    background: color-mix(in srgb, var(--accent) 8%, var(--bg));
}

.docs-content {
    flex: 1;
    min-width: 0;
    /* Capped reading measure inside the shared container. */
    max-width: var(--max-width);
}

/* ---- Tablet: stack the docs sidebar above the content, matching the
   ToC breakpoint on post pages ---- */
@media (max-width: 900px) {
    .docs-layout {
        flex-direction: column;
    }

    .docs-sidebar {
        position: static;
        width: 100%;
        border-bottom: 1px solid var(--border);
        padding-bottom: var(--space-2);
        margin-bottom: var(--space-2);
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--space-1);
    }
}


/* ==================================================================
   Utility
   ================================================================== */

.empty-state {
    color: var(--text-muted);
    padding: 2rem 0;
}


/* ==================================================================
   Pygments syntax highlighting overrides
   Tokens rendered by Pygments get class names like .k, .s, .c, etc.
   Neutral, GitHub-like colors that work in both themes.
   ================================================================== */

/* -- Light mode Pygments -- */
[data-theme="light"] pre code .c,
[data-theme="light"] pre code .cm,
[data-theme="light"] pre code .c1,
[data-theme="light"] pre code .cs {
    color: #6a737d;
    font-style: italic;
}

/* Comments */
[data-theme="light"] pre code .k,
[data-theme="light"] pre code .kn,
[data-theme="light"] pre code .kd,
[data-theme="light"] pre code .kc {
    color: #d73a49;
}

/* Keywords */
[data-theme="light"] pre code .s,
[data-theme="light"] pre code .s1,
[data-theme="light"] pre code .s2,
[data-theme="light"] pre code .sa {
    color: #032f62;
}

/* Strings */
[data-theme="light"] pre code .mi,
[data-theme="light"] pre code .mf {
    color: #005cc5;
}

/* Numbers */
[data-theme="light"] pre code .nb,
[data-theme="light"] pre code .bp {
    color: #005cc5;
}

/* Builtins */
[data-theme="light"] pre code .nf,
[data-theme="light"] pre code .fm {
    color: #6f42c1;
}

/* Functions */
[data-theme="light"] pre code .nn {
    color: #005cc5;
}

/* Module names */
[data-theme="light"] pre code .o,
[data-theme="light"] pre code .ow {
    color: #d73a49;
}

/* Operators */

/* -- Dark mode Pygments -- */
[data-theme="dark"] pre code .c,
[data-theme="dark"] pre code .cm,
[data-theme="dark"] pre code .c1,
[data-theme="dark"] pre code .cs {
    color: #6a737d;
    font-style: italic;
}

[data-theme="dark"] pre code .k,
[data-theme="dark"] pre code .kn,
[data-theme="dark"] pre code .kd,
[data-theme="dark"] pre code .kc {
    color: #ff7b72;
}

[data-theme="dark"] pre code .s,
[data-theme="dark"] pre code .s1,
[data-theme="dark"] pre code .s2,
[data-theme="dark"] pre code .sa {
    color: #a5d6ff;
}

[data-theme="dark"] pre code .mi,
[data-theme="dark"] pre code .mf {
    color: #79c0ff;
}

[data-theme="dark"] pre code .nb,
[data-theme="dark"] pre code .bp {
    color: #79c0ff;
}

[data-theme="dark"] pre code .nf,
[data-theme="dark"] pre code .fm {
    color: #d2a8ff;
}

[data-theme="dark"] pre code .nn {
    color: #79c0ff;
}

[data-theme="dark"] pre code .o,
[data-theme="dark"] pre code .ow {
    color: #ff7b72;
}

/* Static build: filtered-out cards and empty states use the hidden attribute. */
[hidden] {
    display: none !important;
}

/* ---- Mobile fixes (static build) ----
   Keep the header and long code inside a phone-width screen. */
.post-content,
.docs-content {
    min-width: 0;
}

.prose :not(pre) > code {
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    .site-logo-text {
        display: none;
    }

    .site-nav .nav-home {
        display: none;
    }

    .site-nav {
        gap: 0.85rem;
    }
}
