/* =============================================================
   Age of Blight — Devblog Theme
   Ghost 6.x Compatible
   Palette: Deep Charcoal · Ember Gold · Ash · Blood Iron
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=Inter:wght@400;500&display=swap');

/* ----- Design Tokens ----- */
:root {
    /* Core palette */
    --coal-1:   #0e0c0a;   /* deepest background */
    --coal-2:   #161310;   /* card backgrounds */
    --coal-3:   #1f1b16;   /* elevated surfaces */
    --coal-4:   #2a2420;   /* borders / dividers */

    /* Ember gold */
    --gold-1:   #c8922a;   /* primary accent */
    --gold-2:   #e0a83a;   /* hover / highlight */
    --gold-3:   #f0c060;   /* bright accent */
    --gold-dim: rgba(200, 146, 42, 0.15); /* tinted bg */

    /* Ash text */
    --ash-1:    #e8e0d4;   /* primary text */
    --ash-2:    #b0a898;   /* secondary text */
    --ash-3:    #7a7268;   /* muted / meta */

    /* Blight red */
    --blight:   #8b2020;   /* danger / warning accent */
    --blight-dim: rgba(139, 32, 32, 0.18);

    /* Layout */
    --content-width: 1100px;
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 4px;

    /* Shadows */
    --shadow-card:  0 4px 24px rgba(0,0,0,0.5), 0 1px 4px rgba(0,0,0,0.4);
    --shadow-hover: 0 8px 32px rgba(0,0,0,0.65), 0 2px 8px rgba(200,146,42,0.12);

    /* Transitions */
    --ease: 0.18s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: var(--coal-1);
    color: var(--ash-1);
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 1.1rem;
    line-height: 1.7;
    min-height: 100vh;
}

/* Subtle texture overlay on body */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(200,146,42,0.04) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(139,32,32,0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--gold-1);
    text-decoration: none;
    transition: color var(--ease);
}
a:hover { color: var(--gold-2); }

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

/* ----- Layout Utilities ----- */
.outer {
    width: min(calc(100% - 48px), var(--content-width));
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ----- Site Header ----- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(14, 12, 10, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--coal-4);
}

.site-header__inner {
    width: min(calc(100% - 48px), var(--content-width));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 72px;
    padding: 0;
}

/* Brand / Logo */
.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

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

.site-brand__name {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold-1);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.2;
}

.site-brand__tagline {
    display: block;
    font-family: 'Crimson Text', serif;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--ash-3);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-style: italic;
}

/* Navigation */
.site-nav .nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav .nav a {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--ash-2);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    transition: color var(--ease), background var(--ease);
}

.site-nav .nav a:hover,
.site-nav .nav-current a {
    color: var(--gold-2);
    background: var(--gold-dim);
}

/* Subscribe button in nav */
.site-nav .nav-subscribe a {
    color: var(--gold-1);
    border: 1px solid rgba(200,146,42,0.4);
}
.site-nav .nav-subscribe a:hover {
    background: var(--gold-dim);
    border-color: var(--gold-2);
    color: var(--gold-2);
}

/* ----- Hero Section (Homepage) ----- */
.hero {
    margin: 48px 0 40px;
    padding: 52px 56px;
    background: var(--coal-2);
    border: 1px solid var(--coal-4);
    border-top: 2px solid var(--gold-1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-1), transparent);
}

.hero__eyebrow {
    margin: 0 0 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold-1);
}

.hero__title {
    margin: 0;
    font-family: 'Cinzel', serif;
    font-size: clamp(2rem, 4vw, 3.6rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--ash-1);
    letter-spacing: 0.02em;
}

.hero__description {
    margin: 18px 0 0;
    max-width: 680px;
    font-size: 1.1rem;
    color: var(--ash-2);
    font-style: italic;
}

/* ----- Post Feed (Card Grid) ----- */
.post-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding-bottom: 64px;
}

/* First post spans full width on larger screens */
.post-feed .post-card:first-child {
    grid-column: 1 / -1;
}

.post-card {
    background: var(--coal-2);
    border: 1px solid var(--coal-4);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(200,146,42,0.3);
}

/* Featured / first card image */
.post-card:first-child .post-card__image {
    aspect-ratio: 21 / 9;
}

