/* ============================================================
   chronicles.css — The Manuscript Engine Stylesheets
   Design tokens inherited from theme.css:
     --color-brass:   #B5935B  (accent, borders, hovers)
     --color-ink:     #1A1A1A  (rich dark ink)
     --color-vellum:  #F4F1EA  (primary reading text)
     --color-obsidian:#020202  (background void)
     --color-walnut:  #1A110A  (surface warmth)
   ============================================================ */

/* ── SHARED UTILITIES ──────────────────────────────────────── */

.chronicles-wrapper,
.post-wrapper {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1.5rem 5rem;
    animation: fadeSlideIn 0.5s ease both;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── CHRONICLES INDEX ──────────────────────────────────────── */

.chronicles-header {
    text-align: center;
    margin-bottom: 4rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(181, 147, 91, 0.15);
}

.chronicles-header-eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: rgba(181, 147, 91, 0.5);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.chronicles-rule {
    display: inline-block;
    width: 40px;
    height: 1px;
    background: rgba(181, 147, 91, 0.3);
}

.chronicles-title {
    font-family: 'EB Garamond', serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 400;
    color: var(--color-brass);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0 0 1rem;
    line-height: 1.1;
}

.chronicles-subtitle {
    font-family: 'EB Garamond', serif;
    font-size: 1rem;
    color: rgba(244, 241, 234, 0.55);
    max-width: 480px;
    margin: 0 auto 1.5rem;
    line-height: 1.7;
    font-style: italic;
}

.chronicles-ornament {
    color: rgba(181, 147, 91, 0.4);
    font-size: 1.4rem;
    letter-spacing: 0.3em;
}

.chronicles-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(244, 241, 234, 0.3);
}

/* ── POST LIST (BENTO ENTRIES) ─────────────────────────────── */

.chronicles-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.chronicle-entry {
    opacity: 0;
    animation: entryReveal 0.45s ease forwards;
    border-bottom: 1px solid rgba(181, 147, 91, 0.1);
}

.chronicle-entry:first-child {
    border-top: 1px solid rgba(181, 147, 91, 0.1);
}

@keyframes entryReveal {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

.chronicle-link {
    display: block;
    padding: 2rem 1.5rem;
    text-decoration: none;
    color: inherit;
    position: relative;
    transition: background 0.25s ease;
}

.chronicle-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-brass);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.chronicle-link:hover {
    background: rgba(181, 147, 91, 0.04);
}

.chronicle-link:hover::before {
    transform: scaleY(1);
}

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

.chronicle-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: rgba(181, 147, 91, 0.6);
    text-transform: uppercase;
}

.chronicle-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.chronicle-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    color: rgba(181, 147, 91, 0.45);
    background: rgba(181, 147, 91, 0.06);
    border: 1px solid rgba(181, 147, 91, 0.15);
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    text-transform: lowercase;
}

.chronicle-entry-title {
    font-family: 'EB Garamond', serif;
    font-size: clamp(1.3rem, 3vw, 1.75rem);
    font-weight: 500;
    color: var(--color-vellum);
    margin: 0 0 0.6rem;
    line-height: 1.25;
    transition: color 0.2s ease;
}

.chronicle-link:hover .chronicle-entry-title {
    color: var(--color-brass);
}

.chronicle-excerpt {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: rgba(244, 241, 234, 0.5);
    line-height: 1.6;
    margin: 0 0 1rem;
    max-width: 640px;
}

.chronicle-read-more {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(181, 147, 91, 0.5);
    transition: color 0.2s ease, gap 0.2s ease;
}

.chronicle-link:hover .chronicle-read-more {
    color: var(--color-brass);
    gap: 0.75rem;
}

/* ── SINGLE POST — BREADCRUMB ──────────────────────────────── */

.post-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 3rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(181, 147, 91, 0.4);
}

.post-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(181, 147, 91, 0.6);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.post-breadcrumb-sep {
    color: rgba(181, 147, 91, 0.2);
}

.post-breadcrumb-current {
    color: rgba(244, 241, 234, 0.35);
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── SINGLE POST — MANUSCRIPT CHROME ──────────────────────── */

.manuscript {
    background: rgba(26, 17, 10, 0.4);
    border: 1px solid rgba(181, 147, 91, 0.12);
    padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 6vw, 4.5rem);
    max-width: 800px;
    margin: 0 auto;
    box-shadow:
        0 0 0 1px rgba(181, 147, 91, 0.04),
        0 24px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(181, 147, 91, 0.08);
    position: relative;
}

/* Corner ornaments */
.manuscript::before,
.manuscript::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: rgba(181, 147, 91, 0.35);
    border-style: solid;
}

.manuscript::before {
    top: -1px;
    left: -1px;
    border-width: 1px 0 0 1px;
}

.manuscript::after {
    bottom: -1px;
    right: -1px;
    border-width: 0 1px 1px 0;
}

.manuscript-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(181, 147, 91, 0.12);
}

.manuscript-tags {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.manuscript-title {
    font-family: 'EB Garamond', serif;
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 500;
    color: var(--color-vellum);
    line-height: 1.2;
    margin: 0 0 1rem;
    letter-spacing: 0.02em;
}

.manuscript-lede {
    font-family: 'EB Garamond', serif;
    font-size: 1.1rem;
    font-style: italic;
    color: rgba(244, 241, 234, 0.6);
    line-height: 1.7;
    max-width: 560px;
    margin: 0 auto 1.5rem;
}

.manuscript-byline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: rgba(181, 147, 91, 0.5);
    text-transform: uppercase;
}

