/* Leaf KDE–inspired palette (https://github.com/qewer33/leaf-kde) */

:root {
    --leaf-accent: #729b79;
    --leaf-accent-hover: #628a69;
    --leaf-accent-muted: #80af88;
    --leaf-link: #0095b3;
    --leaf-link-hover: #008099;
    --leaf-highlight: #88c0d0;
    --leaf-positive: #729b79;
    --leaf-negative: #da4453;
    --leaf-neutral: #4ac6ff;

    /* Theme default: Newsreader for content; Ghost Brand → heading/body overrides via {{ghost_head}}. */
    --gh-font-heading: "Newsreader", Georgia, "Times New Roman", serif;
    --gh-font-body: "Newsreader", Georgia, "Times New Roman", serif;
    --leaf-font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;

    --leaf-radius: 6px;
    --leaf-radius-lg: 14px;
    --leaf-max-width: 42rem;
    --leaf-wide-width: 64rem;
    --leaf-space: 1.5rem;
    --leaf-header-height: 4rem;
    --leaf-sidebar-width: 18rem;
    --leaf-nav-tab-size: 2rem;
    --leaf-nav-tab-offset: calc(var(--leaf-space) * 3.25);
    --leaf-nav-tab-collapse-offset: calc(var(--leaf-space) * 3.25);

    --leaf-font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --leaf-line-body: 1.7;
    --leaf-line-display: 1.15;
    --leaf-heading-weight: 500;
}

:root[data-color-scheme="light"] {
    color-scheme: light;
    --leaf-bg: #e1e4dc;
    --leaf-bg-alt: #d3d6ce;
    --leaf-bg-elevated: #f5f6f2;
    --leaf-text: #2e2c2f;
    --leaf-text-muted: #565258;
    --leaf-border: #c5c8c0;
    --leaf-code-bg: #d3d6ce;
}

:root[data-color-scheme="dark"] {
    color-scheme: dark;
    --leaf-bg: #2e2c2f;
    --leaf-bg-alt: #29282a;
    --leaf-bg-elevated: #363438;
    --leaf-text: #e1e4dc;
    --leaf-text-muted: #a6acb6;
    --leaf-border: #3d3b3e;
    --leaf-code-bg: #29282a;
}

@media (prefers-color-scheme: light) {
    :root:not([data-color-scheme="light"]):not([data-color-scheme="dark"]) {
        color-scheme: light;
        --leaf-bg: #e1e4dc;
        --leaf-bg-alt: #d3d6ce;
        --leaf-bg-elevated: #f5f6f2;
        --leaf-text: #2e2c2f;
        --leaf-text-muted: #565258;
        --leaf-border: #c5c8c0;
        --leaf-code-bg: #d3d6ce;
    }
}

@media (prefers-color-scheme: dark) {
    :root:not([data-color-scheme="light"]):not([data-color-scheme="dark"]) {
        color-scheme: dark;
        --leaf-bg: #2e2c2f;
        --leaf-bg-alt: #29282a;
        --leaf-bg-elevated: #363438;
        --leaf-text: #e1e4dc;
        --leaf-text-muted: #a6acb6;
        --leaf-border: #3d3b3e;
        --leaf-code-bg: #29282a;
    }
}

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

html {
    font-size: 106.25%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--gh-font-body);
    font-weight: 400;
    line-height: var(--leaf-line-body);
    color: var(--leaf-text);
    background-color: var(--leaf-bg);
    font-optical-sizing: auto;
}

:is(h1, h2, h3, h4, h5, h6) {
    font-family: var(--gh-font-heading);
    font-weight: var(--leaf-heading-weight);
    letter-spacing: 0;
    line-height: var(--leaf-line-display);
    text-wrap: balance;
}

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

a {
    color: var(--leaf-link);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}

a:hover {
    color: var(--leaf-link-hover);
}

.site-wrapper {
    min-width: 0;
    min-height: 100vh;
    overflow-x: clip;
}

.site-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-body {
    display: flex;
    flex: 1;
    min-width: 0;
    min-height: 0;
}

.site-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--leaf-text);
    font-family: var(--gh-font-body);
    font-size: 1.0625rem;
    font-weight: var(--leaf-heading-weight);
    line-height: 1.1;
    text-decoration: none;
}

.site-brand:hover {
    color: var(--leaf-text);
}

.site-brand--compact {
    min-width: 0;
    flex-shrink: 0;
}

.site-brand--sidebar {
    min-width: 0;
}

.site-brand__logo {
    width: auto;
    max-height: 2.25rem;
}

.site-brand__icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    object-fit: cover;
}

.site-brand--icon-only .site-brand__icon {
    width: 32px;
    height: 32px;
}

.site-chrome {
    position: sticky;
    top: 0;
    z-index: 55;
    flex-shrink: 0;
}

.site-chrome__header {
    display: block;
}