.post-card__image-link {
    display: block;
    overflow: hidden;
}

.post-card__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: var(--coal-3);
    transition: transform 0.4s ease;
}

.post-card:hover .post-card__image {
    transform: scale(1.03);
}

.post-card__content {
    padding: 24px 26px 28px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-card__meta {
    margin: 0 0 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ash-3);
}

.post-card__meta time { color: var(--gold-1); }

.post-card__title {
    margin: 0 0 12px;
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.25;
}

.post-card__title a {
    color: var(--ash-1);
    transition: color var(--ease);
}
.post-card__title a:hover { color: var(--gold-2); }

.post-card__excerpt {
    margin: 0 0 20px;
    color: var(--ash-2);
    font-size: 0.98rem;
    line-height: 1.65;
    flex: 1;
}

.post-card__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold-1);
    transition: color var(--ease), gap var(--ease);
}
.post-card__link::after {
    content: '→';
    transition: transform var(--ease);
}
.post-card:hover .post-card__link {
    color: var(--gold-2);
}
.post-card:hover .post-card__link::after {
    transform: translateX(3px);
}

/* ----- Article / Post Page ----- */
.article-wrapper {
    padding: 40px 0 80px;
}

.article {
    max-width: 820px;
    margin: 0 auto;
}

.article__header {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--coal-4);
}

.article__eyebrow {
    margin: 0 0 14px;
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold-1);
}

.article__title {
    margin: 0 0 16px;
    font-family: 'Cinzel', serif;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--ash-1);
    letter-spacing: 0.01em;
}

.article__meta {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    color: var(--ash-3);
    letter-spacing: 0.06em;
}

.article__meta time { color: var(--gold-1); }

.article__feature-image {
    width: 100%;
    border-radius: var(--radius-lg);
    margin: 0 0 40px;
    border: 1px solid var(--coal-4);
    box-shadow: var(--shadow-card);
}

/* Article body content */
.gh-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--ash-1);
}

.gh-content > * + * { margin-top: 1.5em; }
.gh-content > *:first-child { margin-top: 0; }

.gh-content h2, .gh-content h3, .gh-content h4 {
    font-family: 'Cinzel', serif;
    color: var(--ash-1);
    margin-top: 2.2em;
    margin-bottom: 0.6em;
    line-height: 1.2;
}

.gh-content h2 {
    font-size: 1.7rem;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--coal-4);
    color: var(--gold-1);
}

.gh-content h3 { font-size: 1.3rem; color: var(--ash-1); }
.gh-content h4 { font-size: 1.1rem; color: var(--ash-2); }

.gh-content p { margin: 0; }

.gh-content a {
    color: var(--gold-1);
    border-bottom: 1px solid rgba(200,146,42,0.3);
    transition: color var(--ease), border-color var(--ease);
}
.gh-content a:hover {
    color: var(--gold-2);
    border-color: var(--gold-2);
}

.gh-content strong { color: var(--ash-1); font-weight: 600; }
.gh-content em { color: var(--ash-2); }

.gh-content blockquote {
    margin: 2em 0;
    padding: 20px 24px;
    background: var(--coal-2);
    border-left: 3px solid var(--gold-1);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--ash-2);
    font-style: italic;
    font-size: 1.05rem;
}

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

.gh-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--coal-4), transparent);
    margin: 3em 0;
}

.gh-content ul, .gh-content ol {
    padding-left: 1.6em;
}

.gh-content li + li { margin-top: 0.4em; }

.gh-content img {
    border-radius: var(--radius-md);
    border: 1px solid var(--coal-4);
    box-shadow: var(--shadow-card);
}

.gh-content pre {
    background: var(--coal-2);
    border: 1px solid var(--coal-4);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    overflow-x: auto;
    font-size: 0.88rem;
    line-height: 1.6;
}

.gh-content code {
    font-size: 0.88em;
    background: var(--coal-3);
    border: 1px solid var(--coal-4);
    border-radius: 3px;
    padding: 2px 6px;
    color: var(--gold-3);
}

.gh-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--ash-1);
}

/* Wide / Full width images */
.kg-width-wide {
    max-width: 1060px;
    width: 100%;
    margin-left: 50%;
    transform: translateX(-50%);
}

