/* ==========================================================================
   Hearth CMS — theme stylesheet
   Warm, minimalist. Fraunces (serif) for headings, Inter for body.
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------- */
:root {
    --bg: #f4ede2; /* warm cream page background          */
    --surface: #fffdf9; /* cards, header, raised surfaces      */
    --surface-alt: #efe6d8; /* subtle fills, empty thumbnails      */
    --ink: #2b2520; /* primary text                        */
    --ink-soft: #6b6055; /* secondary text / meta               */
    --ink-faint: #9a8d7e; /* faint meta, placeholders            */
    --ember: #c0572e; /* terracotta accent                   */
    --ember-dark: #a5471f; /* accent hover                        */
    --ember-soft: #f3ddd0; /* tint for accent backgrounds         */
    --border: #e4d8c7; /* hairline borders                    */
    --border-soft: #ede3d4;
    --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --mono: 'SFMono-Regular', 'JetBrains Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(58, 42, 28, .05), 0 2px 8px rgba(58, 42, 28, .04);
    --shadow-md: 0 4px 18px rgba(58, 42, 28, .08);
    --maxw: 1080px;
    --maxw-narrow: 720px;
    --header-h: 64px;
}

/* ---- Reset / base -------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--ember);
    text-decoration: none;
}

    a:hover {
        color: var(--ember-dark);
    }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--serif);
    color: var(--ink);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 .5em;
    letter-spacing: -.01em;
}

p {
    margin: 0 0 1em;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

::selection {
    background: var(--ember-soft);
}

/* ---- Layout helpers ------------------------------------------------------ */
.container {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: 24px;
}

.container-narrow {
    max-width: var(--maxw-narrow);
}

.text-center {
    text-align: center;
}

.section {
    padding-block: 56px;
}

.section-bordered {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--ember);
    color: #fff;
    padding: 10px 16px;
    border-radius: 0 0 var(--radius-sm) 0;
    z-index: 1000;
}

    .skip-link:focus {
        left: 0;
        color: #fff;
    }

:focus-visible {
    outline: 2px solid var(--ember);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---- Header / nav -------------------------------------------------------- */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: var(--header-h);
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
}

    .site-brand:hover {
        color: var(--ink);
    }

.site-logo-img {
    height: 30px;
    width: auto;
    display: block;
}

.site-logo-text {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -.02em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

    .site-nav a {
        color: var(--ink-soft);
        font-weight: 500;
        font-size: .95rem;
        padding: 8px 14px;
        border-radius: var(--radius-pill);
        transition: background .15s ease, color .15s ease;
    }

        .site-nav a:hover {
            color: var(--ink);
            background: var(--surface-alt);
        }

.nav-toggle {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--ink);
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

    .nav-toggle:hover {
        background: var(--surface-alt);
    }

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(43, 37, 32, .42);
    z-index: 40;
}

/* ---- Buttons ------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--sans);
    font-weight: 600;
    font-size: .95rem;
    line-height: 1;
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .05s ease;
}

    .btn:active {
        transform: translateY(1px);
    }

.btn-sm {
    padding: 9px 16px;
    font-size: .9rem;
}

.btn-primary {
    background: var(--ember);
    color: #fff;
}

    .btn-primary:hover {
        background: var(--ember-dark);
        color: #fff;
    }

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--border);
}

    .btn-ghost:hover {
        background: var(--surface-alt);
        color: var(--ink);
    }

/* ---- Hero ---------------------------------------------------------------- */
.hero {
    padding-block: 72px 56px;
    text-align: center;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ember);
    font-weight: 600;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    background: var(--ember-soft);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
}

.hero-title {
    font-size: clamp(2.2rem, 6vw, 3.4rem);
    margin: 22px 0 14px;
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--ink-soft);
    max-width: 560px;
    margin: 0 auto;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 28px;
}

/* ---- Section headings ---------------------------------------------------- */
.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

    .section-heading h2 {
        font-size: 1.8rem;
        margin: 0;
    }

.section-link {
    font-weight: 600;
    font-size: .95rem;
    white-space: nowrap;
}

