/* ============================================================
   Canon Wars Ghost Theme — style.css
   Brand: Black #151015 | Crimson #C41E3A | Gold #C9A84C | Cream #F5F0E8
   Author: Cog for Scott Monett / Crosswind Holdings
   Version: 1.0.0
   ============================================================

   TABLE OF CONTENTS
   -----------------
   1.  CSS Custom Properties (Design Tokens)
   2.  Dark Mode Variable Overrides
   3.  Reset & Base
   4.  Typography
   5.  Layout — Containers
   6.  Site Header & Navigation
   7.  Mobile Navigation
   8.  Site Hero (Homepage)
   9.  Tag Filter Nav (Homepage)
   10. Post Grid
   11. Post Card (Standard)
   12. Cog's Log Card
   13. Single Post — Full Layout
   14. Ghost Content Card Styles (kg-*)
   15. Author Card (inline, in post footer)
   16. Related Posts
   17. Tag Archive Page
   18. Author Archive Page
   19. Static Page
   20. Pagination
   21. Site Footer & Newsletter
   22. Error Page
   23. Utility Classes
   24. Print Styles
   25. Dark Mode Overrides
   ============================================================ */


/* ============================================================
   1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================================ */
:root {
    /* Brand Palette */
    --black:  #151015;
    --crimson: #C41E3A;
    --gold:   #C9A84C;
    --cream:  #F5F0E8;
    --charcoal: #2D2D2D;
    --code-bg:   #F0EDE5;
    --code-text: #3A3A3A;
    /* Legacy alias */
    --navy:   var(--black);

    /* Semantic color aliases */
    --color-bg:         var(--cream);
    --color-text:       var(--charcoal);
    --color-heading:    var(--black);
    --color-primary:    var(--black);
    --color-accent:     var(--gold);
    --color-accent-hot: var(--crimson);
    --color-border:     rgba(21, 16, 21, 0.13);
    --color-surface:    #ffffff;
    --color-surface-alt: #FAF7F2;
    --color-muted:      #6B7280;
    --color-cogs-bg:    #F7F3E8;

    /* Typography stacks */
    --font-serif: Georgia, 'Times New Roman', 'Book Antiqua', Palatino, serif;
    --font-sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                  'Helvetica Neue', Arial, 'Noto Sans', sans-serif,
                  'Apple Color Emoji', 'Segoe UI Emoji';
    --font-mono:  'SFMono-Regular', Consolas, 'Liberation Mono', Menlo,
                  'Courier New', monospace;

    /* Layout */
    --container-max:     1200px;
    --container-reading: 720px;
    --header-height:     68px;

    /* Spacing scale */
    --sp-1: 0.25rem;   /*  4px */
    --sp-2: 0.5rem;    /*  8px */
    --sp-3: 0.75rem;   /* 12px */
    --sp-4: 1rem;      /* 16px */
    --sp-5: 1.25rem;   /* 20px */
    --sp-6: 1.5rem;    /* 24px */
    --sp-8: 2rem;      /* 32px */
    --sp-10: 2.5rem;   /* 40px */
    --sp-12: 3rem;     /* 48px */
    --sp-16: 4rem;     /* 64px */
    --sp-20: 5rem;     /* 80px */

    /* Borders */
    --radius-sm:  4px;
    --radius-md:  8px;
    --radius-lg:  12px;
    --radius-xl:  16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.07);
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.09);
    --shadow-md: 0 4px 14px rgba(0,0,0,0.10);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.13);

    /* Transitions */
    --t-fast: 140ms ease;
    --t-base: 240ms ease;
    --t-slow: 380ms ease;
}


/* ============================================================
   2. DARK MODE VARIABLE OVERRIDES
   (inline via media query — also see assets/css/dark-mode.css)
   ============================================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg:         #0C0810;
        --color-text:       #DDD8CE;
        --color-heading:    #C9A84C;
        --color-primary:    #C9A84C;
        --color-accent:     #D4B86A;
        --color-accent-hot: #E63950;
        --color-border:     rgba(201, 168, 76, 0.18);
        --color-surface:    #140E18;
        --color-surface-alt: #1E1524;
        --color-muted:      #8A96A8;
        --color-cogs-bg:    #1E152A;
        --code-bg:          #1B1520;
        --code-text:        #C2D0E4;
    }
}


/* ============================================================
   3. RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 1.0625rem;       /* 17px — comfortable reading */
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#main-content {
    flex: 1;
}

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

