/* ==========================================================================
   Conspiracy Chronicle — They Tell Us Lies
   Dark investigative journalism theme
   ========================================================================== */

:root {
    --color-bg: #0a0a0f;
    --color-surface: #141420;
    --color-surface-hover: #1e1e30;
    --color-border: #2a2a3d;
    --color-accent: #dc2626;
    --color-accent-light: #ef4444;
    --color-accent-secondary: #a855f7;
    --color-text: #e2e8f0;
    --color-text-secondary: #94a3b8;
    --color-text-muted: #64748b;
    --color-white: #ffffff;
    --color-classified: #dc2626;
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
    --font-mono: "JetBrains Mono", "Fira Code", monospace;
    --transition: 0.3s ease;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-accent: 0 0 20px rgba(220, 38, 38, 0.15);
}

html:not(.dark-mode):not(.auto-color) {
    --color-bg: #f1f0ed;
    --color-surface: #ffffff;
    --color-surface-hover: #f5f4f1;
    --color-border: #ddd8d0;
    --color-text: #1a1a2e;
    --color-text-secondary: #4a4a5a;
    --color-text-muted: #8a8a9a;
}

@media (prefers-color-scheme: light) {
    .auto-color {
        --color-bg: #f1f0ed;
        --color-surface: #ffffff;
        --color-surface-hover: #f5f4f1;
        --color-border: #ddd8d0;
        --color-text: #1a1a2e;
        --color-text-secondary: #4a4a5a;
        --color-text-muted: #8a8a9a;
    }
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html {
    font-size: 62.5%;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    font-size: 1.6rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(168, 85, 247, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(220, 38, 38, 0.03) 0%, transparent 50%);
}

a { color: var(--color-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent-light); }

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

/* ==========================================================================
   Layout
   ========================================================================== */

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

.gh-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2.4rem;
}

.gh-canvas {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 2.4rem;
}

.gh-main {
    flex: 1;
    padding: 4rem 0 8rem;
}

/* ==========================================================================
   Header
   ========================================================================== */

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

.gh-head-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.2rem 2.4rem;
    gap: 2rem;
}

.gh-head-brand {
    display: flex;
    align-items: center;
}

.gh-head-logo {
    font-family: var(--font-serif);
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -0.02em;
    text-decoration: none;
}

.gh-head-logo:hover { color: var(--color-accent); }

.gh-head-logo img {
    max-height: 40px;
    width: auto;
}

.gh-head-menu {
    display: flex;
    gap: 2.4rem;
}

.gh-head-menu a {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: color var(--transition);
}

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

.gh-head-actions { display: flex; gap: 1.2rem; }

.gh-icon-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0.4rem;
    transition: color var(--transition);
}

.gh-icon-btn:hover { color: var(--color-accent); }

.gh-burger {
    display: none;
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    position: relative;
    cursor: pointer;
}

.gh-burger::before, .gh-burger::after {
    content: '';
    position: absolute;
    left: 4px;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: transform var(--transition);
}

.gh-burger::before { top: 10px; }
.gh-burger::after { bottom: 10px; }

/* ==========================================================================
   Cover / Hero Banner
   ========================================================================== */

.gh-cover {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.gh-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(10, 10, 15, 0.6) 0%,
        rgba(10, 10, 15, 0.8) 50%,
        rgba(10, 10, 15, 1) 100%
    );
}

.gh-cover-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 6rem 2.4rem;
}

.gh-cover-content .site-logo {
    max-height: 80px;
    margin: 0 auto 2rem;
}

.site-description {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    color: var(--color-accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ==========================================================================
   Magazine Hero (First Post)
   ========================================================================== */

.gh-magazine-hero {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 3.2rem;
    min-height: 400px;
    display: flex;
    align-items: flex-end;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}

.gh-magazine-hero-image {
    position: absolute;
    inset: 0;
}

.gh-magazine-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.gh-magazine-hero:hover .gh-magazine-hero-image img {
    transform: scale(1.03);
}

.gh-magazine-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        0deg,
        rgba(10, 10, 15, 0.95) 0%,
        rgba(10, 10, 15, 0.4) 50%,
        transparent 100%
    );
}

.gh-magazine-hero-content {
    position: relative;
    z-index: 1;
    padding: 4rem;
    width: 100%;
}