.site-chrome__bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: var(--leaf-header-height);
    padding: 0 var(--leaf-space);
    border-bottom: 1px solid var(--leaf-border);
    background: color-mix(in srgb, var(--leaf-bg) 92%, transparent);
    -webkit-backdrop-filter: saturate(1.2) blur(10px);
    backdrop-filter: saturate(1.2) blur(10px);
}

.site-chrome__brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    margin-right: auto;
}

.site-chrome__tagline {
    display: none;
    margin: 0;
    min-width: 0;
    font-family: var(--leaf-font-ui);
    font-size: 0.8125rem;
    line-height: 1.35;
    color: var(--leaf-text-muted);
}

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

.site-chrome__search {
    flex-shrink: 0;
}

.site-sidebar {
    position: relative;
    z-index: 50;
    flex: 0 0 auto;
    width: 0;
    overflow: hidden;
}

.site-sidebar__panel {
    font-family: var(--leaf-font-ui);
}

.site-sidebar__head {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.site-sidebar__search--desktop {
    display: none;
    flex-shrink: 0;
}

.site-sidebar__description {
    display: none;
    margin: 0 0 1.25rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--leaf-text-muted);
}

.site-sidebar__tab {
    display: none;
    position: fixed;
    z-index: 54;
    top: calc(var(--leaf-header-height) + var(--leaf-nav-tab-offset));
    place-items: center;
    width: var(--leaf-nav-tab-size);
    height: var(--leaf-nav-tab-size);
    padding: 0;
    border: 1px solid var(--leaf-border);
    background: color-mix(in srgb, var(--leaf-bg-alt) 40%, var(--leaf-bg));
    color: var(--leaf-text-muted);
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        color 0.15s ease,
        background-color 0.15s ease,
        left 0.22s ease,
        transform 0.22s ease;
}

.site-sidebar__tab:hover {
    border-color: color-mix(in srgb, var(--leaf-accent) 45%, var(--leaf-border));
    color: var(--leaf-text);
}

.site-sidebar__tab--expand {
    left: 0;
    border-left: 0;
    border-radius: 0 var(--leaf-radius) var(--leaf-radius) 0;
    box-shadow: 0.25rem 0 0.75rem color-mix(in srgb, #000 10%, transparent);
}

.site-sidebar__tab--collapse {
    left: var(--leaf-sidebar-width);
    border-right: 0;
    border-radius: var(--leaf-radius) 0 0 var(--leaf-radius);
    box-shadow: -0.25rem 0 0.75rem color-mix(in srgb, #000 10%, transparent);
    transform: translateX(-100%);
}

.site-sidebar__read-hint {
    margin: 0 0 1rem;
    padding: 0.65rem 0.75rem;
    border: 1px dashed color-mix(in srgb, var(--leaf-accent) 35%, var(--leaf-border));
    border-radius: var(--leaf-radius);
    background: color-mix(in srgb, var(--leaf-accent) 8%, transparent);
}

.site-sidebar__read-hint-text {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--leaf-text);
}

.site-sidebar__read-hint-dismiss {
    padding: 0.15rem 0.45rem;
    border: 1px solid var(--leaf-border);
    border-radius: var(--leaf-radius);
    background: transparent;
    color: var(--leaf-text-muted);
    font-family: var(--leaf-font-ui);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

.site-sidebar__read-hint-dismiss:hover {
    border-color: color-mix(in srgb, var(--leaf-accent) 40%, var(--leaf-border));
    color: var(--leaf-text);
}

.site-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    font-size: 0.875rem;
}

.site-nav .nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav .nav a,
.site-nav__link {
    display: block;
    padding: 0.35rem 0;
    color: color-mix(in srgb, var(--leaf-text) 62%, var(--leaf-text-muted));
    text-decoration: none;
    transition: color 0.15s ease;
}

.site-nav .nav a:hover,
.site-nav .nav-current a,
.site-nav__link:hover {
    color: var(--leaf-text);
}

.site-nav__members {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding-top: 0.5rem;
}

.site-sidebar__recent {
    margin-top: 1.75rem;
}

.site-sidebar__recent-title {
    margin: 0 0 0.65rem;
    font-family: var(--leaf-font-ui);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1.3;
    text-transform: uppercase;
    color: var(--leaf-text-muted);
}

.site-sidebar__recent-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-sidebar__recent-item + .site-sidebar__recent-item {
    margin-top: 0.35rem;
}

.site-sidebar__recent-link {
    display: block;
    font-family: var(--gh-font-heading);
    font-size: 0.9375rem;
    font-weight: var(--leaf-heading-weight);
    line-height: 1.35;
    color: var(--leaf-text);
    text-decoration: none;
}

.site-sidebar__recent-link:hover {
    color: var(--leaf-accent);
}

.site-sidebar__subscribe {
    margin-top: 1.35rem;
    padding-top: 1.35rem;
    border-top: 1px solid var(--leaf-border);
}

.site-sidebar__subscribe .subscribe-form {
    max-width: none;
}

.site-sidebar__subscribe .subscribe-form__row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.site-sidebar__subscribe .subscribe-form__input {
    width: 100%;
    padding: 0.35rem 0 0.5rem;
    border-bottom: 1px dashed color-mix(in srgb, var(--leaf-accent) 35%, var(--leaf-border));
    font-size: 0.875rem;
}

.site-sidebar__subscribe .subscribe-form__row:focus-within .subscribe-form__input {
    border-bottom-color: color-mix(in srgb, var(--leaf-accent) 55%, var(--leaf-border));
}

.site-sidebar__subscribe .subscribe-form__button {
    width: 100%;
}

.site-sidebar__subscribe .subscribe-form__upgrade {
    width: 100%;
}

.site-sidebar__subscribed--inline {
    margin-top: 0.75rem;
}

.newsletter-signup .subscribe-form__upgrade {
    width: 100%;
}

.site-sidebar__subscribe-note {
    margin: 0.65rem 0 0;
    font-size: 0.6875rem;
    line-height: 1.45;
    color: var(--leaf-text-muted);
}

.site-sidebar__subscribed {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--leaf-text-muted);
}