svg {
    overflow: hidden;
}

button {
    cursor: pointer;
    font-family: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

[hidden] {
    display: none !important;
}


/* ============================================================
   4. TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    color: var(--color-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--sp-4);
}

h1 { font-size: clamp(1.875rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.375rem, 3vw, 2.125rem); }
h3 { font-size: clamp(1.125rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; font-weight: 600; }
h6 { font-size: 0.9375rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

p {
    margin-bottom: var(--sp-4);
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-color: rgba(196, 30, 58, 0.4);
    text-underline-offset: 3px;
    transition: color var(--t-fast), text-decoration-color var(--t-fast);
}

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

a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
    border-radius: 2px;
}

strong, b { font-weight: 700; }
em, i { font-style: italic; }
s, del { text-decoration: line-through; opacity: 0.7; }
mark { background: rgba(201, 168, 76, 0.3); padding: 0 3px; border-radius: 2px; }
sup, sub { font-size: 0.75em; }

blockquote {
    border-left: 4px solid var(--color-accent);
    margin: var(--sp-8) 0;
    padding: var(--sp-4) var(--sp-6);
    background: var(--color-surface-alt);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--color-muted);
}

blockquote p:last-child { margin-bottom: 0; }

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--code-bg);
    color: var(--code-text);
    padding: 0.125em 0.375em;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: var(--sp-5) var(--sp-6);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: var(--sp-8) 0;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.65;
    border: 1px solid var(--color-border);
    tab-size: 2;
}

pre code {
    background: none;
    padding: 0;
    font-size: inherit;
    border: none;
    color: inherit;
}

hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--sp-10) 0;
}

figure {
    margin: var(--sp-8) 0;
}

figcaption {
    font-size: 0.875rem;
    color: var(--color-muted);
    text-align: center;
    margin-top: var(--sp-2);
    font-style: italic;
}

ul, ol {
    padding-left: var(--sp-6);
    margin-bottom: var(--sp-4);
}

li {
    margin-bottom: var(--sp-1);
}

li > ul, li > ol {
    margin-top: var(--sp-1);
    margin-bottom: var(--sp-1);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--sp-8) 0;
    font-size: 0.9375rem;
}

th {
    background: var(--color-primary);
    color: #fff;
    font-family: var(--font-serif);
    font-weight: 700;
    text-align: left;
    padding: var(--sp-3) var(--sp-4);
    border: 1px solid rgba(255,255,255,0.1);
}

td {
    padding: var(--sp-3) var(--sp-4);
    border: 1px solid var(--color-border);
    vertical-align: top;
}

tr:nth-child(even) td {
    background: var(--color-surface-alt);
}


/* ============================================================
   5. LAYOUT — CONTAINERS
   ============================================================ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--sp-6);
    padding-right: var(--sp-6);
}

@media (max-width: 640px) {
    .container {
        padding-left: var(--sp-4);
        padding-right: var(--sp-4);
    }
}


/* ============================================================
   6. SITE HEADER & NAVIGATION
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--header-height);
    background: var(--navy);
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-6);
    width: 100%;
}

/* Brand */
.header-brand { flex-shrink: 0; }

.site-logo-link,
.site-name-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
}

.site-name-link {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
    text-decoration: none;
    transition: color var(--t-fast);
}

.site-name-link:hover {
    color: var(--gold);
    text-decoration: none;
}

/* Nav */
.site-nav {
    display: flex;
    align-items: center;
}

.nav-list,
ul.nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2px;
    align-items: center;
}

.nav-item a {
    display: block;
    padding: var(--sp-2) var(--sp-4);
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: color var(--t-fast), background var(--t-fast);
    white-space: nowrap;
}

.nav-item a:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}

.nav-item.active a {
    color: var(--gold);
    background: rgba(201, 168, 76, 0.15);
}

/* Subscribe CTA */
.nav-item--cta a,
.nav-subscribe-btn {
    background: var(--gold) !important;
    color: var(--navy) !important;
    font-weight: 700 !important;
    padding: var(--sp-2) var(--sp-5) !important;
    border-radius: var(--radius-full) !important;
    margin-left: var(--sp-2);
    transition: background var(--t-fast), transform var(--t-fast) !important;
}

.nav-item--cta a:hover,
.nav-subscribe-btn:hover {
    background: #D4B86A !important;
    color: var(--navy) !important;
    transform: translateY(-1px);
}

