/* ==========================================================================
   BTQ Editorial — a serif editorial theme for Ghost
   1. Variables & base
   2. Layout containers
   3. Header & navigation
   4. Cover / hero
   5. Feed sections & post cards
   6. Article (post/page)
   7. Ghost content (.gh-content)
   8. Table of contents
   9. Taxonomy pages, archive, tags/authors cards
   10. Subscribe CTA & members forms
   11. Pagination & footer
   12. Dark scheme
   ========================================================================== */

/* 1. Variables & base
   ========================================================================== */

:root {
    --background-color: #e8e5e5;
    --font-serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --color-text: #191817;
    --color-secondary-text: rgba(25, 24, 23, 0.62);
    --color-border: rgba(25, 24, 23, 0.14);
    --color-surface: rgba(25, 24, 23, 0.04);

    --container: 1240px;
    --container-narrow: 740px;
    --gap: 4rem;
    --radius: 4px;
    --head-height: 72px;
}

html.has-light-text {
    --color-text: #f4f1ec;
    --color-secondary-text: rgba(244, 241, 236, 0.64);
    --color-border: rgba(244, 241, 236, 0.16);
    --color-surface: rgba(244, 241, 236, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }

html {
    font-size: 62.5%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--gh-font-body, var(--font-sans));
    font-size: 1.7rem;
    line-height: 1.65;
    color: var(--color-text);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--gh-font-heading, var(--font-serif));
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 0;
    text-wrap: balance;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
::selection { background: var(--color-text); color: var(--background-color); }

.line-horizontal {
    border-bottom: 1px solid var(--color-border);
    margin: 2.4rem 0;
}

/* 2. Layout containers
   ========================================================================== */

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main { flex: 1 0 auto; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 max(4vmin, 20px);
}

.container-narrow {
    width: 100%;
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 0 max(4vmin, 20px);
}

/* 3. Header & navigation
   ========================================================================== */

.gh-head {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--background-color);
    border-bottom: 1px solid var(--color-border);
    transition: box-shadow 0.2s ease;
}

.is-transparent-header .gh-head {
    border-bottom-color: transparent;
}

.is-transparent-header .gh-head.is-scrolled {
    border-bottom-color: var(--color-border);
}

.gh-head-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 3.2rem;
    height: var(--head-height);
}

.gh-head-logo { display: flex; align-items: center; }
.gh-head-logo img { max-height: 36px; width: auto; }

.gh-head-title {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    letter-spacing: -0.01em;
}