.site-sidebar__subscribed .leaf-icon {
    color: var(--leaf-accent);
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.site-sidebar__subscribed a {
    color: var(--leaf-text);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--leaf-accent) 45%, transparent);
    text-underline-offset: 0.15em;
}

.site-sidebar__subscribed a:hover {
    color: var(--leaf-accent-hover);
    text-decoration-color: var(--leaf-accent);
}

.site-sidebar__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    margin-top: auto;
    padding-top: 1.75rem;
    font-size: 0.75rem;
    color: var(--leaf-text-muted);
}

.site-sidebar__rss {
    color: var(--leaf-text-muted);
    text-decoration: none;
}

.site-sidebar__rss:hover {
    color: var(--leaf-accent);
}

.site-icon-button {
    display: inline-grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 0;
    border-radius: var(--leaf-radius);
    background: none;
    color: color-mix(in srgb, var(--leaf-text) 55%, var(--leaf-text-muted));
    cursor: pointer;
    line-height: 0;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.site-icon-button .leaf-icon {
    display: block;
}

.site-icon-button:hover {
    background: color-mix(in srgb, var(--leaf-text) 6%, transparent);
    color: var(--leaf-text);
}

.site-burger {
    place-items: center;
}

.site-burger__open,
.site-burger__close {
    grid-area: 1 / 1;
    display: grid;
    place-items: center;
    line-height: 0;
}

.site-burger__close {
    display: none;
}

@media (max-width: 860px) {
    .site-sidebar__panel {
        position: fixed;
        top: var(--leaf-header-height);
        bottom: 0;
        left: 0;
        z-index: 60;
        width: min(20rem, 88vw);
        padding: 1.25rem var(--leaf-space) 2rem;
        overflow-y: auto;
        border-right: 1px solid var(--leaf-border);
        background: var(--leaf-bg);
        box-shadow: 0.75rem 0 2rem color-mix(in srgb, #000 16%, transparent);
        visibility: hidden;
        transform: translateX(-100%);
        transition: transform 0.22s ease, visibility 0.22s;
    }

    .is-nav-open .site-sidebar__panel {
        visibility: visible;
        transform: none;
    }

    .is-nav-open .site-burger__open {
        display: none;
    }

    .is-nav-open .site-burger__close {
        display: grid;
    }
}

@media (min-width: 861px) {
    .site-chrome {
        display: none;
    }

    .site-body {
        min-height: 100vh;
    }

    html[data-nav-open="true"] .site-sidebar {
        width: var(--leaf-sidebar-width);
        transition: width 0.22s ease;
    }

    html[data-nav-open="false"] .site-sidebar {
        width: 0;
        transition: width 0.22s ease;
    }

    .site-sidebar {
        position: sticky;
        top: 0;
        align-self: flex-start;
        display: flex;
        flex-direction: column;
        height: 100vh;
        border-right: 1px solid var(--leaf-border);
        background: color-mix(in srgb, var(--leaf-bg-alt) 35%, var(--leaf-bg));
        transition: width 0.22s ease;
    }

    .site-sidebar__panel {
        display: flex;
        flex: 1;
        flex-direction: column;
        width: var(--leaf-sidebar-width);
        min-height: 0;
        height: 100%;
        padding: calc(var(--leaf-space) * 1.35) var(--leaf-space) calc(var(--leaf-space) * 1.25);
        overflow-x: hidden;
        overflow-y: auto;
    }

    .site-sidebar__head {
        display: flex;
    }

    .site-sidebar__search--desktop {
        display: inline-grid;
    }

    .site-sidebar__description {
        display: block;
    }

    .site-sidebar__tab--expand {
        top: var(--leaf-nav-tab-offset);
    }

    .site-sidebar__tab--collapse {
        top: var(--leaf-nav-tab-collapse-offset);
    }

    html[data-nav-open="false"] .site-sidebar__tab--expand {
        display: inline-grid;
    }

    html[data-nav-open="true"] .site-sidebar__tab--collapse {
        display: inline-grid;
    }

    html[data-nav-open="false"] .site-sidebar__panel {
        visibility: hidden;
    }

    html[data-nav-open="true"] .site-sidebar__panel {
        visibility: visible;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-sidebar,
    .site-sidebar__panel,
    .site-sidebar__tab {
        transition: none;
    }
}

.site-main {
    flex: 1;
    max-width: var(--leaf-wide-width);
    width: 100%;
    margin: 0 auto;
    padding: calc(var(--leaf-space) * 1.5) var(--leaf-space);
}

/* Footer newsletter */

.newsletter-signup {
    width: 100%;
    max-width: none;
    margin: calc(var(--leaf-space) * 2) 0 0;
    padding: calc(var(--leaf-space) * 2) var(--leaf-space);
    box-sizing: border-box;
    border-top: 1px dashed var(--leaf-border);
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--leaf-accent) 6%, transparent) 0,
        transparent 12rem
    );
}