.manuscript-byline-rule {
    flex: 1;
    max-width: 60px;
    height: 1px;
    background: rgba(181, 147, 91, 0.2);
}

/* ── MANUSCRIPT BODY — PROSE STYLES ───────────────────────── */

.prose-content {
    font-family: 'EB Garamond', serif;
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.9;
    color: rgba(244, 241, 234, 0.82);
    text-align: justify;
    hyphens: auto;
}

/* First paragraph drop-cap */
.prose-content > p:first-of-type::first-letter {
    float: left;
    font-family: 'EB Garamond', serif;
    font-size: 4.2em;
    line-height: 0.75;
    margin: 0.05em 0.12em 0 0;
    color: var(--color-brass);
    font-weight: 700;
}

.prose-content p {
    margin: 0 0 1.4em;
}

.prose-content h1,
.prose-content h2,
.prose-content h3,
.prose-content h4 {
    font-family: 'EB Garamond', serif;
    color: var(--color-vellum);
    font-weight: 500;
    line-height: 1.25;
    margin: 2.5em 0 0.8em;
    letter-spacing: 0.02em;
}

.prose-content h1 { font-size: 2rem;   }
.prose-content h2 { font-size: 1.55rem; border-bottom: 1px solid rgba(181,147,91,0.12); padding-bottom: 0.5rem; }
.prose-content h3 { font-size: 1.25rem; color: rgba(244, 241, 234, 0.85); }

/* Blockquote — Brass left border, indented */
.prose-content blockquote {
    border-left: 3px solid var(--color-brass);
    margin: 2em 0;
    padding: 0.75em 0 0.75em 1.5em;
    background: rgba(181, 147, 91, 0.04);
    font-style: italic;
    color: rgba(244, 241, 234, 0.65);
    position: relative;
}

.prose-content blockquote p {
    margin: 0;
}

/* Inline code — JetBrains Mono */
.prose-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82em;
    color: rgba(181, 147, 91, 0.9);
    background: rgba(181, 147, 91, 0.08);
    border: 1px solid rgba(181, 147, 91, 0.15);
    padding: 0.1em 0.4em;
    border-radius: 3px;
}

/* Code blocks */
.prose-content pre {
    background: rgba(2, 2, 2, 0.7);
    border: 1px solid rgba(181, 147, 91, 0.12);
    border-left: 3px solid rgba(181, 147, 91, 0.4);
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin: 1.75em 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(181, 147, 91, 0.2) transparent;
}

.prose-content pre code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    background: none;
    border: none;
    padding: 0;
    color: rgba(244, 241, 234, 0.8);
    line-height: 1.7;
}

/* Tables */
.prose-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.75em 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

.prose-content th {
    border-bottom: 1px solid rgba(181, 147, 91, 0.35);
    padding: 0.6rem 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--color-brass);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.7rem;
}

.prose-content td {
    border-bottom: 1px solid rgba(181, 147, 91, 0.08);
    padding: 0.6rem 1rem;
    color: rgba(244, 241, 234, 0.7);
}

.prose-content tr:hover td {
    background: rgba(181, 147, 91, 0.03);
}

/* Horizontal rule */
.prose-content hr {
    border: none;
    border-top: 1px solid rgba(181, 147, 91, 0.15);
    margin: 3em auto;
    max-width: 120px;
}

/* Lists */
.prose-content ul,
.prose-content ol {
    padding-left: 1.75em;
    margin: 0 0 1.4em;
}

.prose-content li {
    margin-bottom: 0.4em;
}

.prose-content ul li::marker {
    color: var(--color-brass);
    font-size: 0.8em;
}

.prose-content ol li::marker {
    font-family: 'JetBrains Mono', monospace;
    color: rgba(181, 147, 91, 0.7);
    font-size: 0.85em;
}

/* Links */
.prose-content a {
    color: var(--color-brass);
    text-decoration: underline;
    text-decoration-color: rgba(181, 147, 91, 0.4);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s;
}

.prose-content a:hover {
    text-decoration-color: var(--color-brass);
}

/* Strong / em */
.prose-content strong {
    color: var(--color-vellum);
    font-weight: 600;
}

.prose-content em {
    font-style: italic;
    color: rgba(244, 241, 234, 0.75);
}

/* ── MANUSCRIPT FOOTER ─────────────────────────────────────── */

.manuscript-footer {
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(181, 147, 91, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.manuscript-colophon {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    justify-content: center;
}

.manuscript-colophon-rule {
    flex: 1;
    max-width: 80px;
    height: 1px;
    background: rgba(181, 147, 91, 0.15);
}

.manuscript-colophon span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(181, 147, 91, 0.35);
}

/* ── RESPONSIVE ────────────────────────────────────────────── */

@media (max-width: 640px) {
    .chronicles-wrapper,
    .post-wrapper {
        padding: 1.5rem 1rem 4rem;
    }

    .manuscript {
        padding: 1.75rem 1.25rem;
    }

    .chronicles-title {
        font-size: 2rem;
    }

    .prose-content > p:first-of-type::first-letter {
        font-size: 3.5em;
    }
}