/* ---- Post grid / cards --------------------------------------------------- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

    .post-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-md);
        border-color: var(--border-soft);
    }

.post-card-inner {
    display: block;
    padding: 24px;
    color: var(--ink);
}

    .post-card-inner:hover {
        color: var(--ink);
    }

.post-card-title {
    font-size: 1.25rem;
    margin: 0 0 8px;
}

.post-card-excerpt {
    color: var(--ink-soft);
    font-size: .98rem;
    margin: 0 0 16px;
}

.post-card-meta {
    color: var(--ink-faint);
    font-size: .85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ---- Features ------------------------------------------------------------ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--ember-soft);
    color: var(--ember);
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.feature h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.feature p {
    color: var(--ink-soft);
    margin: 0;
}

/* ---- List pages (latest / category) ------------------------------------- */
.list-head {
    margin-bottom: 28px;
}

    .list-head h1 {
        font-size: clamp(2rem, 5vw, 2.8rem);
        margin-bottom: 6px;
    }

.list-sub {
    color: var(--ink-soft);
    font-size: 1.1rem;
    margin: 0;
}

.list-intro {
    padding-block: 48px 0;
}

/* Search bar */
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 8px 8px 8px 18px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 28px;
}

.search-ico {
    color: var(--ink-faint);
}

.search-input {
    flex: 1;
    border: 0;
    background: transparent;
    font: inherit;
    color: var(--ink);
    padding: 8px 0;
    min-width: 0;
}

    .search-input::placeholder {
        color: var(--ink-faint);
    }

    .search-input:focus {
        outline: none;
    }

.search-meta {
    color: var(--ink-soft);
    margin-bottom: 20px;
    font-size: .95rem;
}

/* Row list */
.row-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.row-post {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease;
}

    .row-post:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

.row-link {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 22px;
    color: var(--ink);
}

    .row-link:hover {
        color: var(--ink);
    }

.row-thumb {
    flex: 0 0 auto;
    width: 84px;
    height: 84px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background-color: var(--surface-alt);
}

    .row-thumb img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .row-thumb.is-empty {
        background: var(--surface-alt);
    }

.row-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.row-title {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.2rem;
}

.row-excerpt {
    color: var(--ink-soft);
    font-size: .98rem;
}

.row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--ink-faint);
    font-size: .85rem;
    margin-top: 4px;
}

.row-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.row-arrow {
    flex: 0 0 auto;
    color: var(--ink-faint);
    transition: transform .15s ease, color .15s ease;
}

.row-post:hover .row-arrow {
    color: var(--ember);
    transform: translateX(3px);
}

/* ---- Category sections (categories-latest-post) -------------------------- */
.cat-section {
    padding-block: 36px;
}

    .cat-section + .cat-section {
        border-top: 1px solid var(--border);
    }

.cat-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

    .cat-head h2 {
        font-size: 1.6rem;
        margin: 0;
    }

.cat-all {
    font-weight: 600;
    font-size: .92rem;
    white-space: nowrap;
}

.cat-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 24px;
}

.cat-feature {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}

    .cat-feature:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-md);
    }

.cat-feature-link {
    display: block;
    padding: 0 22px 22px;
    color: var(--ink);
}

    .cat-feature-link:hover {
        color: var(--ink);
    }

.cat-feature-img {
    display: block;
    margin: 0 -22px 18px;
    height: 180px;
    overflow: hidden;
    background-color: var(--surface-alt);
}

    .cat-feature-img img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .cat-feature-img.is-empty {
        background: var(--surface-alt);
    }

.cat-feature-title {
    font-size: 1.3rem;
    margin: 18px 0 8px;
}

.cat-feature-excerpt {
    color: var(--ink-soft);
    font-size: .98rem;
    margin: 0 0 14px;
}

.cat-feature-meta {
    color: var(--ink-faint);
    font-size: .85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cat-mini {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mini-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-soft);
    color: var(--ink);
}

    .mini-link:last-child {
        border-bottom: 0;
    }

    .mini-link:hover {
        color: var(--ink);
    }

.mini-thumb {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background-color: var(--surface-alt);
}

    .mini-thumb img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .mini-thumb.is-empty {
        background: var(--surface-alt);
    }

.mini-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mini-title {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.3;
}

.mini-link:hover .mini-title {
    color: var(--ember);
}

.mini-date {
    color: var(--ink-faint);
    font-size: .82rem;
}

/* ---- Article / document layout ------------------------------------------ */
.doc {
    padding-block: 48px;
}

.doc-header {
    margin-bottom: 28px;
}

    .doc-header h1 {
        font-size: clamp(2rem, 5vw, 2.9rem);
        margin: 12px 0;
    }