.newsletter-signup__inner {
    max-width: 32rem;
    margin: 0 auto;
    text-align: center;
}

.newsletter-signup__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 1.25rem;
    border: 2px dashed color-mix(in srgb, var(--leaf-accent) 55%, var(--leaf-border));
    border-radius: 50%;
    color: var(--leaf-accent);
    background: color-mix(in srgb, var(--leaf-accent) 8%, var(--leaf-bg));
}

.newsletter-signup__icon-svg {
    width: 1.375rem;
    height: 1.375rem;
}

.newsletter-signup__title {
    margin: 0 0 0.75rem;
    font-family: var(--gh-font-heading);
    font-size: clamp(1.5rem, 4vw, 1.875rem);
    font-weight: var(--leaf-heading-weight);
    line-height: var(--leaf-line-display);
    letter-spacing: 0;
}

.newsletter-signup__text {
    margin: 0 0 1.5rem;
    font-family: var(--gh-font-body);
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--leaf-text-muted);
}

.newsletter-signup__action {
    text-align: left;
}

.newsletter-signup__action .subscribe-form {
    max-width: none;
    width: 100%;
}

.newsletter-signup .subscribe-form__row {
    padding: 0.35rem 0;
    border: 0;
    border-bottom: 1px dashed color-mix(in srgb, var(--leaf-accent) 35%, var(--leaf-border));
    border-radius: 0;
    background: transparent;
    transition: border-color 0.15s ease;
}

.newsletter-signup .subscribe-form__row:focus-within {
    border-bottom-color: color-mix(in srgb, var(--leaf-accent) 55%, var(--leaf-border));
}

.newsletter-signup__subscribed {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin: 0;
    font-size: 0.9375rem;
    color: var(--leaf-text-muted);
    text-align: center;
}

.newsletter-signup__subscribed .leaf-icon {
    color: var(--leaf-accent);
    flex-shrink: 0;
}

.newsletter-signup__subscribed a {
    color: var(--leaf-text);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--leaf-accent) 45%, transparent);
    text-underline-offset: 0.15em;
}

.newsletter-signup__subscribed a:hover {
    color: var(--leaf-accent-hover);
    text-decoration-color: var(--leaf-accent);
}

.newsletter-signup__note {
    margin: 0.9rem 0 0;
    font-family: var(--leaf-font-ui);
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--leaf-text-muted);
}

.site-footer {
    border-top: 1px solid var(--leaf-border);
    background: color-mix(in srgb, var(--leaf-bg) 90%, transparent);
    -webkit-backdrop-filter: saturate(1.2) blur(10px);
    backdrop-filter: saturate(1.2) blur(10px);
    font-family: var(--leaf-font-ui);
    font-size: 0.8125rem;
    color: var(--leaf-text-muted);
}

.site-footer__inner {
    max-width: var(--leaf-wide-width);
    margin: 0 auto;
    padding: 0.85rem var(--leaf-space);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem 1.25rem;
}