/* Hamburger toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: var(--sp-2);
    background: transparent;
    border: none;
    color: #fff;
    border-radius: var(--radius-sm);
    transition: background var(--t-fast);
    margin-left: var(--sp-3);
}

.nav-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform var(--t-base), opacity var(--t-base);
    transform-origin: center;
}

.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ============================================================
   7. MOBILE NAVIGATION
   ============================================================ */
@media (max-width: 820px) {
    .nav-toggle {
        display: flex;
    }

    .site-nav {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--navy);
        flex-direction: column;
        padding: var(--sp-4) 0 var(--sp-6);
        gap: 0;
        border-top: 1px solid rgba(255,255,255,0.08);
        box-shadow: var(--shadow-lg);
        align-items: stretch;
        z-index: 199;
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav ul.nav {
        flex-direction: column;
    }

    .nav-subscribe-wrapper {
        padding: var(--sp-3) var(--sp-5);
        border-top: 1px solid rgba(255,255,255,0.08);
        margin-top: var(--sp-2);
    }

    .nav-item {
        width: 100%;
    }

    .nav-item a {
        border-radius: 0;
        padding: var(--sp-4) var(--sp-8);
        font-size: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .nav-item--cta a {
        margin: var(--sp-4) var(--sp-6) 0;
        border-radius: var(--radius-full) !important;
        text-align: center;
    }
}


/* ============================================================
   8. SITE HERO (HOMEPAGE)
   ============================================================ */
.site-hero {
    background: var(--navy);
    color: #fff;
    padding: var(--sp-20) 0 var(--sp-16);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Gold accent line bottom */
.site-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--gold) 30%, #E8C870 50%, var(--gold) 70%, transparent 100%);
}

/* Subtle background texture */
.site-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(201,168,76,0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(201,168,76,0.04) 0%, transparent 60%);
    pointer-events: none;
}

.site-hero .container {
    position: relative;
    z-index: 1;
}

.site-crest {
    margin-bottom: var(--sp-6);
}

.site-logo {
    height: 88px;
    width: auto;
    margin: 0 auto;
    filter: drop-shadow(0 2px 12px rgba(0,0,0,0.3));
}

.site-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 6vw, 3.75rem);
    color: #fff;
    margin-bottom: var(--sp-4);
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.site-tagline {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: rgba(255,255,255,0.70);
    max-width: 580px;
    margin: 0 auto;
    font-style: italic;
    line-height: 1.6;
}


/* ============================================================
   9. TAG FILTER NAV (HOMEPAGE)
   ============================================================ */
.tag-filter-nav {
    margin-bottom: var(--sp-8);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: var(--sp-2);
}

.tag-filter-nav::-webkit-scrollbar { display: none; }

.tag-filter-list {
    display: flex;
    list-style: none;
    gap: var(--sp-2);
    flex-wrap: nowrap;
    padding: 0;
    margin: 0;
}

.tag-filter-link {
    display: inline-block;
    padding: var(--sp-2) var(--sp-4);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-muted);
    text-decoration: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: var(--color-surface);
    white-space: nowrap;
    transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}

.tag-filter-link:hover,
.tag-filter-link.active {
    color: var(--navy);
    background: rgba(201, 168, 76, 0.12);
    border-color: var(--gold);
    text-decoration: none;
}

.tag-filter-link.active {
    font-weight: 700;
    color: var(--color-primary);
}


/* ============================================================
   10. POST GRID
   ============================================================ */
.post-grid-section {
    padding: var(--sp-12) 0 var(--sp-16);
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--sp-6);
    margin-bottom: var(--sp-10);
}

@media (max-width: 480px) {
    .post-grid {
        grid-template-columns: 1fr;
        gap: var(--sp-5);
    }
}

@media (min-width: 900px) {
    .post-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* ============================================================
   11. POST CARD (STANDARD)
   ============================================================ */
.post-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(201, 168, 76, 0.3);
}

/* Image */
.post-card-image-link {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--color-surface-alt);
    text-decoration: none;
}

.post-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--t-slow);
}

.post-card:hover .post-card-image {
    transform: scale(1.04);
}

/* Body */
.post-card-body {
    padding: var(--sp-5) var(--sp-5) var(--sp-5);
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: var(--sp-2);
}

