/* ==========================================================================
   Thoughts Ghost Theme - Complete Stylesheet
   Dark-first, text-first, reading-optimized
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Tokens)
   -------------------------------------------------------------------------- */

:root {
    /* Dark mode (default) */
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1e1e1e;
    --text-primary: #f4f2ee;
    --text-secondary: #b0aba2;
    --text-muted: #6b6560;
    --accent: #b0aba2;
    --accent-hover: #f4f2ee;
    --border: #1e1e1e;
    --surface-code: #141414;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Typography */
    --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'IBM Plex Mono', 'Courier New', Courier, monospace;
    --font-size-base: 1rem;
    --font-size-sm: 0.8125rem;
    --font-size-code: 0.9375rem;
    --line-height-base: 1.8;

    /* Layout */
    --content-width: 680px;
    --wide-width: 1000px;
    --header-height: 56px;

    /* Misc */
    --radius: 4px;
    --radius-lg: 8px;
}

[data-color-scheme="light"] {
    --bg-primary: #f4f2ee;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8e5df;
    --text-primary: #0a0a0a;
    --text-secondary: #6b6560;
    --text-muted: #b0aba2;
    --accent: #6b6560;
    --accent-hover: #0a0a0a;
    --border: #e0ddd7;
    --surface-code: #e8e5df;
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

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

body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote, dl, dd {
    margin: 0;
}

ul, ol {
    padding: 0;
    list-style: none;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Base Typography
   -------------------------------------------------------------------------- */

body {
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    line-height: 1.2;
}

h1 {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.3;
}

h3 {
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.4;
}

h4 {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
}

h5, h6 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.site-main {
    min-height: calc(100vh - var(--header-height) - 120px);
}

.site-content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-md);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background-color: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

[data-color-scheme="light"] .site-header {
    background-color: rgba(244, 242, 238, 0.85);
}

.header-inner {
    max-width: var(--wide-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.site-logo {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    flex-shrink: 0;
}

.site-logo img {
    height: 28px;
    width: auto;
}

.site-nav {
    display: none;
}

.site-nav ul {
    display: flex;
    gap: var(--space-lg);
}

.site-nav a {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

.header-actions {
    display: none;
    align-items: center;
    gap: var(--space-md);
}

.header-signin {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.header-signin:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* Mobile nav toggle */
.mobile-nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    padding: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 1px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Mobile nav overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-primary);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.mobile-nav-overlay[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-inner {
    text-align: center;
}

.mobile-nav-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-links ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.mobile-nav-links a {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    color: var(--text-primary);
}

.mobile-nav-actions {
    margin-top: var(--space-2xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.mobile-signin {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Theme Toggle
   -------------------------------------------------------------------------- */

.theme-toggle {
    display: flex;
    gap: 2px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 2px;
}

.theme-toggle-btn {
    font-size: 0.6875rem;
    font-family: var(--font-body);
    padding: 3px 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 2px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

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

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

/* --------------------------------------------------------------------------
   Hero (Homepage)
   -------------------------------------------------------------------------- */

.hero {
    text-align: center;
    padding: var(--space-3xl) 0 var(--space-2xl);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-2xl);
}

.hero-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto var(--space-md);
}

.hero-title {
    font-size: 2.25rem;
    margin-bottom: var(--space-sm);
}

.hero-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto var(--space-lg);
    line-height: 1.6;
}

.hero-subscribe {
    display: inline-block;
    font-size: var(--font-size-sm);
    font-family: var(--font-body);
    padding: var(--space-sm) var(--space-lg);
    color: var(--bg-primary);
    background: var(--text-primary);
    border-radius: var(--radius);
    transition: opacity 0.15s ease;
}

.hero-subscribe:hover {
    color: var(--bg-primary);
    opacity: 0.85;
}

/* --------------------------------------------------------------------------
   Tag Filter
   -------------------------------------------------------------------------- */

.tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.tag-filter-btn {
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    padding: var(--space-xs) var(--space-sm);
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.tag-filter-btn:hover {
    color: var(--text-secondary);
    border-color: var(--text-muted);
}

.tag-filter-btn.active {
    color: var(--accent);
    border-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Post Feed (List)
   -------------------------------------------------------------------------- */

.post-feed-title {
    font-size: 1rem;
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-lg);
}

.post-card {
    border-bottom: 1px solid var(--border);
    transition: background-color 0.15s ease;
}

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

.post-card-link {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-lg);
    padding: var(--space-lg) var(--space-sm);
    text-decoration: none;
    color: inherit;
}

.post-card-content {
    flex: 1;
    min-width: 0;
}

.post-card-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.post-card-excerpt {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    flex-shrink: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    align-items: flex-end;
}

.post-card-date {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    white-space: nowrap;
}

.post-card-tag {
    font-size: 0.6875rem;
    color: var(--text-muted);
    padding: 1px 6px;
    border: 1px solid var(--border);
    border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-2xl) 0;
}

.pagination-prev, .pagination-next {
    font-size: var(--font-size-sm);
    color: var(--accent);
}

.pagination-info {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Post (Single)
   -------------------------------------------------------------------------- */

.post-full {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-md);
}

.post-header {
    margin-bottom: var(--space-2xl);
}

.post-tag {
    display: inline-block;
    font-size: var(--font-size-sm);
    color: var(--accent);
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: var(--space-md);
    text-decoration: none;
}

.post-tag:hover {
    border-color: var(--accent);
}

.post-title {
    font-size: 2.25rem;
    margin-bottom: var(--space-md);
}

.post-meta {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
}

.post-meta-sep {
    color: var(--text-muted);
}

.post-feature-image {
    margin-bottom: var(--space-2xl);
}

.post-feature-image img {
    width: 100%;
    border-radius: var(--radius-lg);
}

.post-feature-image figcaption {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-align: center;
    margin-top: var(--space-sm);
}

/* Post Content Wrapper (TOC + Content) */
.post-content-wrap {
    position: relative;
}

/* --------------------------------------------------------------------------
   Table of Contents (Sidebar)
   -------------------------------------------------------------------------- */

.toc-sidebar {
    margin-bottom: var(--space-2xl);
}

.toc-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
}

.toc-details summary {
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toc-details summary::-webkit-details-marker {
    display: none;
}

.toc-details summary::after {
    content: '+';
    font-family: var(--font-body);
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: transform 0.15s ease;
}

.toc-details[open] summary::after {
    content: '\2212';
}

.toc-nav {
    margin-top: var(--space-md);
}

.toc-nav ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-nav li {
    margin-bottom: var(--space-xs);
}

.toc-nav a {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    padding: 2px 0;
    border-left: 2px solid transparent;
    padding-left: var(--space-sm);
    transition: color 0.15s ease, border-color 0.15s ease;
}

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

.toc-nav a.active {
    color: var(--accent-hover);
    border-left-color: var(--accent);
}

.toc-nav .toc-h3 {
    padding-left: var(--space-lg);
}

/* Desktop sticky TOC */
@media (min-width: 1200px) {
    .post-content-wrap {
        display: grid;
        grid-template-columns: 220px 1fr;
        gap: var(--space-2xl);
    }

    .toc-sidebar {
        margin-bottom: 0;
    }

    .toc-container {
        position: sticky;
        top: calc(var(--header-height) + var(--space-lg));
        max-height: calc(100vh - var(--header-height) - var(--space-2xl));
        overflow-y: auto;
    }

    .toc-details {
        pointer-events: auto;
    }

    .toc-details summary::after {
        display: none;
    }

    .post-full {
        max-width: calc(var(--content-width) + 220px + 3rem);
    }
}

/* --------------------------------------------------------------------------
   Ghost Content (Post Body)
   -------------------------------------------------------------------------- */

.gh-content {
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    overflow-wrap: break-word;
    word-break: break-word;
}

.gh-content > * + * {
    margin-top: var(--space-lg);
}

.gh-content h2 {
    margin-top: var(--space-2xl);
}

.gh-content h3 {
    margin-top: var(--space-xl);
}

.gh-content h4, .gh-content h5, .gh-content h6 {
    margin-top: var(--space-lg);
}

.gh-content p {
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
}

.gh-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gh-content a:hover {
    color: var(--accent-hover);
}

.gh-content strong {
    font-weight: 700;
}

.gh-content em {
    font-style: italic;
}

.gh-content ul, .gh-content ol {
    padding-left: var(--space-xl);
}

.gh-content ul {
    list-style: disc;
}

.gh-content ol {
    list-style: decimal;
}

.gh-content li {
    margin-bottom: var(--space-sm);
}

.gh-content li + li {
    margin-top: var(--space-xs);
}

/* Blockquotes */
.gh-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: var(--space-lg);
    margin-left: 0;
    font-style: italic;
    color: var(--text-secondary);
}

.gh-content blockquote p {
    margin-bottom: var(--space-sm);
}

/* Horizontal rules */
.gh-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: var(--space-2xl) 0;
}

/* Code */
.gh-content code {
    font-family: var(--font-body);
    font-size: var(--font-size-code);
    background: var(--surface-code);
    padding: 2px 6px;
    border-radius: 3px;
}

.gh-content pre {
    background: var(--surface-code);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    overflow-x: auto;
    line-height: 1.6;
}

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

/* Images */
.gh-content img {
    border-radius: var(--radius-lg);
}

.gh-content figcaption {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-align: center;
    margin-top: var(--space-sm);
}

/* Tables */
.gh-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.gh-content th, .gh-content td {
    text-align: left;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border);
}

.gh-content th {
    font-weight: 600;
    color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   Ghost Card Classes (kg-*)
   -------------------------------------------------------------------------- */

.gh-content .kg-card {
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

/* Width modifiers */
.gh-content .kg-width-wide {
    max-width: var(--wide-width);
    margin-left: calc(50% - min(var(--wide-width) / 2, 50vw));
    margin-right: calc(50% - min(var(--wide-width) / 2, 50vw));
    width: min(var(--wide-width), 100vw);
}

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

/* Image card */
.gh-content .kg-image-card img,
.gh-content .kg-gallery-image img {
    width: 100%;
    height: auto;
}

/* Gallery */
.gh-content .kg-gallery-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.gh-content .kg-gallery-row {
    display: flex;
    gap: var(--space-md);
}

.gh-content .kg-gallery-image {
    flex: 1;
}

/* Bookmark card */
.gh-content .kg-bookmark-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.gh-content .kg-bookmark-container {
    display: flex;
    text-decoration: none;
    color: inherit;
}

.gh-content .kg-bookmark-content {
    padding: var(--space-md);
    flex: 1;
}

.gh-content .kg-bookmark-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.gh-content .kg-bookmark-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    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(--space-sm);
    margin-top: var(--space-sm);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

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

.gh-content .kg-bookmark-author,
.gh-content .kg-bookmark-publisher {
    font-size: var(--font-size-sm);
}

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

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

/* Callout card */
.gh-content .kg-callout-card {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

.gh-content .kg-callout-emoji {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.gh-content .kg-callout-text {
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
}

/* Button card */
.gh-content .kg-button-card {
    display: flex;
    justify-content: center;
}

.gh-content .kg-btn {
    display: inline-block;
    padding: var(--space-sm) var(--space-xl);
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    text-decoration: none;
    border-radius: var(--radius);
    transition: opacity 0.15s ease;
}

.gh-content .kg-btn:hover {
    opacity: 0.85;
}

.gh-content .kg-btn-accent {
    background: var(--accent);
    color: var(--bg-primary);
}

/* Toggle card */
.gh-content .kg-toggle-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
}

.gh-content .kg-toggle-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.gh-content .kg-toggle-heading h4 {
    margin: 0;
}

/* Header card */
.gh-content .kg-header-card {
    padding: var(--space-3xl) var(--space-xl);
    text-align: center;
    border-radius: var(--radius-lg);
}

/* Video/Audio card */
.gh-content .kg-video-card,
.gh-content .kg-audio-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

/* File card */
.gh-content .kg-file-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
}

.gh-content .kg-file-card-container {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-decoration: none;
    color: inherit;
}

.gh-content .kg-file-card-title {
    font-weight: 600;
    color: var(--text-primary);
}

.gh-content .kg-file-card-caption {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.gh-content .kg-file-card-metadata {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* Embed / NFT / Product - generic */
.gh-content .kg-embed-card {
    display: flex;
    justify-content: center;
}

.gh-content .kg-embed-card iframe {
    max-width: 100%;
}

.gh-content .kg-nft-card,
.gh-content .kg-product-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

/* --------------------------------------------------------------------------
   Post Footer
   -------------------------------------------------------------------------- */

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: var(--space-2xl) 0;
    border-top: 1px solid var(--border);
    margin-top: var(--space-2xl);
}

/* Author card */
.post-author-card {
    display: flex;
    gap: var(--space-lg);
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--border);
}

.author-card-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    flex-shrink: 0;
}

.author-card-name {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    margin-bottom: var(--space-xs);
}

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

.author-card-bio {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Related posts */
.post-related {
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--border);
}

.post-related-title {
    font-size: 1rem;
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.post-related-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.post-related-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

.post-related-item h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.post-related-item time {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    white-space: nowrap;
}

.post-related-item:hover h4 {
    color: var(--accent-hover);
}

/* Newsletter CTA */
.post-newsletter-cta {
    text-align: center;
    padding: var(--space-2xl);
    margin-top: var(--space-xl);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.post-newsletter-cta h3 {
    font-family: var(--font-heading);
    font-size: 1.375rem;
    margin-bottom: var(--space-sm);
}

.post-newsletter-cta p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    padding: var(--space-sm) var(--space-xl);
    color: var(--bg-primary);
    background: var(--text-primary);
    border-radius: var(--radius);
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.btn:hover {
    color: var(--bg-primary);
    opacity: 0.85;
}

/* --------------------------------------------------------------------------
   Tag Archive
   -------------------------------------------------------------------------- */

.tag-header {
    padding-bottom: var(--space-2xl);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-lg);
}

.tag-title {
    font-size: 2.25rem;
    margin-bottom: var(--space-sm);
}

.tag-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 540px;
}

/* --------------------------------------------------------------------------
   Author Page
   -------------------------------------------------------------------------- */

.author-header {
    text-align: center;
    padding-bottom: var(--space-2xl);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-lg);
}

.author-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    margin: 0 auto var(--space-md);
}

.author-name {
    font-size: 2.25rem;
    margin-bottom: var(--space-sm);
}

.author-bio {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto var(--space-md);
    line-height: 1.6;
}

.author-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.author-social {
    color: var(--accent);
}

/* --------------------------------------------------------------------------
   Error Page
   -------------------------------------------------------------------------- */

.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: var(--space-2xl);
}

