/* ========================================
   ChartDojo Ghost Theme - Style.css
   Matching the main ChartDojo design system
   ======================================== */

/* ----------------------------------------
   CSS Variables
   ---------------------------------------- */
:root {
    /* Colors */
    --color-bg: #09090b;
    --color-bg-elevated: rgba(255, 255, 255, 0.03);
    --color-bg-hover: rgba(255, 255, 255, 0.05);
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-hover: rgba(255, 255, 255, 0.15);

    /* Primary - Violet/Purple */
    --color-primary-300: #d8b4fe;
    --color-primary-400: #c084fc;
    --color-primary-500: #a855f7;
    --color-primary-600: #9333ea;
    --color-primary-700: #7c3aed;

    /* Text */
    --color-text-primary: #ffffff;
    --color-text-secondary: #a1a1aa;
    --color-text-muted: #71717a;

    /* Accent Colors */
    --color-success: #22c55e;
    --color-danger: #ef4444;
    --color-indigo: #6366f1;
    --color-pink: #ec4899;

    /* Fonts */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', Menlo, monospace;

    /* Spacing */
    --container-max: 1200px;
    --container-narrow: 720px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
}

/* ----------------------------------------
   Reset & Base
   ---------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text-secondary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* ----------------------------------------
   Layout
   ---------------------------------------- */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-narrow {
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* ----------------------------------------
   Header
   ---------------------------------------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
}

.header-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    object-fit: cover;
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.header-nav {
    display: none;
    align-items: center;
    gap: 2rem;
}

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

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--color-text-primary);
}

.header-actions {
    display: none;
    align-items: center;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .header-actions {
        display: flex;
    }
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--color-text-primary);
    cursor: pointer;
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(20px);
    padding: 2rem 1.5rem;
    padding-bottom: 3rem;
    z-index: 99;
    border-bottom: 1px solid var(--color-border);
}

.mobile-menu.is-open {
    display: block;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.mobile-nav-link {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.mobile-nav-divider {
    height: 1px;
    width: 100%;
    background: var(--color-border);
}

.mobile-cta {
    margin-top: 1rem;
    text-align: center;
}

/* ----------------------------------------
   Ticker Bar
   ---------------------------------------- */
.ticker-bar {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    z-index: 99;
    border-bottom: 1px solid var(--color-border);
}

.ticker-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: -1;
}

.ticker-wrapper {
    width: 100%;
    overflow: hidden;
    padding: 0.625rem 0;
}

.ticker-track {
    display: flex;
    width: max-content;
    will-change: transform;
}

.ticker-set {
    display: flex;
    flex-shrink: 0;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1.5rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.ticker-symbol {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.ticker-price {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.ticker-change {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
}

.ticker-change.up {
    color: var(--color-success);
}

.ticker-change.down {
    color: var(--color-danger);
}

.ticker-change svg {
    width: 12px;
    height: 12px;
}


/* ----------------------------------------
   Buttons
   ---------------------------------------- */
.btn-glow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: 9999px;
    transition: all var(--transition-normal);
    box-shadow:
        0 4px 15px rgba(139, 92, 246, 0.4),
        0 0 0 0 rgba(139, 92, 246, 0);
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 25px rgba(139, 92, 246, 0.5),
        0 0 40px rgba(139, 92, 246, 0.2);
}

.btn-glow-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 9999px;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}

.btn-glow-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-glass {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.75rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-border);
    color: white;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: 9999px;
    transition: all var(--transition-normal);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-border-hover);
}

.btn-glass-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 9999px;
    transition: all var(--transition-fast);
}

.btn-glass-sm:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-primary);
}

/* ----------------------------------------
   Glass Effects
   ---------------------------------------- */