/* Tag pill */
.post-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.post-card-tag {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--color-accent);
    text-decoration: none;
    padding: 2px 10px;
    background: rgba(201, 168, 76, 0.10);
    border: 1px solid rgba(201, 168, 76, 0.28);
    border-radius: var(--radius-full);
    transition: background var(--t-fast), border-color var(--t-fast);
}

.post-card-tag:hover {
    background: rgba(201, 168, 76, 0.22);
    border-color: var(--gold);
    text-decoration: none;
}

/* Title */
.post-card-title {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    line-height: 1.3;
    margin-bottom: 0;
}

.post-card-title a {
    color: var(--color-heading);
    text-decoration: none;
    transition: color var(--t-fast);
}

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

/* Excerpt */
.post-card-excerpt {
    font-size: 0.9375rem;
    color: var(--color-muted);
    line-height: 1.6;
    margin: 0;
    flex: 1;
    /* clamp to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer */
.post-card-footer {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 0.8125rem;
    color: var(--color-muted);
    border-top: 1px solid var(--color-border);
    padding-top: var(--sp-3);
    margin-top: var(--sp-2);
}

.post-card-sep { opacity: 0.4; }


/* ============================================================
   12. COG'S LOG CARD
   ============================================================ */
.cogs-log-card {
    background: var(--color-cogs-bg);
    border-color: rgba(201, 168, 76, 0.35);
    border-width: 2px;
    position: relative;
}

.cogs-log-card:hover {
    border-color: rgba(201, 168, 76, 0.65);
}

/* Indicator strip at top */
.cogs-log-indicator {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-5);
    background: linear-gradient(90deg, rgba(201,168,76,0.18) 0%, rgba(201,168,76,0.04) 100%);
    border-bottom: 1px solid rgba(201, 168, 76, 0.22);
}

.gear-icon {
    font-size: 0.875rem;
    line-height: 1;
    flex-shrink: 0;
}

.cogs-log-label {
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-accent);
    font-family: var(--font-sans);
}


/* ============================================================
   13. SINGLE POST — FULL LAYOUT
   ============================================================ */
.post-full-wrapper {
    min-height: 50vh;
}

/* Cog's Log post: warm tinted background */
.post-full-wrapper.is-cogs-log {
    background: linear-gradient(
        180deg,
        var(--color-cogs-bg) 0%,
        var(--color-cogs-bg) 280px,
        var(--color-bg) 500px
    );
}

/* Cog's Log badge (post header) */
.cogs-log-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-accent);
    background: rgba(201, 168, 76, 0.12);
    border: 1px solid rgba(201, 168, 76, 0.32);
    padding: 4px 14px;
    border-radius: var(--radius-full);
    margin-bottom: var(--sp-4);
}

.cogs-log-badge.large {
    font-size: 2.5rem;
    background: none;
    border: none;
    padding: 0;
    margin-bottom: var(--sp-4);
    letter-spacing: 0;
    text-transform: none;
    font-weight: 400;
    color: inherit;
}

/* Post header */
.post-full-header {
    padding: var(--sp-16) 0 var(--sp-10);
    text-align: center;
}

.post-full-tag-label {
    margin-bottom: var(--sp-4);
}

/* Post tag pill */
.post-tag {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--color-accent);
    text-decoration: none;
    padding: 3px 13px;
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-full);
    margin: 2px;
    transition: background var(--t-fast), color var(--t-fast);
}

.post-tag:hover {
    background: var(--color-accent);
    color: #fff;
    text-decoration: none;
}

.post-full-title {
    font-family: var(--font-serif);
    font-size: clamp(1.875rem, 5vw, 3.25rem);
    color: var(--color-heading);
    max-width: var(--container-reading);
    margin: 0 auto var(--sp-6);
    line-height: 1.15;
    letter-spacing: -0.015em;
}

/* Author/meta row */
.post-full-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-3);
    font-size: 0.875rem;
    color: var(--color-muted);
}

.post-meta-author {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    text-decoration: none;
    color: var(--color-muted);
    font-weight: 600;
    transition: color var(--t-fast);
}

.post-meta-author:hover {
    color: var(--color-accent);
    text-decoration: none;
}

.post-meta-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--color-accent);
}

.dot {
    opacity: 0.35;
    font-size: 1.25em;
    line-height: 1;
}

/* Feature image */
.post-full-image {
    width: 100%;
    max-height: 580px;
    overflow: hidden;
    margin-bottom: var(--sp-12);
    position: relative;
}