.site-footer__nav .nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer__nav .nav a {
    color: var(--leaf-text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.site-footer__nav .nav a:hover,
.site-footer__nav .nav-current a {
    color: var(--leaf-accent);
}

.site-footer__rss {
    color: var(--leaf-text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.site-footer__rss:hover {
    color: var(--leaf-accent);
}

.site-footer a {
    color: var(--leaf-text-muted);
}

.site-footer a:hover {
    color: var(--leaf-accent);
}

/* Buttons (header, hero subscribe, errors, editor cards) */

.leaf-btn,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0.65rem 1.25rem;
    border: 0;
    border-radius: 0;
    background: var(--leaf-accent);
    color: #fff;
    box-shadow: none;
    font-family: var(--leaf-font-ui);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.leaf-btn:hover,
.button:hover {
    background: var(--leaf-accent-hover);
    color: #fff;
}

.leaf-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.leaf-btn--compact {
    height: 2.35rem;
    padding: 0 1.1rem;
    line-height: 1;
}

.leaf-btn--large {
    font-size: 0.875rem;
    padding: 0.75rem 1.35rem;
}

.leaf-btn--ghost {
    border: 1px solid var(--leaf-border);
    background: transparent;
    color: var(--leaf-text);
}

.leaf-btn--ghost:hover {
    border-color: color-mix(in srgb, var(--leaf-text) 35%, var(--leaf-border));
    background: transparent;
    color: var(--leaf-text);
}

.leaf-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.subscribe-form {
    width: 100%;
    max-width: 30rem;
}

.subscribe-form__row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.35rem 0.35rem 0.35rem 0.9rem;
    border: 1px solid var(--leaf-border);
    border-radius: var(--leaf-radius);
    background: var(--leaf-bg-elevated);
    transition: border-color 0.15s ease;
}

.subscribe-form__row:focus-within {
    border-color: color-mix(in srgb, var(--leaf-accent) 45%, var(--leaf-border));
}

.subscribe-form__input {
    flex: 1;
    min-width: 0;
    align-self: center;
    padding: 0.5rem 0.25rem 0.5rem 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--leaf-text);
    font-family: var(--leaf-font-ui);
    font-size: 0.9375rem;
}

.subscribe-form__input::placeholder {
    color: var(--leaf-text-muted);
}

.subscribe-form__button {
    flex-shrink: 0;
}

.subscribe-form--large .subscribe-form__row {
    padding: 0.4rem 0.4rem 0.4rem 1rem;
}

.subscribe-form--large .subscribe-form__input {
    font-size: 1rem;
}

.subscribe-form__message {
    display: none;
    margin: 0.85rem 0 0;
    font-family: var(--leaf-font-ui);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.subscribe-form__message--success {
    display: none;
    align-items: center;
    gap: 0.5rem;
    color: var(--leaf-text-muted);
}

.subscribe-form__message--success .leaf-icon {
    color: var(--leaf-accent);
}

.subscribe-form__message--error {
    color: var(--leaf-negative);
}

.subscribe-form.success .subscribe-form__row {
    display: none;
}

.subscribe-form.success .subscribe-form__message--success {
    display: flex;
    margin-top: 0;
}

.subscribe-form.error .subscribe-form__message--error {
    display: block;
}

.subscribe-form__portal-link {
    margin: 0.45rem 0 0;
    font-family: var(--leaf-font-ui);
    font-size: 0.75rem;
    line-height: 1.45;
}

.site-sidebar__subscribe-note + .subscribe-form__portal-link,
.newsletter-signup__note + .subscribe-form__portal-link {
    margin-top: 0.35rem;
}

.subscribe-form__portal-link a {
    color: var(--leaf-text-muted);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--leaf-link) 35%, transparent);
    text-underline-offset: 0.15em;
}

.subscribe-form__portal-link a:hover {
    color: var(--leaf-link);
    text-decoration-color: var(--leaf-link);
}

.newsletter-signup .subscribe-form__portal-link {
    text-align: center;
}

@media (max-width: 480px) {
    .subscribe-form__row {
        flex-direction: column;
        align-items: stretch;
        padding: 0.65rem;
    }

    .subscribe-form__input {
        width: 100%;
        padding: 0.25rem 0;
    }

    .subscribe-form__button {
        width: 100%;
    }
}

/* Homepage mobile intro (tagline + subscribe) */

.home-mobile-intro {
    display: none;
}

@media (max-width: 40rem) {
    .home-mobile-intro {
        display: block;
        margin: 0 calc(var(--leaf-space) * -1) var(--leaf-space);
        padding: 0 var(--leaf-space) var(--leaf-space);
        border-bottom: 1px dashed var(--leaf-border);
        font-family: var(--leaf-font-ui);
    }

    .home-mobile-intro__description {
        margin: 0 0 1rem;
        font-size: 0.8125rem;
        line-height: 1.45;
        color: var(--leaf-text-muted);
    }

    .home-mobile-intro .site-sidebar__subscribe {
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }

    .home-mobile-intro:not(:has(.site-sidebar__subscribe)) .home-mobile-intro__description {
        margin-bottom: 0;
    }

    .home-mobile-intro:not(:has(.home-mobile-intro__description)):not(:has(.site-sidebar__subscribe)) {
        display: none;
        margin: 0;
        padding: 0;
        border: 0;
    }
}

.home-posts__title {
    margin: 0 0 calc(var(--leaf-space) * 1.25);
    font-family: var(--leaf-font-ui);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--leaf-text-muted);
}