.error-code {
    font-size: 6rem;
    font-family: var(--font-heading);
    font-weight: 900;
    color: var(--text-muted);
    line-height: 1;
    margin-bottom: var(--space-md);
}

.error-message {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.error-link {
    font-size: var(--font-size-sm);
    color: var(--accent);
    border: 1px solid var(--border);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius);
    transition: border-color 0.15s ease;
}

.error-link:hover {
    border-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

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

.footer-inner {
    max-width: var(--wide-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
}

.footer-site-name {
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.footer-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer-nav a {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

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

.footer-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.footer-powered {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

/* Phones and up: base styles already mobile-first */

@media (min-width: 768px) {
    .site-nav {
        display: block;
    }

    .header-actions {
        display: flex;
    }

    .mobile-nav-toggle {
        display: none;
    }

    .post-card-link {
        align-items: center;
    }

    h1, .post-title, .hero-title, .tag-title, .author-name {
        font-size: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .site-content {
        padding: var(--space-3xl) var(--space-md);
    }
}

@media (max-width: 479px) {
    .post-card-link {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .post-card-meta {
        flex-direction: row;
        align-items: center;
        gap: var(--space-sm);
        text-align: left;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .post-title {
        font-size: 1.75rem;
    }

    .post-author-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}

/* --------------------------------------------------------------------------
   Prefers Reduced Motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */

@media print {
    .site-header,
    .site-footer,
    .toc-sidebar,
    .tag-filter,
    .post-newsletter-cta,
    .post-related,
    .pagination,
    .hero-subscribe,
    .header-actions,
    .mobile-nav-toggle,
    .mobile-nav-overlay,
    .theme-toggle {
        display: none !important;
    }

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

    a {
        color: #000;
        text-decoration: underline;
    }

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

    .gh-content img {
        max-width: 100%;
        page-break-inside: avoid;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }

    .post-content-wrap {
        display: block;
    }
}