.post-full-image img {
    width: 100%;
    height: 100%;
    max-height: 580px;
    object-fit: cover;
}

.post-full-image-caption {
    font-size: 0.875rem;
    color: var(--color-muted);
    text-align: center;
    padding: var(--sp-2) var(--sp-4);
    background: var(--color-surface-alt);
    border-bottom: 1px solid var(--color-border);
    font-style: italic;
}

/* Post content */
.post-full-content {
    max-width: var(--container-reading);
    margin: 0 auto;
    padding-bottom: var(--sp-12);
}

/* Ghost wide/full card overrides */
.post-full-content .kg-width-wide {
    margin-left: max(-60px, calc(50% - 50vw + var(--sp-6)));
    margin-right: max(-60px, calc(50% - 50vw + var(--sp-6)));
}

.post-full-content .kg-width-full {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
}

/* Post footer */
.post-full-footer {
    max-width: var(--container-reading);
    margin: 0 auto;
    padding: var(--sp-8) 0 var(--sp-16);
    border-top: 2px solid var(--color-border);
}

.post-full-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-bottom: var(--sp-8);
}


/* ============================================================
   14. GHOST CONTENT CARD STYLES (kg-*)
   ============================================================ */

/* Images */
.gh-content .kg-image-card {
    margin: var(--sp-8) 0;
}

.gh-content .kg-image-card img,
.gh-content .kg-image {
    border-radius: var(--radius-md);
    width: 100%;
}

/* Gallery */
.gh-content .kg-gallery-card {
    margin: var(--sp-8) 0;
}

.gh-content .kg-gallery-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.gh-content .kg-gallery-row {
    display: flex;
    gap: var(--sp-2);
    flex: 1;
}

.gh-content .kg-gallery-image {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

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

/* Embed */
.gh-content .kg-embed-card {
    margin: var(--sp-8) 0;
}

.gh-content .kg-embed-card > * {
    margin-left: auto;
    margin-right: auto;
}

/* Bookmark */
.gh-content .kg-bookmark-card {
    margin: var(--sp-8) 0;
}

.gh-content .kg-bookmark-container {
    display: flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    text-decoration: none;
    background: var(--color-surface);
    transition: box-shadow var(--t-fast), border-color var(--t-fast);
    color: inherit;
}

.gh-content .kg-bookmark-container:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(201, 168, 76, 0.35);
    text-decoration: none;
}

.gh-content .kg-bookmark-content {
    padding: var(--sp-4) var(--sp-5);
    flex: 1;
    min-width: 0;
}

.gh-content .kg-bookmark-title {
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: var(--sp-1);
    font-size: 0.9375rem;
    line-height: 1.3;
}

.gh-content .kg-bookmark-description {
    font-size: 0.875rem;
    color: var(--color-muted);
    margin-bottom: var(--sp-3);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gh-content .kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 0.8125rem;
    color: var(--color-muted);
}

.gh-content .kg-bookmark-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.gh-content .kg-bookmark-author::after {
    content: '·';
    margin-left: var(--sp-2);
}

.gh-content .kg-bookmark-thumbnail {
    width: 140px;
    flex-shrink: 0;
}

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

@media (max-width: 480px) {
    .gh-content .kg-bookmark-thumbnail { display: none; }
}

/* Callout */
.gh-content .kg-callout-card {
    display: flex;
    gap: var(--sp-4);
    padding: var(--sp-5) var(--sp-5);
    background: var(--color-surface-alt);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-accent);
    margin: var(--sp-8) 0;
}

.gh-content .kg-callout-emoji {
    font-size: 1.375rem;
    line-height: 1.5;
    flex-shrink: 0;
}

.gh-content .kg-callout-text {
    flex: 1;
    margin: 0;
}