.button--ghost {
    border: 1px solid var(--leaf-border);
    background: transparent;
    color: var(--leaf-text);
    box-shadow: none;
}

.button--ghost:hover {
    border-color: color-mix(in srgb, var(--leaf-text) 35%, var(--leaf-border));
    background: transparent;
    color: var(--leaf-text);
}

/* Index */

.page-head {
    max-width: var(--leaf-max-width);
    margin-bottom: calc(var(--leaf-space) * 2);
}

.page-head__title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.625rem, 4vw, 2.125rem);
    font-weight: var(--leaf-heading-weight);
    letter-spacing: 0;
    line-height: var(--leaf-line-display);
}

.page-head__description {
    margin: 0;
    color: var(--leaf-text-muted);
    font-size: 1.0625rem;
    line-height: 1.55;
}

.post-feed {
    display: flex;
    flex-direction: column;
    gap: calc(var(--leaf-space) * 1.25);
}

.post-card {
    position: relative;
    padding-bottom: calc(var(--leaf-space) * 1.25);
    border-bottom: 1px dashed var(--leaf-border);
    cursor: pointer;
}

.post-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Lead card (first item on page 1) */

.post-card--lead {
    padding-bottom: calc(var(--leaf-space) * 1.75);
    margin-bottom: calc(var(--leaf-space) * 0.5);
    border-bottom: 1px dashed var(--leaf-border);
    cursor: default;
}

.home-lead__title {
    margin: 0 0 var(--leaf-space);
    font-size: clamp(1.625rem, 4vw, 2.25rem);
    font-weight: var(--leaf-heading-weight);
    line-height: var(--leaf-line-display);
    letter-spacing: 0;
}

.home-lead__title a {
    color: inherit;
    text-decoration: none;
}

.home-lead__title a:hover {
    color: var(--leaf-accent);
}

.home-lead__excerpt {
    margin: 0 0 var(--leaf-space);
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--leaf-text-muted);
}

.home-lead__read {
    margin: 0;
    font-family: var(--leaf-font-ui);
    font-size: 0.875rem;
    font-weight: 600;
}

.home-lead__read a {
    color: var(--leaf-accent);
    text-decoration: none;
}

.home-lead__read a:hover {
    text-decoration: underline;
}

.home-stream {
    margin: 0 calc(var(--leaf-space) * -1);
    padding: 0 var(--leaf-space);
}

.home-issues .post-feed--stream {
    gap: calc(var(--leaf-space) * 1.25);
}

.post-card__meta {
    margin: 0 0 0.5rem;
    font-family: var(--leaf-font-ui);
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--leaf-text-muted);
}

.post-card__meta a {
    position: relative;
    z-index: 2;
    color: var(--leaf-text-muted);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--leaf-text-muted) 45%, transparent);
    text-underline-offset: 0.14em;
}

.post-card__meta a:hover {
    color: var(--leaf-accent);
    text-decoration-color: var(--leaf-accent);
}

.post-card__meta-sep,
.article-meta__sep {
    opacity: 0.65;
}

.article-meta__sep {
    margin-inline: 0.45em;
}

.issue-number,
.post-card__kind {
    font-family: var(--leaf-font-mono);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--leaf-accent);
}

.post-card__title {
    margin: 0 0 0.5rem;
    font-size: 1.375rem;
    font-weight: var(--leaf-heading-weight);
    letter-spacing: 0;
    line-height: var(--leaf-line-display);
}

.post-card__title a {
    color: var(--leaf-text);
    text-decoration: none;
    transition: color 0.15s ease;
}

.post-card__title a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.post-card:hover .post-card__title a {
    color: var(--leaf-accent-hover);
}

.post-card__excerpt {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--leaf-text-muted);
}

/* Single post / page */

.article {
    width: 100%;
    max-width: var(--leaf-max-width);
    margin-inline: auto;
}

.article-header {
    margin-bottom: calc(var(--leaf-space) * 1.25);
}

.article-meta--header {
    margin: 0 0 calc(var(--leaf-space) * 0.85);
    line-height: 1.5;
}

.article-header__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.article-header__title-row .article-share {
    flex-shrink: 0;
    margin: 0;
}

.article-title {
    flex: 1;
    min-width: min(100%, 16rem);
    margin: 0;
    font-size: clamp(1.75rem, 4.5vw, 2.375rem);
    font-weight: var(--leaf-heading-weight);
    letter-spacing: 0;
    line-height: var(--leaf-line-display);
    /* Global h1–h6 use text-wrap: balance; avoid short balanced lines on long post titles */
    text-wrap: wrap;
}

.article-meta {
    font-family: var(--leaf-font-ui);
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--leaf-text-muted);
}

.article-meta a {
    color: var(--leaf-text-muted);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--leaf-text-muted) 45%, transparent);
    text-underline-offset: 0.14em;
}