.breadcrumbs {
    font-size: .9rem;
    color: var(--ink-faint);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

    .breadcrumbs a {
        color: var(--ink-soft);
    }

        .breadcrumbs a:hover {
            color: var(--ember);
        }

    .breadcrumbs .sep {
        color: var(--ink-faint);
    }

.crumb-current {
    color: var(--ink);
}

.doc-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    color: var(--ink-faint);
    font-size: .9rem;
}

.doc-meta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.content-cover-image {
    margin: 0 0 32px;
}

    .content-cover-image img {
        width: 100%;
        border-radius: var(--radius);
        border: 1px solid var(--border);
        display: block;
    }

/* Split layout with sidebar */
.doc-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 48px;
    align-items: start;
}

/* ---- Prose (rendered markdown) ------------------------------------------ */
.prose {
    font-size: 1.06rem;
    line-height: 1.75;
    color: var(--ink);
}

    .prose > *:first-child {
        margin-top: 0;
    }

    .prose > *:last-child {
        margin-bottom: 0;
    }

    .prose h1, .prose h2, .prose h3, .prose h4 {
        margin-top: 1.8em;
        margin-bottom: .5em;
    }

    .prose h1 {
        font-size: 2rem;
    }

    .prose h2 {
        font-size: 1.6rem;
        padding-bottom: .25em;
        border-bottom: 1px solid var(--border);
    }

    .prose h3 {
        font-size: 1.3rem;
    }

    .prose h4 {
        font-size: 1.1rem;
    }

    .prose p {
        margin: 0 0 1.2em;
    }

    .prose a {
        text-decoration: underline;
        text-underline-offset: 2px;
        text-decoration-color: var(--ember-soft);
    }

        .prose a:hover {
            text-decoration-color: var(--ember);
        }

    .prose ul, .prose ol {
        margin: 0 0 1.2em;
        padding-left: 1.5em;
    }

    .prose li {
        margin-bottom: .4em;
    }

        .prose li::marker {
            color: var(--ember);
        }

    .prose img {
        border-radius: var(--radius-sm);
        border: 1px solid var(--border);
        margin-block: 1em;
    }

    .prose blockquote {
        margin: 1.5em 0;
        padding: 4px 0 4px 22px;
        border-left: 3px solid var(--ember);
        color: var(--ink-soft);
        font-style: italic;
    }

        .prose blockquote p:last-child {
            margin-bottom: 0;
        }

    /* Inline code */
    .prose :not(pre) > code {
        font-family: var(--mono);
        font-size: .88em;
        background: var(--surface-alt);
        color: var(--ember-dark);
        padding: .15em .4em;
        border-radius: 6px;
        border: 1px solid var(--border);
    }

    /* Code block — highlight.js handles colors; we set font + chrome only */
    .prose pre {
        margin: 1.5em 0;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border);
        overflow: auto;
    }

        .prose pre code,
        .prose pre code.hljs {
            display: block;
            font-family: var(--mono);
            font-size: .92rem;
            line-height: 1.6;
            padding: 18px 20px;
            background: transparent;
            border: 0;
            color: inherit;
        }

    /* Tables */
    .prose table {
        width: 100%;
        border-collapse: collapse;
        margin: 1.5em 0;
        font-size: .98rem;
    }

    .prose th, .prose td {
        padding: 10px 14px;
        border: 1px solid var(--border);
        text-align: left;
    }

    .prose thead th {
        background: var(--surface-alt);
        font-family: var(--serif);
    }

    .prose tbody tr:nth-child(even) {
        background: rgba(239, 230, 216, .35);
    }

/* ---- Markdown source toggle — View Content / View Markdown --------------- */
/* Fixed structure emitted by the engine (ArticleTools) and shared by every
   theme: a .md-toolbar of two buttons, #post_content, and a hidden
   #post_markdown textarea. Style only — the markup is owned by the backend. */
.md-toolbar {
    display: flex;
    gap: 8px;
    margin: 0 0 18px;
}

    .md-toolbar button {
        font-family: var(--sans);
        font-size: .82rem;
        padding: 7px 16px;
        color: var(--ink);
        background: var(--surface-alt);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        cursor: pointer;
        transition: background .12s, color .12s, border-color .12s;
    }

        .md-toolbar button:hover {
            background: var(--ember-soft);
            border-color: var(--ember);
            color: var(--ember-dark);
        }

#post_markdown textarea {
    width: 100%;
    height: 75vh;
    font-family: var(--mono);
    font-size: .9rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    resize: vertical;
}