/* Toggle */
.gh-content .kg-toggle-card {
    margin: var(--sp-8) 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.gh-content .kg-toggle-heading-text {
    display: block;
    padding: var(--sp-4) var(--sp-5);
    background: var(--color-surface-alt);
    font-weight: 600;
    color: var(--color-heading);
    cursor: pointer;
    font-family: var(--font-serif);
    font-size: 1rem;
}

.gh-content .kg-toggle-content {
    padding: var(--sp-4) var(--sp-5);
}

/* Button */
.gh-content .kg-button-card {
    margin: var(--sp-8) 0;
    text-align: center;
}

.gh-content .kg-btn {
    display: inline-block;
    padding: var(--sp-3) var(--sp-8);
    background: var(--navy);
    color: #fff;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9375rem;
    transition: background var(--t-fast), transform var(--t-fast);
}

.gh-content .kg-btn:hover {
    background: var(--color-accent);
    transform: translateY(-1px);
    text-decoration: none;
    color: #fff;
}

/* Video */
.gh-content .kg-video-card {
    margin: var(--sp-8) 0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* Divider */
.gh-content .kg-divider {
    border: none;
    border-top: 2px solid var(--color-border);
    margin: var(--sp-10) 0;
}

/* Audio */
.gh-content .kg-audio-card {
    margin: var(--sp-8) 0;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--sp-4);
}

/* Product */
.gh-content .kg-product-card {
    margin: var(--sp-8) 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
    background: var(--color-surface);
}


/* ============================================================
   15. AUTHOR CARD (INLINE, POST FOOTER)
   ============================================================ */
.author-card {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-5);
    padding: var(--sp-6);
    background: var(--color-surface-alt);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    margin-bottom: var(--sp-5);
}

.author-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid var(--color-accent);
    box-shadow: var(--shadow-sm);
}

.author-info { flex: 1; min-width: 0; }

.author-name {
    font-family: var(--font-serif);
    font-size: 1.0625rem;
    margin-bottom: var(--sp-1);
    font-weight: 700;
}

.author-name a {
    color: var(--color-heading);
    text-decoration: none;
}

.author-name a:hover {
    color: var(--color-accent);
}

.author-bio {
    font-size: 0.9375rem;
    color: var(--color-muted);
    line-height: 1.6;
    margin: 0;
}

.author-location {
    font-size: 0.875rem;
    color: var(--color-muted);
    margin-top: var(--sp-1);
    margin-bottom: 0;
}

@media (max-width: 480px) {
    .author-card {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* ============================================================
   16. RELATED POSTS
   ============================================================ */
.related-posts {
    padding: var(--sp-12) 0 var(--sp-16);
    border-top: 1px solid var(--color-border);
    background: var(--color-surface-alt);
    margin-top: var(--sp-8);
}

.related-posts-title {
    font-family: var(--font-serif);
    font-size: 1.375rem;
    margin-bottom: var(--sp-8);
    color: var(--color-heading);
    max-width: var(--container-reading);
    margin-left: auto;
    margin-right: auto;
}

.related-posts-grid {
    max-width: var(--container-reading);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--sp-5);
}

@media (max-width: 480px) {
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   17. TAG ARCHIVE PAGE
   ============================================================ */
.tag-archive { }

.tag-header {
    background: var(--navy);
    color: #fff;
    padding: var(--sp-16) 0 var(--sp-10);
    text-align: center;
    position: relative;
}

.tag-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.tag-cover-wrap {
    max-width: 640px;
    margin: 0 auto var(--sp-6);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.tag-cover {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    display: block;
}

.tag-header-content { position: relative; z-index: 1; }

.tag-header h1,
.tag-name {
    color: #fff;
    margin-bottom: var(--sp-3);
}

.tag-description {
    color: rgba(255,255,255,0.72);
    max-width: 560px;
    margin: 0 auto var(--sp-4);
    font-size: 1rem;
}

.post-count {
    display: inline-block;
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.08);
    padding: 3px 13px;
    border-radius: var(--radius-full);
}


/* ============================================================
   18. AUTHOR ARCHIVE PAGE
   ============================================================ */
.author-header {
    background: var(--navy);
    color: #fff;
    padding: var(--sp-16) 0 var(--sp-10);
    text-align: center;
    position: relative;
}

.author-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.author-header-content { position: relative; z-index: 1; }

.author-profile-image {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-full);
    object-fit: cover;
    margin: 0 auto var(--sp-5);
    border: 4px solid var(--gold);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    display: block;
}

.author-header-name {
    color: #fff;
    margin-bottom: var(--sp-3);
}

.author-header-bio {
    color: rgba(255,255,255,0.72);
    max-width: 560px;
    margin: 0 auto var(--sp-4);
    font-size: 1rem;
}

.author-header-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--sp-3);
    margin-top: var(--sp-4);
}

.author-header-location {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.6);
    margin: 0;
}

