/* ============================================
   Kai's Dream Journal — Shared Blog Styles
   ============================================ */

:root {
    --charcoal: #1a1a1a;
    --charcoal-light: #2d2d2d;
    --charcoal-mid: #232323;
    --warm-white: #f8f6f3;
    --cream: #ebe7e0;
    --gold: #c9a227;
    --gold-light: #e8d48a;
    --gold-dim: rgba(201, 162, 39, 0.15);
    --text-muted: #7a7a7a;
    --text-body: #c8c3ba;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --serif: 'Instrument Serif', Georgia, serif;
    --sans: 'DM Sans', -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--sans);
    background: var(--charcoal);
    color: var(--text-body);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Grain overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
    z-index: 1000;
    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");
}

/* ---- Navigation ---- */
.blog-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

.blog-nav-logo {
    font-family: var(--serif);
    font-size: 1.25rem;
    color: var(--warm-white);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.blog-nav-links {
    display: flex;
    gap: 2rem;
}

.blog-nav-links a {
    color: var(--cream);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.3s;
}

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

/* ---- Blog Index Page ---- */
.blog-index-hero {
    padding: 10rem 2rem 4rem;
    text-align: center;
    position: relative;
}

.blog-index-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse at center, var(--gold) 0%, transparent 70%);
    opacity: 0.04;
    pointer-events: none;
    filter: blur(80px);
}

.blog-index-label {
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.5rem;
}

.blog-index-title {
    font-family: var(--serif);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 400;
    color: var(--warm-white);
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
}

.blog-index-intro {
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.0625rem;
    color: var(--text-muted);
    line-height: 1.8;
    font-style: italic;
}

/* Post listing */
.blog-list {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 2rem 6rem;
}

.blog-entry {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
    transition: all 0.3s ease;
}

.blog-entry:first-child {
    border-top: 1px solid var(--border-subtle);
}

.blog-entry:hover {
    padding-left: 1rem;
}

.blog-entry:hover .blog-entry-title {
    color: var(--gold);
}

.blog-entry-date {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.blog-entry-title {
    font-family: var(--serif);
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--warm-white);
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
    transition: color 0.3s;
}

.blog-entry-excerpt {
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-entry-thoughts {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.7;
}

/* ---- Blog Post Layout ---- */
.post-header {
    padding: 10rem 2rem 4rem;
    text-align: center;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.post-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 300px;
    background: radial-gradient(ellipse at center, var(--gold) 0%, transparent 70%);
    opacity: 0.04;
    pointer-events: none;
    filter: blur(80px);
}

.post-back {
    display: inline-block;
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 2rem;
    transition: color 0.3s;
}

.post-back:hover {
    color: var(--gold);
}

.post-date {
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.5rem;
}

.post-title {
    font-family: var(--serif);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 400;
    color: var(--warm-white);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.post-subtitle {
    font-size: 1.0625rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Post content */
.post-content {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

/* Thought sections */
.thought {
    margin-bottom: 4rem;
    position: relative;
}

.thought-number {
    font-family: var(--serif);
    font-size: 0.875rem;
    color: var(--gold);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gold-dim);
}

/* Drop cap on first thought */
.thought:first-child .thought-body > p:first-child::first-letter {
    font-family: var(--serif);
    font-size: 3.5em;
    float: left;
    line-height: 0.8;
    margin-right: 0.1em;
    margin-top: 0.05em;
    color: var(--gold);
}

.thought-body p {
    margin-bottom: 1.25rem;
    font-size: 1.0625rem;
    line-height: 1.8;
}

.thought-body strong {
    color: var(--cream);
    font-weight: 500;
}

/* Pull quotes */
.pull-quote {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.375rem;
    color: var(--cream);
    line-height: 1.5;
    margin: 2.5rem 0;
    padding: 1.5rem 0 1.5rem 1.5rem;
    border-left: 2px solid var(--gold);
    opacity: 0.9;
}

/* Connections — margin note style */
.connections {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    background: var(--charcoal-mid);
    border-radius: 4px;
    border-left: 3px solid var(--gold-dim);
    position: relative;
}

.connections-label {
    font-size: 0.6875rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.connections p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-style: italic;
}

.connections code {
    font-size: 0.8125rem;
    background: rgba(201, 162, 39, 0.1);
    color: var(--gold-light);
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

/* Action taken */
.action {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 1.5rem 0 0;
    padding: 1rem 1.25rem;
    background: rgba(201, 162, 39, 0.06);
    border-radius: 4px;
}

.action-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    color: var(--gold);
}

.action-none {
    color: var(--text-muted);
}

.action-done {
    color: var(--gold);
}

.action p {
    font-size: 0.875rem;
    line-height: 1.6;
}

.action-label {
    font-size: 0.6875rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.7;
    margin-bottom: 0.25rem;
}

/* Thought separator */
.thought-separator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 3rem 0;
    gap: 1rem;
}

.thought-separator::before,
.thought-separator::after {
    content: '';
    width: 40px;
    height: 1px;
    background: var(--border-subtle);
}

.thought-separator-dot {
    width: 4px;
    height: 4px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0.5;
}

/* Changelog */
.changelog {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-subtle);
}

.changelog-title {
    font-family: var(--serif);
    font-size: 1.25rem;
    color: var(--cream);
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.changelog-list {
    list-style: none;
}

.changelog-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.changelog-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    opacity: 0.5;
}

.changelog-list code {
    font-size: 0.8125rem;
    background: rgba(201, 162, 39, 0.08);
    color: var(--gold-light);
    padding: 0.1em 0.35em;
    border-radius: 3px;
}

/* Post navigation */
.post-nav {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 2.5rem;
}

.post-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: color 0.3s;
    max-width: 45%;
}

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