.gh-head-menu .nav {
    display: flex;
    align-items: center;
    gap: 2.8rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-link {
    font-size: 1.5rem;
    color: var(--color-secondary-text);
    transition: color 0.15s ease;
}

.nav-link:hover { color: var(--color-text); }

/* Dropdown submenus (built by main.js from "- item" labels) */
.nav-item { position: relative; }

.nav-item.has-dropdown > .nav-link::after {
    content: "";
    display: inline-block;
    margin-left: 0.6rem;
    width: 0.6rem;
    height: 0.6rem;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
}

.nav-dropdown {
    position: absolute;
    top: 100%;
    left: -1.6rem;
    min-width: 20rem;
    margin: 0;
    padding: 0.8rem 0;
    list-style: none;
    background: var(--background-color);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.nav-item.has-dropdown:hover .nav-dropdown,
.nav-item.has-dropdown:focus-within .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown .nav-link {
    display: block;
    padding: 0.8rem 1.6rem;
}

.gh-head-actions {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.gh-search {
    display: flex;
    align-items: center;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-text);
    cursor: pointer;
}

.gh-search svg { width: 18px; height: 18px; }

.gh-head-link {
    font-size: 1.5rem;
    color: var(--color-secondary-text);
}

.gh-head-link:hover { color: var(--color-text); }

.gh-head-btn {
    font-size: 1.5rem;
    padding: 0.8rem 1.8rem;
    background: var(--ghost-accent-color, var(--color-text));
    color: #fff;
    border-radius: 100px;
    transition: opacity 0.15s ease;
}

.gh-head-btn:hover { opacity: 0.85; }

/* Middle-logo variant */
.is-head-middle-logo .gh-head-inner {
    grid-template-columns: 1fr auto 1fr;
}

.is-head-middle-logo .gh-head-menu { order: -1; }
.is-head-middle-logo .gh-head-brand { justify-self: center; }
.is-head-middle-logo .gh-head-actions { justify-self: end; }

/* Burger + mobile menu */
.gh-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.gh-burger span {
    display: block;
    height: 1px;
    width: 22px;
    background: var(--color-text);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

@media (max-width: 900px) {
    .gh-head-inner {
        grid-template-columns: 1fr auto;
        gap: 1.6rem;
    }

    .gh-head-brand {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .gh-burger { display: flex; }

    .gh-head-menu {
        display: none;
        grid-column: 1 / -1;
    }

    .gh-head-actions { display: none; }

    .is-head-open .gh-head { min-height: 100vh; align-items: flex-start; }

    .is-head-open .gh-head-inner {
        grid-template-columns: 1fr;
        height: auto;
        padding-top: 1.8rem;
        padding-bottom: 4rem;
    }

    .is-head-open .gh-head-menu {
        display: block;
        margin-top: 4rem;
    }

    .is-head-open .gh-head-menu .nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
    }

    .is-head-open .nav-link { font-size: 2.4rem; font-family: var(--font-serif); color: var(--color-text); }
    .is-head-open .nav-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        border: 0;
        box-shadow: none;
        background: none;
        padding: 0.4rem 0 0 2rem;
    }
    .is-head-open .nav-dropdown .nav-link { font-size: 1.8rem; font-family: var(--font-sans); color: var(--color-secondary-text); }

    .is-head-open .gh-head-actions {
        display: flex;
        grid-column: 1 / -1;
        margin-top: 3.2rem;
    }

    .is-head-open .gh-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .is-head-open .gh-burger span:nth-child(2) { opacity: 0; }
    .is-head-open .gh-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

    .is-head-open body, body.is-head-open { overflow: hidden; }
}

/* 4. Cover / hero
   ========================================================================== */

.cover { padding: 10rem 0 4rem; }

.cover-inner { max-width: 82rem; }

.cover-title {
    font-size: clamp(4rem, 7vw, 7.2rem);
    line-height: 1.1;
}

.cover-desc {
    margin: 2.4rem 0 0;
    font-size: 2rem;
    color: var(--color-secondary-text);
    max-width: 56rem;
}

.hero { padding: 6rem 0 2rem; }

.hero-inner {
    display: grid;
    grid-template-columns: 5fr 6fr;
    gap: var(--gap);
    align-items: center;
    padding: clamp(2.4rem, 4vw, 4.8rem);
    border-radius: var(--radius);
    background-color: color-mix(in srgb, var(--card-accent, #999) 12%, var(--background-color));
}

/* Horizontal (landscape) hero variant: photo on top, text panel below */
.hero-horizontal .hero-inner { grid-template-columns: 1fr; gap: 0; padding: 0; overflow: hidden; }
.hero-horizontal .hero-image { aspect-ratio: 21 / 10; border-radius: 0; }
.hero-horizontal .hero-image-link { order: -1; }

.hero-horizontal .hero-content {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    grid-template-areas:
        "tag tag"
        "title excerpt"
        "title meta"
        "title more";
    column-gap: var(--gap);
    align-content: start;
    padding: clamp(2.4rem, 4vw, 4.8rem);
}

.hero-horizontal .hero-tag { grid-area: tag; }
.hero-horizontal .hero-title { grid-area: title; }
.hero-horizontal .hero-excerpt { grid-area: excerpt; margin-top: 1.6rem; }
.hero-horizontal .hero-meta { grid-area: meta; }
.hero-horizontal .hero-read-more { grid-area: more; justify-self: end; }

@media (max-width: 900px) {
    .hero-horizontal .hero-content {
        grid-template-columns: 1fr;
        grid-template-areas: "tag" "title" "excerpt" "meta" "more";
    }
    .hero-horizontal .hero-read-more { justify-self: start; }
}

.hero-tag,
.post-card-tag,
.article-tag,
.taxonomy-kicker {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-secondary-text);
}

.hero-tag:hover, .post-card-tag:hover, .article-tag:hover { color: var(--color-text); }

.hero-title {
    margin: 1.6rem 0 0;
    font-size: clamp(3rem, 4.5vw, 4.8rem);
}

.hero-title a:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

.hero-excerpt {
    margin: 2rem 0 0;
    font-size: 1.8rem;
    color: var(--color-secondary-text);
}

.hero-meta {
    margin-top: 2rem;
    font-size: 1.4rem;
    color: var(--color-secondary-text);
}

.hero-author { font-weight: 500; color: var(--color-text); }

.hero-read-more {
    display: inline-block;
    margin-top: 2.8rem;
    font-size: 1.5rem;
    font-weight: 500;
    border-bottom: 1px solid var(--color-text);
    padding-bottom: 0.2rem;
    transition: opacity 0.15s ease;
}

.hero-read-more:hover { opacity: 0.7; }

.hero-image {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--radius);
}

@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; gap: 3.2rem; }
    .hero-image-link { order: -1; }
    .cover { padding-top: 6rem; }
}