.author-website,
.author-social {
    font-size: 0.875rem;
    color: var(--gold);
    text-decoration: none;
    padding: 5px 16px;
    border: 1px solid rgba(201, 168, 76, 0.45);
    border-radius: var(--radius-full);
    transition: background var(--t-fast);
}

.author-website:hover,
.author-social:hover {
    background: rgba(201, 168, 76, 0.18);
    color: var(--gold);
    text-decoration: none;
}


/* ============================================================
   19. STATIC PAGE
   ============================================================ */
.page-content {
    padding: var(--sp-12) 0 var(--sp-16);
}

.page-header {
    text-align: center;
    max-width: var(--container-reading);
    margin: 0 auto var(--sp-10);
}

.page-tag-label {
    margin-bottom: var(--sp-3);
}

.page-title {
    font-size: clamp(1.875rem, 5vw, 3rem);
    margin-bottom: var(--sp-4);
}

.page-excerpt {
    font-size: 1.125rem;
    color: var(--color-muted);
    font-style: italic;
    line-height: 1.6;
}

.page-feature-image {
    width: 100%;
    max-height: 480px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    margin-bottom: var(--sp-10);
}

.page-feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-body {
    max-width: var(--container-reading);
    margin: 0 auto;
}


/* ============================================================
   20. PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-4);
    padding: var(--sp-6) 0 var(--sp-2);
    flex-wrap: wrap;
}

.older-posts,
.newer-posts {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-5);
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
    box-shadow: var(--shadow-xs);
}

.older-posts:hover,
.newer-posts:hover {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.page-number {
    font-size: 0.875rem;
    color: var(--color-muted);
    padding: var(--sp-2) var(--sp-3);
}


/* ============================================================
   21. SITE FOOTER & NEWSLETTER
   ============================================================ */
.site-footer {
    background: var(--navy);
    color: rgba(255,255,255,0.72);
    padding: var(--sp-16) 0 0;
    margin-top: auto;
}

.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--sp-12);
    padding-bottom: var(--sp-10);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: var(--sp-6);
}

@media (max-width: 680px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: var(--sp-8);
    }
}

/* Newsletter block */
.footer-newsletter h3 {
    font-family: var(--font-serif);
    font-size: 1.375rem;
    color: #fff;
    margin-bottom: var(--sp-2);
}

.footer-newsletter p {
    font-size: 0.9375rem;
    color: rgba(255,255,255,0.62);
    line-height: 1.65;
    margin-bottom: var(--sp-5);
}

.member-status {
    color: var(--gold);
    font-weight: 600;
    font-size: 0.9375rem;
    margin: 0;
}

.newsletter-form-row {
    display: flex;
    gap: var(--sp-2);
    max-width: 440px;
}

@media (max-width: 480px) {
    .newsletter-form-row {
        flex-direction: column;
    }
}

.newsletter-form input[type="email"] {
    flex: 1;
    padding: var(--sp-3) var(--sp-4);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.07);
    color: #fff;
    font-size: 0.9375rem;
    outline: none;
    transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}

.newsletter-form input[type="email"]::placeholder {
    color: rgba(255,255,255,0.35);
}

.newsletter-form input[type="email"]:focus {
    border-color: var(--gold);
    background: rgba(255,255,255,0.11);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.18);
}

.newsletter-form button {
    padding: var(--sp-3) var(--sp-6);
    background: var(--gold);
    color: var(--navy);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}

.newsletter-form button:hover {
    background: #D4B86A;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 168, 76, 0.3);
}

.newsletter-form button:active {
    transform: translateY(0);
}

.form-message {
    display: none;
    font-size: 0.875rem;
    margin-top: var(--sp-3);
    padding: var(--sp-2) var(--sp-4);
    border-radius: var(--radius-sm);
}

.form-message.success {
    display: none;
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.form-message.error {
    display: none;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Footer meta column */
.footer-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

@media (max-width: 680px) {
    .footer-meta { text-align: left; }
}

.copyright {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.45);
    margin: 0;
}

.footer-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--sp-2);
}

@media (max-width: 680px) {
    .footer-nav {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
    }
}

.footer-nav a {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    transition: color var(--t-fast);
}

.footer-nav a:hover {
    color: var(--gold);
}

/* Bottom bar */
.footer-bottom {
    padding: var(--sp-4) 0;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-tagline {
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.3);
    text-align: center;
    margin: 0;
}