.gh-magazine-hero-title {
    font-family: var(--font-serif);
    font-size: 3.6rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.2rem;
}

.gh-magazine-hero-title a { color: var(--color-white); }
.gh-magazine-hero-title a:hover { color: var(--color-accent); }

.gh-magazine-hero-excerpt {
    font-size: 1.7rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-bottom: 1.2rem;
    max-width: 600px;
}

/* ==========================================================================
   Post Cards
   ========================================================================== */

.gh-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.gh-card:hover {
    transform: translateY(-3px);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-accent);
}

.gh-card-image {
    display: block;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.gh-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.gh-card-wrapper {
    padding: 2rem;
}

.gh-card-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.gh-card-tag {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent-secondary);
}

.gh-card-tag:hover { color: var(--color-accent); }

.gh-card-featured {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-classified);
    border: 1px solid var(--color-classified);
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
}

.gh-card-title {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.8rem;
}

.gh-card-title a { color: var(--color-text); }
.gh-card-title a:hover { color: var(--color-accent); }

.gh-card-excerpt {
    font-size: 1.4rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-bottom: 1.2rem;
}

.gh-card-footer {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.gh-card-dot { opacity: 0.4; }

/* Card Layouts */
.gh-magazine-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.4rem;
    margin-bottom: 2.4rem;
}

.gh-feed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.4rem;
    margin-bottom: 2.4rem;
}

/* ==========================================================================
   Article
   ========================================================================== */

.gh-article-header {
    padding-top: 6rem;
    padding-bottom: 3.2rem;
    text-align: center;
}

.gh-article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.6rem;
}

.gh-article-tag {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent-secondary);
}

.gh-article-featured {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-classified);
    border: 1px solid var(--color-classified);
    padding: 0.2rem 0.8rem;
    border-radius: 3px;
}

.gh-article-title {
    font-family: var(--font-serif);
    font-size: 4.8rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 1.6rem;
}

.gh-article-excerpt {
    font-size: 2rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    max-width: 640px;
    margin: 0 auto 2.4rem;
}

.gh-article-byline {
    display: flex;
    justify-content: center;
}

.gh-article-byline-content {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    font-size: 1.4rem;
    color: var(--color-text-muted);
}

.gh-article-author-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--color-border);
}

.gh-article-author-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gh-article-author-image svg {
    width: 100%;
    height: 100%;
    padding: 6px;
    color: var(--color-text-muted);
}

.gh-article-author { font-weight: 600; color: var(--color-text); }

.gh-article-image {
    margin-bottom: 4rem;
}

.gh-article-image img {
    width: 100%;
    border-radius: 8px;
}

.gh-article-image-full img { border-radius: 0; }

.gh-article-image figcaption {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 1.2rem;
}

/* ==========================================================================
   Content (Article Body)
   ========================================================================== */

.gh-content {
    font-size: 1.8rem;
    line-height: 1.75;
    overflow-wrap: break-word;
}

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

.gh-content h2 {
    font-family: var(--font-serif);
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 4.8rem;
}

.gh-content h3 {
    font-family: var(--font-serif);
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 4rem;
}

.gh-content h4 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 3.2rem;
}

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

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

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

.gh-content blockquote {
    border-left: 3px solid var(--color-accent);
    padding: 0.4rem 0 0.4rem 2.4rem;
    font-style: italic;
    font-size: 2rem;
    color: var(--color-text-secondary);
}

.gh-content pre {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 2rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 1.4rem;
    line-height: 1.6;
}

.gh-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--color-surface);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--color-border);
}

.gh-content pre code {
    background: none;
    padding: 0;
    border: none;
    border-radius: 0;
}

.gh-content ul, .gh-content ol {
    padding-left: 2.4rem;
}

.gh-content li + li { margin-top: 0.8rem; }

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

.gh-content figcaption {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 1.2rem;
}

/* Koenig width classes */
.gh-content .kg-width-wide {
    max-width: 1040px;
    margin-left: calc(50% - 520px);
    margin-right: calc(50% - 520px);
}

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

.gh-content .kg-width-wide img,
.gh-content .kg-width-full img {
    width: 100%;
}

/* ==========================================================================
   Read More / Related Posts
   ========================================================================== */