.post-nav-label {
    font-size: 0.6875rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.6;
    margin-bottom: 0.25rem;
}

.post-nav-title {
    font-family: var(--serif);
    font-size: 1.125rem;
    color: var(--cream);
    transition: color 0.3s;
}

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

.post-nav-next {
    text-align: right;
    margin-left: auto;
}

/* Footer */
.blog-footer {
    background: var(--charcoal);
    color: var(--text-muted);
    padding: 2rem;
    text-align: center;
    font-size: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

.blog-footer a {
    color: var(--gold);
    text-decoration: none;
}

/* Skipped post style */
.post-skipped {
    text-align: center;
    padding: 4rem 2rem;
}

.post-skipped p {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.25rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.post-skipped-reason {
    margin-top: 1.5rem;
    font-family: var(--sans);
    font-style: normal;
    font-size: 0.875rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .blog-nav {
        padding: 1rem 1.5rem;
    }

    .blog-nav-links {
        gap: 1.25rem;
    }

    .blog-nav-links a {
        font-size: 0.75rem;
    }

    .blog-index-hero {
        padding: 8rem 1.5rem 3rem;
    }

    .blog-list {
        padding: 1.5rem 1.5rem 4rem;
    }

    .blog-entry {
        padding: 2rem 0;
    }

    .blog-entry:hover {
        padding-left: 0;
    }

    .blog-entry-title {
        font-size: 1.375rem;
    }

    .post-header {
        padding: 8rem 1.5rem 3rem;
    }

    .post-content {
        padding: 0 1.5rem 3rem;
    }

    .post-nav {
        padding: 0 1.5rem 3rem;
        padding-top: 2rem;
        flex-direction: column;
        gap: 1.5rem;
    }

    .post-nav a {
        max-width: 100%;
    }

    .post-nav-next {
        text-align: left;
    }

    .thought:first-child .thought-body > p:first-child::first-letter {
        font-size: 3em;
    }

    .pull-quote {
        font-size: 1.1875rem;
        margin: 2rem 0;
    }

    .connections {
        margin: 1.5rem 0;
    }
}

@media (max-width: 480px) {
    .blog-nav-links {
        gap: 1rem;
    }

    .blog-index-title {
        font-size: 2rem;
    }

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

    .blog-entry-title {
        font-size: 1.25rem;
    }
}