/* 5. Feed sections & post cards
   ========================================================================== */

.home-section { padding: 4.8rem 0; }

.feed-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 2rem;
    padding-bottom: 1.6rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 3.2rem;
}

.feed-title {
    font-size: 2.6rem;
    font-style: italic;
}

.feed-more {
    font-size: 1.4rem;
    color: var(--color-secondary-text);
}

.feed-more:hover { color: var(--color-text); }

.feed-grid {
    display: grid;
    gap: var(--gap) 3.2rem;
}

.feed-grid-3 { grid-template-columns: repeat(3, 1fr); }
.feed-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1000px) {
    .feed-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .feed-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .feed-grid-3, .feed-grid-4 { grid-template-columns: 1fr; }
}

.post-card { display: flex; flex-direction: column; }

.post-card-image-link { margin-bottom: 2rem; }

.post-card-image {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: var(--radius);
    transition: opacity 0.2s ease;
}

.post-card-image-link:hover .post-card-image { opacity: 0.9; }

.post-card-eyebrow {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1rem;
}

.post-card-visibility {
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.2rem 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: 100px;
    color: var(--color-secondary-text);
}

.post-card-title {
    font-size: 2.2rem;
    line-height: 1.3;
}

.post-card-title a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

.post-card-excerpt {
    margin: 1.2rem 0 0;
    font-size: 1.5rem;
    color: var(--color-secondary-text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    margin-top: 1.6rem;
    font-size: 1.3rem;
    color: var(--color-secondary-text);
}

.post-card-meta-divider { margin: 0 0.6rem; }

/* 6. Article (post/page)
   ========================================================================== */

.article { padding: 8rem 0 4rem; }

.article-header { text-align: center; }

.article-eyebrow { margin-bottom: 1.6rem; }

.article-title {
    font-size: clamp(3.2rem, 5vw, 5.2rem);
    line-height: 1.15;
}

.article-excerpt {
    margin: 2.4rem auto 0;
    max-width: 58rem;
    font-size: 1.9rem;
    color: var(--color-secondary-text);
}

.article-byline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    margin-top: 3.2rem;
}

.article-byline-authors {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.article-author-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.article-author-name { font-weight: 500; font-size: 1.5rem; }

.article-byline-meta {
    font-size: 1.4rem;
    color: var(--color-secondary-text);
}

.article-image { margin: 5.6rem auto 0; padding-left: 0; padding-right: 0; }

.article-image img {
    width: 100%;
    border-radius: var(--radius);
}

.article-image figcaption {
    margin-top: 1.2rem;
    text-align: center;
    font-size: 1.3rem;
    color: var(--color-secondary-text);
}

.article-body { margin-top: 5.6rem; }

.article-footer { margin-top: 4.8rem; }

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 3.2rem;
    border-top: 1px solid var(--color-border);
}

.article-tag-pill {
    font-size: 1.3rem;
    padding: 0.5rem 1.4rem;
    border: 1px solid var(--color-border);
    border-radius: 100px;
    color: var(--color-secondary-text);
    transition: all 0.15s ease;
}

.article-tag-pill:hover {
    color: var(--color-text);
    border-color: var(--color-text);
}

.article-comments { margin-top: 6.4rem; }

/* Full-image custom template */
.article-full-image { padding-top: 0; }

.article-full-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 72vh;
    background-size: cover;
    background-position: center;
}

.article-full-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 40%, rgba(0, 0, 0, 0.72) 100%);
}

.article-full-hero-content {
    position: relative;
    z-index: 1;
    padding-bottom: 6.4rem;
    text-align: center;
    color: #fff;
}