.gh-read-more {
    padding-top: 6rem;
    margin-top: 6rem;
    border-top: 1px solid var(--color-border);
}

.gh-read-more-title {
    font-family: var(--font-serif);
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 3.2rem;
    color: var(--color-accent);
}

.gh-read-more-feed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.4rem;
}

/* ==========================================================================
   Archive (Tag/Author)
   ========================================================================== */

.gh-archive-header {
    text-align: center;
    padding: 6rem 0 4rem;
}

.gh-archive-title {
    font-family: var(--font-serif);
    font-size: 4rem;
    font-weight: 800;
}

.gh-archive-description {
    font-size: 1.8rem;
    color: var(--color-text-secondary);
    margin-top: 1.2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.gh-archive-author-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1.6rem;
    border: 3px solid var(--color-border);
}

/* ==========================================================================
   Error Pages
   ========================================================================== */

.gh-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.gh-error-content { text-align: center; }

.gh-error-code {
    font-family: var(--font-mono);
    font-size: 12rem;
    font-weight: 900;
    color: var(--color-accent);
    line-height: 1;
    opacity: 0.5;
}

.gh-error-message {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    font-weight: 700;
    margin-top: 1.6rem;
}

.gh-error-description {
    font-size: 1.6rem;
    color: var(--color-text-muted);
    margin-top: 1.2rem;
}

.gh-error-link {
    display: inline-block;
    margin-top: 2.4rem;
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
    padding: 1rem 2.4rem;
    border-radius: 4px;
    transition: all var(--transition);
}

.gh-error-link:hover {
    background: var(--color-accent);
    color: var(--color-white);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.gh-foot {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 4rem 0;
    text-align: center;
}

.gh-foot-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2.4rem;
}

.gh-foot-motto {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-accent);
    margin-bottom: 2rem;
}

.gh-foot-menu {
    display: flex;
    justify-content: center;
    gap: 2.4rem;
    margin-bottom: 1.6rem;
}

.gh-foot-menu a {
    font-size: 1.4rem;
    color: var(--color-text-secondary);
}

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

.gh-copyright {
    font-size: 1.3rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 4rem 0 0;
    font-family: var(--font-mono);
    font-size: 1.3rem;
}

.pagination a {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
    padding: 0.8rem 2rem;
    border-radius: 4px;
    transition: all var(--transition);
}

.pagination a:hover {
    background: var(--color-accent);
    color: var(--color-white);
}

.page-number { color: var(--color-text-muted); }

/* ==========================================================================
   Comments
   ========================================================================== */

.gh-comments {
    margin-top: 6rem;
    padding-top: 4rem;
    border-top: 1px solid var(--color-border);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .gh-feed { grid-template-columns: repeat(2, 1fr); }
    .gh-read-more-feed { grid-template-columns: repeat(2, 1fr); }
    .gh-article-title { font-size: 3.6rem; }
}

@media (max-width: 768px) {
    .gh-head-menu { display: none; }
    .gh-burger { display: block; }

    .gh-head-open .gh-head-menu {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        padding: 2rem 2.4rem;
        gap: 1.6rem;
    }

    .gh-head-open .gh-burger::before {
        transform: translateY(5px) rotate(45deg);
    }
    .gh-head-open .gh-burger::after {
        transform: translateY(-5px) rotate(-45deg);
    }

    .gh-magazine-duo { grid-template-columns: 1fr; }
    .gh-feed { grid-template-columns: 1fr; }
    .gh-read-more-feed { grid-template-columns: 1fr; }

    .gh-magazine-hero { min-height: 300px; }
    .gh-magazine-hero-title { font-size: 2.4rem; }
    .gh-magazine-hero-content { padding: 2.4rem; }

    .gh-article-header { padding-top: 3.2rem; }
    .gh-article-title { font-size: 2.8rem; }
    .gh-article-excerpt { font-size: 1.6rem; }

    .gh-cover { min-height: 40vh; }

    .gh-content .kg-width-wide {
        margin-left: -2.4rem;
        margin-right: -2.4rem;
    }
}

@media (max-width: 480px) {
    .gh-card-title { font-size: 1.8rem; }
    .gh-article-title { font-size: 2.4rem; }
    .gh-error-code { font-size: 8rem; }
}