.kg-width-full {
    width: 100vw;
    max-width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
}

/* Gallery card */
.kg-gallery-container {
    display: grid;
    gap: 8px;
}
.kg-gallery-row {
    display: flex;
    gap: 8px;
}
.kg-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

/* Bookmark card */
.kg-bookmark-card {
    background: var(--coal-2);
    border: 1px solid var(--coal-4);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.kg-bookmark-container {
    display: flex;
    text-decoration: none;
    color: var(--ash-1);
}
.kg-bookmark-content {
    padding: 16px 20px;
    flex: 1;
}
.kg-bookmark-title {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--ash-1);
    margin-bottom: 6px;
}
.kg-bookmark-description {
    font-size: 0.9rem;
    color: var(--ash-2);
}
.kg-bookmark-thumbnail img {
    width: 160px;
    height: 100%;
    object-fit: cover;
}

/* ----- Pagination ----- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 40px 0 64px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--coal-2);
    border: 1px solid var(--coal-4);
    border-radius: var(--radius-md);
    color: var(--ash-2);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: all var(--ease);
}
.pagination a:hover {
    border-color: var(--gold-1);
    color: var(--gold-1);
    background: var(--gold-dim);
}

.pagination .page-number {
    color: var(--ash-3);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}

/* ----- Site Footer ----- */
.site-footer {
    border-top: 1px solid var(--coal-4);
    background: var(--coal-2);
    position: relative;
    z-index: 1;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

.site-footer__inner {
    width: min(calc(100% - 48px), var(--content-width));
    margin: 0 auto;
    padding: 28px 0 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.site-footer__copy {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: var(--ash-3);
    letter-spacing: 0.06em;
}

.site-footer__copy a {
    color: var(--gold-1);
}

.site-footer__copy a:hover {
    color: var(--gold-2);
}

/* ----- Subscribe / Portal ----- */
.gh-portal-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: var(--gold-dim);
    border: 1px solid rgba(200,146,42,0.4);
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold-1);
    cursor: pointer;
    transition: all var(--ease);
}
.gh-portal-trigger:hover {
    background: rgba(200,146,42,0.25);
    border-color: var(--gold-2);
    color: var(--gold-2);
}

/* ----- Tag / Author Pages ----- */
.page-header {
    padding: 48px 0 32px;
    border-bottom: 1px solid var(--coal-4);
    margin-bottom: 40px;
}

.page-header__eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold-1);
    margin: 0 0 10px;
}

.page-header__title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-weight: 700;
    color: var(--ash-1);
    margin: 0;
}

.page-header__description {
    margin: 14px 0 0;
    color: var(--ash-2);
    font-style: italic;
    max-width: 600px;
}

/* ----- 404 / Error ----- */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 60px 24px;
}

.error-page__code {
    font-family: 'Cinzel', serif;
    font-size: 6rem;
    font-weight: 700;
    color: var(--coal-4);
    line-height: 1;
    margin: 0 0 16px;
}

.error-page__title {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    color: var(--ash-2);
    margin: 0 0 12px;
}

.error-page__description {
    color: var(--ash-3);
    margin: 0 0 32px;
    max-width: 480px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--gold-dim);
    border: 1px solid rgba(200,146,42,0.4);
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold-1);
    transition: all var(--ease);
}
.btn:hover {
    background: rgba(200,146,42,0.25);
    border-color: var(--gold-2);
    color: var(--gold-2);
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
    .site-header__inner {
        min-height: auto;
        padding: 14px 0;
        flex-wrap: wrap;
        gap: 12px;
    }

    .hero {
        padding: 32px 28px;
        margin: 28px 0 28px;
    }

    .post-feed {
        grid-template-columns: 1fr;
    }

    .post-feed .post-card:first-child {
        grid-column: 1;
    }

    .article__title {
        font-size: 1.8rem;
    }

    .site-footer__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .kg-width-wide,
    .kg-width-full {
        width: 100%;
        margin-left: 0;
        transform: none;
    }
}

@media (max-width: 480px) {
    .outer {
        width: calc(100% - 32px);
    }

    .hero {
        padding: 24px 20px;
    }

    .post-card__content {
        padding: 18px 20px 22px;
    }

    .article {
        padding: 0;
    }
}