.glass-card {
    background: var(--color-bg-elevated);
    backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.glass-card-hover {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    transition: all var(--transition-normal);
}

.glass-card-hover:hover {
    background: var(--color-bg-hover);
    border-color: var(--color-border);
    transform: translateY(-4px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(139, 92, 246, 0.1);
}

/* ----------------------------------------
   Aurora Background
   ---------------------------------------- */
.aurora-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.aurora {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: aurora-drift 20s ease-in-out infinite;
}

.aurora-1 {
    top: -30%;
    left: 10%;
    width: 500px;
    height: 500px;
    background: linear-gradient(180deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
    animation-delay: 0s;
}

.aurora-2 {
    top: -20%;
    right: 10%;
    width: 400px;
    height: 400px;
    background: linear-gradient(180deg, #ec4899 0%, #8b5cf6 50%, #6366f1 100%);
    animation-delay: -5s;
}

@keyframes aurora-drift {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    25% {
        transform: translate(50px, 30px) rotate(5deg) scale(1.05);
    }
    50% {
        transform: translate(-30px, 50px) rotate(-5deg) scale(0.95);
    }
    75% {
        transform: translate(-50px, -20px) rotate(3deg) scale(1.02);
    }
}

/* Noise Overlay */
.noise-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 1;
}

/* ----------------------------------------
   Text Gradient
   ---------------------------------------- */
.text-gradient {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 50%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-white {
    color: var(--color-text-primary);
}

/* ----------------------------------------
   Blog Hero
   ---------------------------------------- */
.blog-hero {
    position: relative;
    padding: 10.5rem 1.5rem 6rem;
    text-align: center;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .hero-title {
        font-size: 4rem;
    }
}

.hero-description {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ----------------------------------------
   Featured Section
   ---------------------------------------- */
.featured-section {
    padding: 0 0 4rem;
}

.featured-post {
    display: grid;
    gap: 2rem;
    overflow: hidden;
    transition: all var(--transition-normal);
}

@media (min-width: 768px) {
    .featured-post {
        grid-template-columns: 1.2fr 1fr;
    }
}

.featured-post:hover {
    transform: translateY(-4px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(139, 92, 246, 0.1);
}

.featured-image {
    overflow: hidden;
    border-radius: 0.75rem;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.featured-post:hover .featured-image img {
    transform: scale(1.05);
}

.featured-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.featured-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.3;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .featured-title {
        font-size: 2rem;
    }
}

.featured-excerpt {
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.featured-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.read-more {
    color: var(--color-primary-400);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.featured-post:hover .read-more {
    color: var(--color-primary-300);
}

/* ----------------------------------------
   Posts Section
   ---------------------------------------- */
.posts-section {
    padding: 4rem 0;
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.posts-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* ----------------------------------------
   Post Card
   ---------------------------------------- */
.post-card {
    overflow: hidden;
}

.post-card-link {
    display: block;
    height: 100%;
}

.post-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

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

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

.post-content {
    padding: 1.5rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
}

.post-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(139, 92, 246, 0.15);
    color: var(--color-primary-400);
    font-weight: 500;
    border-radius: 9999px;
}

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

.post-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.4;
    margin-bottom: 0.5rem;
    transition: color var(--transition-fast);
}

.post-card:hover .post-title {
    color: var(--color-primary-300);
}

.post-excerpt {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.post-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.reading-time {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* ----------------------------------------
   Pagination
   ---------------------------------------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.pagination-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.pagination-link:hover {
    color: var(--color-primary-400);
}

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

/* ----------------------------------------
   Post Author
   ---------------------------------------- */
.post-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.author-avatar-lg {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary-600), var(--color-primary-700));
    color: white;
    font-weight: 600;
}

.post-author span {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

/* ----------------------------------------
   Newsletter Section
   ---------------------------------------- */
.newsletter-section {
    padding: 4rem 0;
}

.newsletter-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 3rem 2rem;
    text-align: center;
}

@media (min-width: 768px) {
    .newsletter-card {
        flex-direction: row;
        text-align: left;
        justify-content: space-between;
        padding: 3rem;
    }
}

.newsletter-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.newsletter-content p {
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
}

.newsletter-form {
    width: 100%;
    max-width: 400px;
}

.newsletter-input-group {
    display: flex;
    gap: 0.75rem;
}

.newsletter-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: 9999px;
    color: var(--color-text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.newsletter-input::placeholder {
    color: var(--color-text-muted);
}

.newsletter-input:focus {
    outline: none;
    border-color: var(--color-primary-500);
    background: rgba(255, 255, 255, 0.08);
}

.newsletter-btn {
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.newsletter-message {
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.newsletter-success {
    color: var(--color-success);
    display: none;
}

.newsletter-error {
    color: var(--color-danger);
    display: none;
}

.newsletter-form.success .newsletter-success {
    display: block;
}

.newsletter-form.error .newsletter-error {
    display: block;
}

/* ----------------------------------------
   CTA Section
   ---------------------------------------- */
.cta-section {
    padding: 4rem 0 6rem;
}

.cta-card {
    padding: 4rem 2rem;
    text-align: center;
    border-radius: 1.5rem;
}

@media (min-width: 640px) {
    .cta-card {
        padding: 5rem 3rem;
    }
}

.cta-card h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .cta-card h2 {
        font-size: 2.5rem;
    }
}

.cta-card p {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
}

/* ----------------------------------------
   Post Article (Single Post)
   ---------------------------------------- */
.post-article {
    padding-top: 8.5rem;
}

.post-header {
    padding: 2rem 0 3rem;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--color-primary-400);
}

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

.post-meta-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.post-title-main {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-text-primary);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .post-title-main {
        font-size: 3rem;
    }
}

.post-excerpt-main {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.post-author-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.author-name {
    font-weight: 600;
    color: var(--color-text-primary);
}

.author-bio {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Feature Image */
.post-feature-image {
    margin-bottom: 3rem;
}

.feature-image-wrapper {
    overflow: hidden;
    border-radius: 1rem;
}

.feature-image-wrapper img {
    width: 100%;
    height: auto;
}

/* Post Body */
.post-body {
    padding-bottom: 3rem;
}

/* ----------------------------------------
   Prose (Article Content)
   ---------------------------------------- */
.prose {
    color: var(--color-text-secondary);
    font-size: 1.0625rem;
    line-height: 1.8;
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    color: var(--color-text-primary);
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.prose h1 { font-size: 2rem; }
.prose h2 { font-size: 1.75rem; }
.prose h3 { font-size: 1.5rem; }
.prose h4 { font-size: 1.25rem; }

.prose p {
    margin-bottom: 1.5rem;
}

.prose a {
    color: var(--color-primary-400);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose a:hover {
    color: var(--color-primary-300);
}

.prose strong {
    color: var(--color-text-primary);
    font-weight: 600;
}

.prose em {
    font-style: italic;
}

.prose ul, .prose ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose ul li::marker {
    color: var(--color-primary-500);
}

.prose ol li::marker {
    color: var(--color-primary-500);
    font-weight: 600;
}

.prose blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: var(--color-bg-elevated);
    border-left: 4px solid var(--color-primary-500);
    border-radius: 0.5rem;
    font-style: italic;
}

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

.prose code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--color-bg-elevated);
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    color: var(--color-primary-300);
}

.prose pre {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    overflow-x: auto;
}

.prose pre code {
    background: none;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
}

.prose img {
    margin: 2rem auto;
    border-radius: 0.75rem;
    max-width: 100%;
    height: auto;
    display: block;
}

.prose figure {
    margin: 2rem 0;
}

.prose figcaption {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-align: center;
}

.prose hr {
    margin: 3rem 0;
    border: none;
    border-top: 1px solid var(--color-border);
}

.prose table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
}

.prose th, .prose td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    text-align: left;
}

.prose th {
    background: var(--color-bg-elevated);
    color: var(--color-text-primary);
    font-weight: 600;
}

/* ----------------------------------------
   Post Footer (Tags)
   ---------------------------------------- */
.post-footer {
    padding: 2rem 0;
    border-top: 1px solid var(--color-border);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.tags-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.tag-link {
    display: inline-block;
    padding: 0.375rem 1rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    border-radius: 9999px;
    transition: all var(--transition-fast);
}

.tag-link:hover {
    background: var(--color-bg-hover);
    color: var(--color-primary-400);
    border-color: var(--color-primary-500);
}

/* ----------------------------------------
   Author Section
   ---------------------------------------- */
.author-section {
    padding: 3rem 0;
}

.author-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    text-align: center;
}

@media (min-width: 640px) {
    .author-card {
        flex-direction: row;
        text-align: left;
        padding: 2.5rem;
    }
}

.author-card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-card-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.author-card-info p {
    color: var(--color-text-secondary);
    margin-bottom: 0.75rem;
}

.author-social {
    color: var(--color-primary-400);
    font-size: 0.875rem;
}

.author-social:hover {
    color: var(--color-primary-300);
}

.author-socials {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.author-socials:empty {
    display: none;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.social-icon:hover {
    color: var(--color-primary-400);
    border-color: var(--color-primary-500);
    background: var(--color-bg-hover);
}

/* ----------------------------------------
   Related Section
   ---------------------------------------- */
.related-section {
    padding: 4rem 0;
    border-top: 1px solid var(--color-border);
}

.related-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 2rem;
}

.related-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* ----------------------------------------
   Tag Header
   ---------------------------------------- */
.tag-header {
    padding: 10.5rem 1.5rem 4rem;
    text-align: center;
}

.tag-header-content {
    max-width: 600px;
    margin: 0 auto;
}

.tag-label {
    display: inline-block;
    padding: 0.25rem 1rem;
    background: rgba(139, 92, 246, 0.15);
    color: var(--color-primary-400);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 9999px;
    margin-bottom: 1rem;
}

.tag-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
}

.tag-description {
    color: var(--color-text-secondary);
}

/* ----------------------------------------
   Author Header
   ---------------------------------------- */
.author-header {
    padding: 10.5rem 0 4rem;
}

.author-header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2.5rem;
    text-align: center;
}

@media (min-width: 640px) {
    .author-header-content {
        flex-direction: row;
        text-align: left;
        padding: 3rem;
    }
}

.author-header-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-header-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.author-header-bio {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

.author-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 2rem;
}

/* ----------------------------------------
   Page Article
   ---------------------------------------- */
.page-article {
    padding-top: 8.5rem;
}

.page-header {
    padding: 2rem 0 3rem;
    text-align: center;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .page-title {
        font-size: 3rem;
    }
}

.page-description {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
}

.page-body {
    padding-bottom: 4rem;
}

.page-content {
    /* Uses .prose styles */
}

/* ----------------------------------------
   Error Page
   ---------------------------------------- */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.error-content {
    max-width: 500px;
}

.error-code {
    font-size: 8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 50%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 1rem;
}

.error-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
}

.error-description {
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

/* ----------------------------------------
   Footer
   ---------------------------------------- */
.site-footer {
    border-top: 1px solid var(--color-border);
}

.footer-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 2rem 1rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-brand-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-logo-img {
    width: 28px;
    height: 28px;
    border-radius: 0.25rem;
    object-fit: cover;
}

.footer-logo span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.footer-copyright {
    font-size: 0.875rem;
    color: #52525b;
}

.footer-links-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.footer-links-row a {
    font-size: 0.875rem;
    color: #71717a;
    transition: color var(--transition-fast);
}

.footer-links-row a:hover {
    color: #d4d4d8;
}

/* ----------------------------------------
   Responsive Utilities
   ---------------------------------------- */
@media (max-width: 640px) {
    .featured-content {
        padding: 1.5rem;
    }

    .featured-title {
        font-size: 1.5rem;
    }
}

/* ----------------------------------------
   Selection
   ---------------------------------------- */
::selection {
    background: rgba(168, 85, 247, 0.3);
    color: white;
}

/* ----------------------------------------
   Scrollbar
   ---------------------------------------- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ----------------------------------------
   Code Copy Button
   ---------------------------------------- */
.code-wrapper {
    position: relative;
}

.copy-button {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    color: var(--color-text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition-fast);
}

.code-wrapper:hover .copy-button {
    opacity: 1;
}

.copy-button:hover {
    background: var(--color-bg-hover);
    color: var(--color-primary-400);
    border-color: var(--color-primary-500);
}

/* ----------------------------------------
   Animation Utilities
   ---------------------------------------- */
[data-animate] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ----------------------------------------
   Ghost Content (gh-content)
   ---------------------------------------- */
.gh-content {
    position: relative;
    word-break: break-word;
}

.gh-content > * + * {
    margin-top: 1.5rem;
}

.gh-content > [id] + * {
    margin-top: 1rem;
}

.gh-content [id]:not(:first-child) {
    margin-top: 2.5rem;
}

/* Constrain all images in content */
.gh-content img,
.prose img,
.kg-image {
    max-width: 100% !important;
    max-height: 500px !important;
    width: auto !important;
    height: auto !important;
    margin-left: auto;
    margin-right: auto;
    display: block;
    object-fit: contain;
}

/* Ghost card figure elements */
.gh-content figure,
.kg-card {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
}

.gh-content figure img,
.kg-card img {
    border-radius: 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-height: 500px !important;
}

.gh-content figure figcaption,
.kg-card figcaption {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-align: center;
    max-width: 80%;
}

/* ----------------------------------------
   Ghost-specific Overrides
   ---------------------------------------- */
.kg-card {
    margin: 2rem 0;
}

/* Required Ghost width classes - constrained to reasonable sizes */
.kg-width-wide {
    max-width: 1000px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.kg-width-full {
    max-width: 1200px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Ensure wide/full images don't exceed max-height */
.kg-width-wide img,
.kg-width-full img {
    max-height: 70vh;
    width: auto;
    max-width: 100%;
}

.kg-image-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
}

.kg-image-card img,
.kg-image-card .kg-image {
    max-width: 100% !important;
    max-height: 450px !important;
    width: auto !important;
    height: auto !important;
    border-radius: 0.75rem;
    object-fit: contain;
}

.kg-image-card figcaption {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-align: center;
}

.kg-gallery-card {
    margin: 2rem 0;
}

.kg-gallery-container {
    display: grid;
    gap: 0.5rem;
}

.kg-gallery-row {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.kg-gallery-image img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.kg-bookmark-card {
    margin: 2rem 0;
}

.kg-bookmark-container {
    display: flex;
    flex-direction: column;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    overflow: hidden;
    text-decoration: none;
    transition: all var(--transition-fast);
}

@media (min-width: 640px) {
    .kg-bookmark-container {
        flex-direction: row;
    }
}

.kg-bookmark-container:hover {
    border-color: var(--color-border-hover);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.kg-bookmark-content {
    flex: 1;
    padding: 1.5rem;
}

.kg-bookmark-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.kg-bookmark-description {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

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

.kg-bookmark-thumbnail {
    width: 100%;
    max-width: 200px;
}

@media (min-width: 640px) {
    .kg-bookmark-thumbnail {
        width: 200px;
    }
}

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

.kg-embed-card {
    margin: 2rem 0;
}

.kg-embed-card iframe {
    width: 100%;
    border-radius: 0.75rem;
}

.kg-callout-card {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    display: flex;
    gap: 1rem;
}

.kg-callout-emoji {
    font-size: 1.25rem;
}

.kg-callout-text {
    flex: 1;
    color: var(--color-text-secondary);
}

.kg-toggle-card {
    margin: 2rem 0;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
}

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

.kg-toggle-heading-text {
    font-weight: 600;
    color: var(--color-text-primary);
}

.kg-toggle-content {
    padding: 0 1.5rem 1.5rem;
    color: var(--color-text-secondary);
}

.kg-button-card {
    margin: 2rem 0;
    text-align: center;
}

.kg-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    font-weight: 600;
    border-radius: 9999px;
    text-decoration: none;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.kg-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}