.article-meta a:hover {
    color: var(--leaf-accent);
    text-decoration-color: var(--leaf-accent);
}

.article-excerpt {
    margin: calc(var(--leaf-space) * 1.25) 0 calc(var(--leaf-space) * 1.5);
    padding-bottom: calc(var(--leaf-space) * 1.35);
    border-bottom: 1px dashed color-mix(in srgb, var(--leaf-accent) 35%, var(--leaf-border));
    font-family: var(--gh-font-body);
    font-size: 1.25rem;
    font-style: italic;
    font-weight: 400;
    line-height: 1.5;
    color: var(--leaf-text-muted);
}

.article-header:has(.article-excerpt) + .gh-content {
    margin-top: calc(var(--leaf-space) * 0.35);
}

.article-header:has(.article-excerpt) + .feature-image {
    margin-top: calc(var(--leaf-space) * 0.35);
}

.feature-image {
    margin: 0 0 calc(var(--leaf-space) * 1.5);
    border-radius: var(--leaf-radius);
    overflow: hidden;
}

.feature-image img {
    display: block;
    width: 100%;
}

.article-footer {
    margin-top: calc(var(--leaf-space) * 2);
    padding-top: calc(var(--leaf-space) * 1.25);
    border-top: 1px dashed var(--leaf-border);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.65rem;
    margin: 0 0 calc(var(--leaf-space) * 1.25);
    padding: 0;
    list-style: none;
    font-family: var(--leaf-font-ui);
    font-size: 0.8125rem;
}

.article-tags__link {
    color: var(--leaf-text-muted);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--leaf-text-muted) 45%, transparent);
    text-underline-offset: 0.14em;
}

.article-tags__link:hover {
    color: var(--leaf-accent);
    text-decoration-color: var(--leaf-accent);
}

.article-footer .article-share {
    margin-bottom: calc(var(--leaf-space) * 1.25);
}

.article-share__status:not(.visually-hidden) {
    display: inline-block;
    margin-left: 0.75rem;
    font-family: var(--leaf-font-ui);
    font-size: 0.8125rem;
    color: var(--leaf-accent);
}

.article-adjacent {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem 1.5rem;
    margin-top: calc(var(--leaf-space) * 1.5);
    padding-top: calc(var(--leaf-space) * 1.25);
    border-top: 1px dashed var(--leaf-border);
    font-family: var(--leaf-font-ui);
}

.article-adjacent__spacer {
    flex: 1;
}

.article-adjacent__link {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-width: min(100%, 20rem);
    color: inherit;
    text-decoration: none;
}

.article-adjacent__link--next {
    margin-left: auto;
    text-align: right;
    align-items: flex-end;
}

.article-adjacent__cta {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--leaf-accent);
    line-height: 1.35;
}

.article-adjacent__link:hover .article-adjacent__cta {
    color: var(--leaf-accent-hover);
}

.article-adjacent__detail {
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--leaf-text-muted);
}

.article-comments {
    max-width: var(--leaf-max-width);
    margin-inline: auto;
    margin-top: calc(var(--leaf-space) * 2);
    padding-top: calc(var(--leaf-space) * 1.25);
    border-top: 1px dashed var(--leaf-border);
}

@media (max-width: 36rem) {
    .article-adjacent__link {
        max-width: 100%;
    }

    .article-adjacent__link--next {
        margin-left: 0;
        text-align: left;
        align-items: flex-start;
    }

    .article-adjacent__spacer {
        display: none;
    }
}

/* Ghost Koenig / prose */

.gh-content {
    font-size: 1.0625rem;
    line-height: var(--leaf-line-body);
}

.gh-content > * + * {
    margin-top: 1.25em;
}

.gh-content h1,
.gh-content h2,
.gh-content h3,
.gh-content h4 {
    line-height: var(--leaf-line-display);
    letter-spacing: 0;
    font-weight: var(--leaf-heading-weight);
}

.gh-content h2 {
    font-size: 1.4375rem;
    margin-top: 2em;
}

.gh-content h3 {
    font-size: 1.1875rem;
    margin-top: 1.75em;
}

/* Quote block: layout from theme.json; colors follow site color scheme on front. */
.gh-content .wp-block-quote {
    background-color: var(--leaf-bg-alt) !important;
    color: var(--leaf-text-muted) !important;
    border-left-color: var(--leaf-accent) !important;
}

.gh-content .wp-block-quote cite {
    color: var(--leaf-text-muted) !important;
}

.gh-content pre {
    overflow-x: auto;
    padding: 1em 1.25em;
    border-radius: var(--leaf-radius);
    background: var(--leaf-code-bg);
    font-family: var(--leaf-font-mono);
    font-size: 0.85em;
    line-height: 1.5;
}

.gh-content code {
    font-family: var(--leaf-font-mono);
    font-size: 0.9em;
    padding: 0.15em 0.35em;
    border-radius: 4px;
    background: var(--leaf-code-bg);
}