.article-full-hero-content .article-tag { color: rgba(255, 255, 255, 0.8); }
.article-full-hero-content .article-title { color: #fff; margin-top: 1.2rem; }
.article-full-hero-content .article-byline-meta { color: rgba(255, 255, 255, 0.8); margin-top: 2rem; }

/* 7. Ghost content
   ========================================================================== */

.gh-content > * + * { margin-top: 2.8rem; }

.gh-content h2 { font-size: 2.8rem; margin-top: 5.6rem; }
.gh-content h3 { font-size: 2.2rem; margin-top: 4.4rem; }
.gh-content h4 { font-size: 1.9rem; margin-top: 3.6rem; font-family: var(--font-sans); font-weight: 600; }

.gh-content p, .gh-content ul, .gh-content ol { font-size: 1.7rem; }

.gh-content a {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--color-secondary-text);
}

.gh-content a:hover { text-decoration-color: var(--color-text); }

.gh-content blockquote {
    margin: 3.2rem 0;
    padding: 0 0 0 2.4rem;
    border-left: 2px solid var(--color-text);
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 2rem;
    line-height: 1.5;
}

.gh-content blockquote.kg-blockquote-alt {
    border: 0;
    padding: 0;
    text-align: center;
    font-size: 2.6rem;
}

.gh-content hr {
    margin: 5.6rem auto;
    border: 0;
    border-top: 1px solid var(--color-border);
    width: 12rem;
}

.gh-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--color-surface);
    padding: 0.2em 0.5em;
    border-radius: 3px;
}

.gh-content pre {
    background: #1c1b1a;
    color: #eceae7;
    padding: 2.4rem;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 1.4rem;
    line-height: 1.6;
}

.gh-content pre code { background: none; padding: 0; font-size: inherit; }

.gh-content figcaption {
    margin-top: 1rem;
    text-align: center;
    font-size: 1.3rem;
    color: var(--color-secondary-text);
}

.gh-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.5rem;
}

.gh-content table th,
.gh-content table td {
    padding: 1rem 1.4rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}

.gh-content table th {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1.3rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Responsive tables: wrap wide tables for horizontal scroll (main.js) */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Wide & full-width cards escape the narrow column */
.kg-width-wide {
    position: relative;
    width: calc(100vw - max(8vmin, 40px));
    max-width: 1200px;
    left: 50%;
    transform: translateX(-50%);
}

.kg-width-full {
    position: relative;
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
}

.kg-width-full img { border-radius: 0; }

/* 8. Table of contents
   ========================================================================== */

.toc {
    margin-bottom: 4rem;
    padding: 2.4rem 2.8rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
}

.toc-heading {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-secondary-text);
    margin-bottom: 1.2rem;
}

.toc-list ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: toc;
}

.toc-list a {
    display: block;
    padding: 0.5rem 0;
    font-size: 1.5rem;
    color: var(--color-secondary-text);
}

.toc-list a:hover { color: var(--color-text); }

.toc-list .toc-h3 a { padding-left: 2rem; font-size: 1.4rem; }

/* 9. Taxonomy pages, archive, tags/authors cards
   ========================================================================== */

.taxonomy-header { padding: 8rem 0 0; text-align: center; }

.taxonomy-title { font-size: clamp(3.2rem, 5vw, 5rem); margin-top: 1.2rem; }

.taxonomy-desc {
    margin: 2rem auto 0;
    max-width: 56rem;
    font-size: 1.8rem;
    color: var(--color-secondary-text);
}

.taxonomy-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 2rem;
}

.taxonomy-links {
    display: flex;
    justify-content: center;
    gap: 2.4rem;
    margin-top: 2rem;
    font-size: 1.4rem;
    color: var(--color-secondary-text);
}

.taxonomy-links a:hover { color: var(--color-text); }

.taxonomy-header .line-horizontal { margin-top: 4.8rem; }

.error-page { padding-bottom: 10rem; }
.error-page .hero-read-more { margin-top: 3.2rem; }

.archive-list { padding: 4.8rem 0 8rem; }

.archive-item {
    display: grid;
    grid-template-columns: 14rem 1fr;
    gap: 2.4rem;
    align-items: baseline;
    padding: 1.6rem 0;
    border-bottom: 1px solid var(--color-border);
}

.archive-date { font-size: 1.4rem; color: var(--color-secondary-text); }