/* ---- 404 ----------------------------------------------------------------- */
.error-code {
    font-family: var(--serif);
    font-size: clamp(4rem, 18vw, 8rem);
    font-weight: 700;
    color: var(--ember);
    line-height: 1;
}

.error-sub {
    color: var(--ink-soft);
    font-size: 1.1rem;
    max-width: 520px;
    margin: 12px auto 28px;
}

.error-actions .btn {
    margin: 4px;
}

/* ---- Footer -------------------------------------------------------------- */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    margin-top: 64px;
    padding-block: 40px 28px;
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 28px;
}

.footer-col {
    color: var(--ink-soft);
    font-size: .95rem;
}

    .footer-col p {
        margin: 0 0 .5em;
    }

    .footer-col a {
        color: var(--ink-soft);
    }

        .footer-col a:hover {
            color: var(--ember);
        }

.footer-inner {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.footer-meta {
    color: var(--ink-faint);
    font-size: .88rem;
}

/* ==========================================================================
   Mobile  (≤ 860px)
   ========================================================================== */
@media (max-width: 860px) {
    .cat-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .doc-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 720px) {
    body {
        font-size: 16px;
    }

    .container {
        padding-inline: 18px;
    }

    .section {
        padding-block: 40px;
    }

    .hero {
        padding-block: 48px 40px;
    }

    /* Sticky header sits above the overlay (z 40) and the sliding nav (z 45) */
    .site-header {
        position: sticky;
        top: 0;
        z-index: 60;
    }

    /* Toggle button must stay above the nav panel so it's tappable when open */
    .nav-toggle {
        display: inline-flex;
        position: relative;
        z-index: 70;
    }

    /* Slide-in nav panel */
    .site-nav {
        position: fixed;
        top: 0;
        right: 0;
        height: 100dvh;
        width: min(78vw, 320px);
        background: var(--surface);
        border-left: 1px solid var(--border);
        box-shadow: -8px 0 30px rgba(43, 37, 32, .12);
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: calc(var(--header-h) + 16px) 20px 24px;
        transform: translateX(100%);
        transition: transform .25s ease;
        z-index: 45;
        overflow-y: auto;
    }
        /* .is-open toggled by toggleNav() in site.js */
        .site-nav.is-open {
            transform: translateX(0);
        }

        .site-nav a {
            padding: 12px 14px;
            border-radius: var(--radius-sm);
            font-size: 1.05rem;
        }

    .nav-overlay.is-open {
        display: block;
    }

    .section-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .row-link {
        padding: 16px;
        gap: 14px;
    }

    .row-thumb {
        width: 64px;
        height: 64px;
    }

    .footer-cols {
        grid-template-columns: 1fr;
    }
}


/* ===== Article aside — recent posts ===== */
.aside-heading {
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-soft);
}

.reclist {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rec-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
    color: var(--ink);
}

    .rec-item:last-child .rec-link {
        border-bottom: 0;
    }

    .rec-link:hover {
        color: var(--ink);
    }

.rec-thumb {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background-color: var(--surface-alt);
}

    .rec-thumb img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.rec-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.rec-title {
    font-family: var(--serif);
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.3;
}

.rec-link:hover .rec-title {
    color: var(--ember);
}

.rec-date {
    font-size: .78rem;
    color: var(--ink-faint);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ===== Pagination (paged latest-post listing) ===== */
.pagination{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:center;
    gap:.5rem;
    margin:3rem 0 .5rem;
    font-family:var(--sans);
}
.pagination-pages{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:.4rem;
}
.pagination-prev,
.pagination-next,
.pagination-page{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:.45em;
    min-width:2.5em;
    height:2.5em;
    padding:0 .9em;
    border:1px solid var(--border);
    border-radius:var(--radius-sm);
    background:var(--surface);
    color:var(--ink-soft);
    text-decoration:none;
    box-shadow:var(--shadow-sm);
    line-height:1;
    transition:color .15s ease, border-color .15s ease, background-color .15s ease;
}
.pagination-prev:hover,
.pagination-next:hover,
.pagination-page:hover{
    color:var(--ember);
    border-color:var(--ember);
}
.pagination-page.is-active{
    background:var(--ember);
    border-color:var(--ember);
    color:#fff;
    font-weight:600;
    box-shadow:none;
}
.pagination-prev.is-disabled,
.pagination-next.is-disabled{
    opacity:.45;
    pointer-events:none;
    box-shadow:none;
}
.pagination-gap{
    padding:0 .25em;
    color:var(--ink-faint);
}