.footer-tagline a {
    color: rgba(255,255,255,0.4);
    text-decoration: none;
}

.footer-tagline a:hover {
    color: var(--gold);
}


/* ============================================================
   22. ERROR PAGE
   ============================================================ */
.error-page {
    min-height: 65vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--sp-16) var(--sp-6);
}

.error-inner {
    max-width: 480px;
}

.error-gear {
    font-size: 3.5rem;
    margin-bottom: var(--sp-4);
    animation: spin-slow 8s linear infinite;
    display: inline-block;
    opacity: 0.6;
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.error-code {
    font-family: var(--font-serif);
    font-size: clamp(4rem, 15vw, 8rem);
    color: var(--color-accent);
    line-height: 1;
    margin-bottom: var(--sp-4);
    letter-spacing: -0.04em;
}

.error-message {
    font-size: 1.0625rem;
    color: var(--color-muted);
    margin-bottom: var(--sp-8);
    line-height: 1.65;
}

.error-actions {
    display: flex;
    justify-content: center;
}

.error-home-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-8);
    background: var(--navy);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.9375rem;
    transition: background var(--t-fast), transform var(--t-fast);
    box-shadow: var(--shadow-sm);
}

.error-home-btn:hover {
    background: var(--color-accent);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}


/* ============================================================
   23. UTILITY CLASSES
   ============================================================ */
.visually-hidden,
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-muted   { color: var(--color-muted); }
.text-accent  { color: var(--color-accent); }
.text-navy    { color: var(--navy); }

.mt-auto { margin-top: auto; }
.ml-auto { margin-left: auto; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--sp-2); }
.gap-4 { gap: var(--sp-4); }


/* ============================================================
   24. PRINT STYLES
   ============================================================ */
@media print {
    .site-header,
    .site-footer,
    .related-posts,
    .post-full-tag-list,
    .author-card,
    .pagination,
    .nav-toggle {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    a { color: #000; text-decoration: underline; }
    a[href]::after { content: " (" attr(href) ")"; font-size: 10pt; }

    .post-full-content {
        max-width: 100%;
        padding: 0;
    }

    .post-full-title {
        font-size: 24pt;
    }

    .post-full-image {
        max-height: 300px;
    }

    pre, blockquote {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}


/* ============================================================
   25. DARK MODE OVERRIDES
   (Variables handle most of it; these are structural exceptions)
   ============================================================ */
@media (prefers-color-scheme: dark) {

    .post-card {
        box-shadow: 0 1px 4px rgba(0,0,0,0.35);
    }

    .post-card:hover {
        box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    }

    /* Site hero stays dark regardless */
    .site-hero {
        background: #0C0810;
    }

    /* Tag/author headers stay dark */
    .tag-header,
    .author-header {
        background: #0C0810;
    }

    /* Footer stays dark */
    .site-footer {
        background: #080510;
    }

    /* Related posts bg */
    .related-posts {
        background: var(--color-surface-alt);
    }

    /* Cog's Log indicator */
    .cogs-log-indicator {
        background: linear-gradient(90deg, rgba(201,168,76,0.14) 0%, transparent 100%);
        border-bottom-color: rgba(201, 168, 76, 0.16);
    }

    /* Author card */
    .author-card {
        background: var(--color-surface);
        border-color: var(--color-border);
    }

    /* Scrollbars */
    ::-webkit-scrollbar { width: 8px; height: 8px; }
    ::-webkit-scrollbar-track { background: #0C0810; }
    ::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.3); border-radius: 4px; }
    ::-webkit-scrollbar-thumb:hover { background: rgba(201,168,76,0.5); }

    /* Selection */
    ::selection {
        background: rgba(201, 168, 76, 0.3);
        color: #fff;
    }
}

/* Light mode selection */
::selection {
    background: rgba(21, 16, 21, 0.15);
    color: var(--black);
}

/* Ghost {{navigation}} helper outputs li.nav-* classes */
ul.nav li a {
    display: block;
    padding: var(--sp-2) var(--sp-4);
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color 0.2s, background 0.2s;
}
ul.nav li a:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}
ul.nav li.nav-current a {
    color: #fff;
    background: rgba(255,255,255,0.1);
}
@media (max-width: 768px) {
    ul.nav li {
        width: 100%;
    }
    ul.nav li a {
        border-radius: 0;
        padding: var(--sp-3) var(--sp-5);
        font-size: 1rem;
    }
}