.archive-title { font-size: 2rem; }
.archive-title a:hover { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 640px) {
    .archive-item { grid-template-columns: 1fr; gap: 0.4rem; }
}

.tag-card, .author-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.tag-card:hover, .author-card:hover { border-color: var(--color-text); }

.tag-card-image { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }

.tag-card-content, .author-card-content { padding: 2.4rem; }

.tag-card-title, .author-card-name { font-size: 2.2rem; }

.tag-card-count, .author-card-count {
    margin: 0.8rem 0 0;
    font-size: 1.3rem;
    color: var(--color-secondary-text);
}

.author-card { flex-direction: row; align-items: center; gap: 0.8rem; }

.author-card-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: 2.4rem;
    flex-shrink: 0;
}

.author-card-bio {
    margin: 0.6rem 0 0;
    font-size: 1.4rem;
    color: var(--color-secondary-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 10. Subscribe CTA & members forms
   ========================================================================== */

.subscribe-cta {
    margin: 6.4rem 0 0;
    padding: 8rem 0;
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.subscribe-cta-heading { font-size: clamp(2.6rem, 4vw, 3.6rem); }

.subscribe-cta-desc {
    margin: 1.6rem auto 0;
    max-width: 44rem;
    font-size: 1.6rem;
    color: var(--color-secondary-text);
}

.subscribe-form { margin-top: 3.2rem; }

.form-fields {
    display: flex;
    justify-content: center;
    gap: 1rem;
    max-width: 44rem;
    margin: 0 auto;
}

.subscribe-input {
    flex: 1;
    min-width: 0;
    padding: 1.2rem 1.8rem;
    font-size: 1.5rem;
    font-family: inherit;
    color: var(--color-text);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 100px;
    outline: none;
}

.subscribe-input:focus { border-color: var(--color-text); }

.subscribe-button {
    padding: 1.2rem 2.6rem;
    font-size: 1.5rem;
    font-family: inherit;
    font-weight: 500;
    color: #fff;
    background: var(--ghost-accent-color, var(--color-text));
    border: 0;
    border-radius: 100px;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.subscribe-button:hover { opacity: 0.85; }

.form-message { display: none; margin-top: 2rem; font-size: 1.5rem; }

.subscribe-form.success .form-fields { display: none; }
.subscribe-form.success .form-message-success { display: block; }
.subscribe-form.error .form-message-error { display: block; color: #c0392b; }
.subscribe-form.loading .subscribe-button { opacity: 0.6; pointer-events: none; }

@media (max-width: 500px) {
    .form-fields { flex-direction: column; }
}

/* 11. Pagination & footer
   ========================================================================== */

.pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding-top: 2.4rem;
    padding-bottom: 6.4rem;
    font-size: 1.5rem;
}

.pagination a { color: var(--color-secondary-text); }
.pagination a:hover { color: var(--color-text); }
.pagination-location { color: var(--color-secondary-text); font-size: 1.3rem; }
.pagination-next { text-align: right; }

.gh-foot {
    border-top: 1px solid var(--color-border);
    padding: 6.4rem 0 3.2rem;
    margin-top: 4.8rem;
}

.gh-foot-top {
    display: flex;
    justify-content: space-between;
    gap: 4.8rem;
    flex-wrap: wrap;
}

.gh-foot-logo {
    font-family: var(--font-serif);
    font-size: 2.2rem;
}

.gh-foot-desc {
    margin: 1.2rem 0 0;
    max-width: 36rem;
    font-size: 1.5rem;
    color: var(--color-secondary-text);
}

.gh-foot-social {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    font-size: 1.4rem;
    color: var(--color-secondary-text);
}

.gh-foot-social a:hover { color: var(--color-text); }

.gh-foot-menu .nav {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gh-foot-bottom {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 6.4rem;
    padding-top: 2.4rem;
    border-top: 1px solid var(--color-border);
    font-size: 1.3rem;
    color: var(--color-secondary-text);
}

.gh-foot-bottom p { margin: 0; }
.gh-foot-credit a { text-decoration: underline; text-underline-offset: 3px; }

/* 12. Dark palette (auto-derived from a dark background color)
   ========================================================================== */

html.has-light-text .gh-content pre {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

/* 13. Static cover variants (layouts match the Vancouver docs screenshots)
   ========================================================================== */

.cover .cover-inner { max-width: none; }
.full-bleed { width: 100vw; position: relative; left: 50%; transform: translateX(-50%); }

/* Vertical: big centered text, contained photo below */
.cover-vertical { padding: 9.6rem 0 2.4rem; }

.cover-vertical .cover-inner {
    display: flex;
    flex-direction: column;
    gap: 5.6rem;
}

.cover-vertical .cover-text { order: 0; text-align: center; max-width: 86rem; margin: 0 auto; }
.cover-vertical .cover-desc { margin-left: auto; margin-right: auto; }
.cover-vertical .cover-media { order: 1; width: 100%; max-width: 72rem; margin: 0 auto; }
.cover-vertical .cover-photo { border-radius: var(--radius); }

/* Vertical overlay: full-bleed photo under the header, text band below */
.cover-vertical-overlay { padding: 0 0 2.4rem; }

.cover-vertical-overlay .cover-media {
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
}

.cover-vertical-overlay .cover-photo {
    width: 100%;
    max-height: 68vh;
    object-fit: cover;
    border-radius: 0;
}

.cover-vertical-overlay .cover-text {
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    background: var(--hero-background-color, var(--color-surface));
    padding: 5.6rem max(calc((100vw - var(--container)) / 2 + 20px), 20px);
}

.cover-vertical-overlay .cover-desc { max-width: 62rem; }

/* Horizontal: edge-to-edge split — text on hero background left, photo right */
.cover-horizontal { padding: 0 0 2.4rem; }

.cover-horizontal .cover-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    align-items: center;
    min-height: min(78vh, 76rem);
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    background: var(--hero-background-color, var(--color-surface));
}

.cover-horizontal .cover-text {
    padding: 6.4rem max(4vmin, 24px) 6.4rem max(calc((100vw - var(--container)) / 2 + 20px), 24px);
}

.cover-horizontal .cover-media { order: 1; margin: 0; height: 100%; }

.cover-horizontal .cover-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

@media (max-width: 900px) {
    .cover-horizontal .cover-inner { grid-template-columns: 1fr; min-height: 0; }
    .cover-horizontal .cover-media { order: -1; }
    .cover-horizontal .cover-text { padding: 4rem max(4vmin, 20px); }
}

.cover-photo { max-width: 100%; }

.cover-rich-content {
    margin-top: 2.4rem;
    font-size: 1.8rem;
    color: var(--color-secondary-text);
}

.cover-rich-content a { text-decoration: underline; text-underline-offset: 3px; }
.cover-rich-content > * + * { margin-top: 1.6rem; }

/* 14. Post title size modifiers (#title-large / #title-small internal tags)
   ========================================================================== */

.tag-hash-title-large .article-title { font-size: clamp(4.2rem, 7vw, 7rem); }
.tag-hash-title-small .article-title { font-size: clamp(2.4rem, 3.5vw, 3.4rem); }

/* 15. Typography variants (Title font / Body font settings)
   ========================================================================== */

.has-sans-title h1, .has-sans-title h2, .has-sans-title h3,
.has-sans-title h4, .has-sans-title h5, .has-sans-title h6,
.has-sans-title .gh-head-title, .has-sans-title .gh-foot-logo {
    font-family: var(--gh-font-heading, var(--font-sans));
    font-weight: 700;
    letter-spacing: -0.02em;
}

body.has-serif-body {
    font-family: var(--gh-font-body, var(--font-serif));
    font-size: 1.6rem;
}

/* 16. Header nav overflow popover
   ========================================================================== */

.nav-more { position: relative; }
.nav-more.is-hidden { display: none; }

.nav-more-btn {
    padding: 0 0.4rem;
    border: 0;
    background: none;
    cursor: pointer;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--color-secondary-text);
}

.nav-more-btn:hover { color: var(--color-text); }

.nav-popover {
    position: absolute;
    top: calc(100% + 0.8rem);
    right: -0.8rem;
    min-width: 20rem;
    margin: 0;
    padding: 0.8rem 0;
    list-style: none;
    background: var(--background-color);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    display: none;
    z-index: 110;
}

.nav-more.is-open .nav-popover { display: block; }

.nav-popover .nav-item { display: block; }
.nav-popover .nav-link { display: block; padding: 0.8rem 1.6rem; }

/* 17. Footer groups ("#" prefixed secondary navigation labels)
   ========================================================================== */

.gh-foot-groups {
    display: flex;
    gap: 6.4rem;
    flex-wrap: wrap;
}

.gh-foot-group-title {
    margin: 0 0 1.2rem;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-secondary-text);
}

.gh-foot-group .nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gh-foot-social svg { width: 18px; height: 18px; }
.gh-foot-social a { display: inline-flex; }

/* 18. Subscription box with newsletter post
   ========================================================================== */

.subscribe-cta-inner.has-newsletter-post {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: var(--gap);
    align-items: center;
    text-align: left;
}

.subscribe-cta-inner.has-newsletter-post .subscribe-cta-desc { margin-left: 0; }
.subscribe-cta-inner.has-newsletter-post .form-fields { margin-left: 0; justify-content: flex-start; }

.subscribe-cta-post-kicker {
    margin: 0 0 1.6rem;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-secondary-text);
}

@media (max-width: 900px) {
    .subscribe-cta-inner.has-newsletter-post { grid-template-columns: 1fr; }
}

/* 19. Inline subscription form (HTML card snippet, Vancouver-compatible)
   ========================================================================== */

.form-wrapper {
    display: flex;
    gap: 1rem;
    margin: 3.2rem 0;
}

.auth-email {
    flex: 1;
    min-width: 0;
    padding: 1.2rem 1.8rem;
    font-size: 1.5rem;
    font-family: var(--font-sans);
    color: var(--color-text);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 100px;
    outline: none;
}

.auth-email:focus { border-color: var(--color-text); }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem 2.6rem;
    font-size: 1.5rem;
    font-family: var(--font-sans);
    font-weight: 500;
    border: 1px solid var(--color-border);
    border-radius: 100px;
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.button-primary {
    background: var(--ghost-accent-color, var(--color-text));
    border-color: transparent;
    color: #fff;
}

.button:hover { opacity: 0.85; }

.form-button .loader,
.form-button .success { display: none; }

.form-button .loader svg { width: 20px; height: 20px; }

form.loading .form-button .default { display: none; }
form.loading .form-button .loader { display: inline-flex; }
form.success .form-button .default,
form.success .form-button .loader { display: none; }
form.success .form-button .success { display: inline; }

/* 20. Contact form (Formspree snippet, Vancouver-compatible markup)
   ========================================================================== */

.gh-content #fs-from fieldset {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin: 0 0 2rem;
    padding: 0;
    border: 0;
}

.gh-content #fs-from label {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-secondary-text);
    margin-top: 1.6rem;
}