.gh-content pre code {
    padding: 0;
    background: none;
    font-size: inherit;
}

.gh-content hr {
    border: none;
    border-top: 1px solid var(--leaf-border);
    margin: 2.5em 0;
}

.gh-content figcaption {
    font-size: 0.875rem;
    color: var(--leaf-text-muted);
    text-align: center;
    margin-top: 0.5em;
}

.gh-content .kg-card {
    margin: 2em 0;
}

.gh-content .kg-width-wide {
    position: relative;
    width: min(90vw, calc(var(--leaf-max-width) + 12rem));
    max-width: none;
    margin-left: 50%;
    transform: translateX(-50%);
}

.gh-content .kg-width-full {
    position: relative;
    width: 100%;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    box-sizing: border-box;
}

.gh-content .kg-gallery-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gh-content .kg-gallery-row {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
}

.gh-content .kg-gallery-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--leaf-radius);
}

.gh-content .kg-bookmark-card {
    width: 100%;
}

.gh-content .kg-bookmark-container {
    display: flex;
    overflow: hidden;
    border: 1px solid var(--leaf-border);
    border-radius: var(--leaf-radius);
    background: var(--leaf-bg-elevated);
    color: inherit;
    text-decoration: none;
    min-height: 148px;
}

.gh-content .kg-bookmark-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 1rem 1.25rem;
    gap: 0.5rem;
}

.gh-content .kg-bookmark-title {
    font-family: var(--gh-font-body);
    font-weight: var(--leaf-heading-weight);
    font-size: 1rem;
    line-height: 1.25;
    letter-spacing: 0;
    color: var(--leaf-text);
}

.gh-content .kg-bookmark-description {
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--leaf-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gh-content .kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--leaf-text-muted);
    margin-top: auto;
}

.gh-content .kg-bookmark-icon {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 2px;
}

.gh-content .kg-bookmark-author,
.gh-content .kg-bookmark-publisher {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gh-content .kg-bookmark-thumbnail {
    flex-shrink: 0;
    width: 180px;
    min-height: 100%;
}

.gh-content .kg-bookmark-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gh-content .kg-button-card .kg-btn {
    background: var(--leaf-accent);
    color: var(--leaf-bg);
    border-radius: 0;
}

.gh-content .kg-button-card .kg-btn:hover {
    background: var(--leaf-accent-hover);
}

@media (max-width: 600px) {
    .gh-content .kg-bookmark-container {
        flex-direction: column;
    }

    .gh-content .kg-bookmark-thumbnail {
        width: 100%;
        height: 160px;
    }
}

/* Tag / author archive */

.archive-head {
    max-width: var(--leaf-max-width);
    margin-bottom: calc(var(--leaf-space) * 2);
}

.archive-head__identity {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.archive-head__avatar {
    flex-shrink: 0;
    width: 4.5rem;
    height: 4.5rem;
    border: 2px solid var(--leaf-border);
    border-radius: 50%;
    background: var(--leaf-bg-alt);
    object-fit: cover;
}

.archive-head__avatar--blank {
    display: block;
}

.archive-head__intro {
    flex: 1;
    min-width: 0;
}

.archive-head__title {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    font-weight: var(--leaf-heading-weight);
}

.archive-head--author .archive-head__title {
    margin: 0 0 0.35rem;
    line-height: var(--leaf-line-display);
}

.archive-head__count {
    margin: 0 0 0.5rem;
    color: var(--leaf-text-muted);
    font-size: 1.0625rem;
    line-height: 1.55;
}

.archive-head__count:last-child {
    margin-bottom: 0;
}

.archive-head__description {
    margin: 0;
    color: var(--leaf-text-muted);
    font-size: 1.0625rem;
    line-height: 1.55;
}

/* Pagination */

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem 1rem;
    margin: calc(var(--leaf-space) * 2) calc(var(--leaf-space) * -1) 0;
    padding: var(--leaf-space) var(--leaf-space) 0;
    border-top: 1px dashed var(--leaf-border);
    font-family: var(--leaf-font-ui);
    font-size: 0.875rem;
}

.pagination a {
    color: var(--leaf-accent);
    text-decoration: none;
    font-weight: 600;
}

.pagination a:hover {
    color: var(--leaf-accent-hover);
}

.pagination .page-number {
    color: var(--leaf-text-muted);
}

/* Error page */

.error-page {
    max-width: var(--leaf-max-width);
    text-align: center;
    padding: calc(var(--leaf-space) * 3) 0;
}

.error-page__code {
    margin: 0;
    font-size: 4rem;
    font-weight: 600;
    color: var(--leaf-accent);
    line-height: 1;
}

.error-page__message {
    margin: 1rem 0 1.5rem;
    color: var(--leaf-text-muted);
}

::selection {
    background: var(--leaf-accent);
    color: var(--leaf-bg);
}