.gh-content #fs-from input[type="text"],
.gh-content #fs-from input[type="email"],
.gh-content #fs-from textarea {
    padding: 1.2rem 1.6rem;
    font-size: 1.6rem;
    font-family: var(--font-sans);
    color: var(--color-text);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    outline: none;
}

.gh-content #fs-from input:focus,
.gh-content #fs-from textarea:focus { border-color: var(--color-text); }

/* 21. Prism syntax highlighting (editorial palette)
   ========================================================================== */

.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #8a857d; }
.token.punctuation { color: #b5afa5; }
.token.property, .token.tag, .token.constant, .token.symbol, .token.deleted { color: #e6a07c; }
.token.boolean, .token.number { color: #d4b06a; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #a8c795; }
.token.operator, .token.entity, .token.url { color: #c9c3b8; }
.token.atrule, .token.attr-value, .token.keyword { color: #92b8d1; }
.token.function, .token.class-name { color: #d1a3c2; }
.token.regex, .token.important, .token.variable { color: #e0c48f; }
.token.important, .token.bold { font-weight: bold; }
.token.italic { font-style: italic; }

/* 22. Hero background color + contrast */

.hero-inner {
    background-color: color-mix(in srgb, var(--card-accent, transparent) 12%, var(--hero-background-color, var(--color-surface)));
}


html.has-light-hero-text .hero-content,
html.has-light-hero-text .cover-text {
    --color-text: #f4f1ec;
    --color-secondary-text: rgba(244, 241, 236, 0.64);
    color: #f4f1ec;
}

html.has-dark-hero-text .hero-content,
html.has-dark-hero-text .cover-vertical .cover-text,
html.has-dark-hero-text .cover-horizontal .cover-text {
    --color-text: #191817;
    --color-secondary-text: rgba(25, 24, 23, 0.62);
    color: #191817;
}

/* 23. Post share buttons */

.share {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin-top: 2.4rem;
}

.article-share-row .share { margin: 0 0 3.2rem; }

.share-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: none;
    padding: 0;
    color: var(--color-secondary-text);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.share-link .icon { width: 15px; height: 15px; }

.share-link:hover {
    color: var(--ghost-accent-color, var(--color-text));
    border-color: var(--ghost-accent-color, var(--color-text));
}

.share-link.is-copied {
    color: var(--ghost-accent-color, var(--color-text));
    border-color: var(--ghost-accent-color, var(--color-text));
}

/* 24. Header social icons */

.header-social {
    display: flex;
    align-items: center;
    gap: 1.4rem;
}

.header-social-item {
    display: inline-flex;
    color: var(--color-secondary-text);
    transition: color 0.15s ease;
}

.header-social-item:hover { color: var(--ghost-accent-color, var(--color-text)); }
.header-social-item .icon { width: 16px; height: 16px; }

/* Non-clickable dropdown parents ("#" prefixed header labels) */
.nav-link-static { cursor: default; }

/* 25. Post header meta row (labeled, share right — per docs screenshots)
   ========================================================================== */

.article-meta-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2.4rem;
    flex-wrap: wrap;
    margin-top: 4rem;
    text-align: left;
}

.article-meta-items {
    display: flex;
    gap: 4rem;
    flex-wrap: wrap;
}

.meta-item { display: flex; flex-direction: column; gap: 0.4rem; }

.meta-label {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-secondary-text);
}

.meta-value { font-size: 1.5rem; }
.meta-value a:hover { text-decoration: underline; text-underline-offset: 3px; }

.article-meta-row .share { margin: 0; justify-content: flex-end; }

/* 26. Subscription box band (kicker + big italic headline + optional post)
   ========================================================================== */

.subscribe-cta {
    margin-top: 6.4rem;
    border-top: 0;
    padding: 9.6rem 0;
    background: color-mix(in srgb, var(--ghost-accent-color, #7f8c7f) 24%, var(--background-color));
}

.subscribe-cta-kicker {
    margin: 0 0 2rem;
    font-size: 1.5rem;
}

.subscribe-cta-heading {
    font-style: italic;
    font-size: clamp(2.6rem, 3.6vw, 4rem);
    line-height: 1.3;
    max-width: 56rem;
}

.subscribe-cta:not(:has(.has-newsletter-post)) .subscribe-cta-heading { margin-left: auto; margin-right: auto; }

.subscribe-cta-inner:not(.has-newsletter-post) { text-align: center; }
.subscribe-cta-inner:not(.has-newsletter-post) .subscribe-cta-kicker { text-align: center; }

.subscribe-cta-inner.has-newsletter-post .subscribe-cta-heading { margin-left: 0; }

.subscribe-cta-post .post-card-excerpt { -webkit-line-clamp: 3; }

/* 27. Tag section: featured post left, compact 2x2 grid right
   ========================================================================== */

.tag-section-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 4rem;
    align-items: start;
}

.feed-featured {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    background: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 100%;
}

.feed-featured-text {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 3.2rem;
    padding: clamp(2.4rem, 3vw, 4rem);
    text-align: center;
}

.feed-featured-title { font-size: clamp(2.2rem, 2.4vw, 3rem); line-height: 1.3; }
.feed-featured-title a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

.vertical-line {
    width: 1px;
    flex: 1;
    min-height: 4rem;
    margin: 0 auto;
    background: var(--color-border);
}

.feed-featured-excerpt {
    margin: 0;
    font-size: 1.4rem;
    color: var(--color-secondary-text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feed-featured-image-link { display: block; height: 100%; }

.feed-featured-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tag-section-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3.2rem 2.4rem;
    align-content: start;
}

.post-card-compact-image-link { display: block; margin-bottom: 1.4rem; }

.post-card-compact-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--radius);
}

.post-card-compact .post-card-tag { display: inline-block; margin-bottom: 0.8rem; }

.post-card-compact-title { font-size: 1.8rem; line-height: 1.35; }
.post-card-compact-title a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

@media (max-width: 1000px) {
    .tag-section-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .feed-featured { grid-template-columns: 1fr; }
    .feed-featured-image { aspect-ratio: 3 / 2; }
    .tag-section-side { grid-template-columns: 1fr; }
    .article-meta-items { gap: 2.4rem; }
}
