/* =========================================================================
   Matzieblog — Ghost theme
   Dark, simple, clean. Built for reading.
   ========================================================================= */

:root {
    /* Surfaces */
    --bg: #030712;
    --bg-soft: #0b1220;
    --bg-elevated: #111827;
    --border: #1f2937;
    --border-strong: #374151;

    /* Text */
    --text: #f9fafb;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;

    /* Single subtle accent (from the matzieblog logo) */
    --accent: #2196f3;

    --radius: 14px;
    --radius-sm: 10px;
    --maxwidth: 1040px;
    --maxwidth-narrow: 680px;

    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--gh-font-body, var(--font));
    font-size: 18px;
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text);
    font-family: var(--gh-font-heading, var(--font));
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 0.5em;
}

p { margin: 0 0 1.4em; }

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

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

/* gradient-text kept as a no-op so templates stay simple — plain white now */
.gradient-text { color: var(--text); }

/* --------------------------------------------------------------- Layout */
.site-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.site-main { flex: 1 0 auto; }

.inner {
    width: 100%;
    max-width: var(--maxwidth);
    margin: 0 auto;
    padding: 0 24px;
}
.inner--narrow { max-width: var(--maxwidth-narrow); }

.dot { color: var(--text-dim); margin: 0 0.55em; }

/* ============================================================= Site header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 68px;
}
.site-brand { display: inline-flex; align-items: center; }
.site-logo {
    height: 24px;
    width: auto;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-menu li { margin: 0; }
.nav-menu a {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}
.nav-menu a:hover { color: var(--text); }
.nav-current a { color: var(--text); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 6px;
}
.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

/* ============================================================== Page hero */
.page-hero {
    text-align: center;
    padding: 72px 0 8px;
}
.page-hero-eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 14px;
}
.page-hero-title {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 800;
    margin: 0;
}
.page-hero-desc {
    max-width: 560px;
    margin: 16px auto 0;
    color: var(--text-muted);
    font-size: 1.08rem;
}
.page-hero-count {
    margin-top: 12px;
    color: var(--text-dim);
    font-size: 0.9rem;
}
.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 18px;
    object-fit: cover;
    border: 1px solid var(--border-strong);
}

/* ============================================================== Post feed */
.post-feed-wrap { padding: 48px 0 96px; }

.post-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* simple, clean card */
.post-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-soft);
    transition: border-color 0.18s ease, transform 0.18s ease;
}
.post-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-3px);
}
.post-card-link { display: flex; flex-direction: column; height: 100%; color: inherit; }
.post-card-link:hover { color: inherit; }

.post-card-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-elevated);
}
.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 22px;
}
.post-card-tag {
    align-self: flex-start;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 12px;
}
.post-card-title {
    font-size: 1.25rem;
    margin: 0 0 10px;
}
.post-card-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 18px;
}
.post-card-meta {
    margin-top: auto;
    color: var(--text-dim);
    font-size: 0.84rem;
}

/* ============================================================ Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 56px;
}
.pagination-btn {
    padding: 9px 18px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text);
}
.pagination-btn:hover { border-color: var(--accent); color: var(--text); }
.pagination-btn.is-disabled { opacity: 0.35; pointer-events: none; }
.pagination-pages { color: var(--text-dim); font-size: 0.88rem; }

/* ================================================================== Post */
.post-header {
    text-align: center;
    padding: 64px 0 8px;
}
.post-tag {
    display: inline-block;
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 18px;
}
.post-title {
    font-size: clamp(2rem, 4.5vw, 3rem);
    font-weight: 800;
    margin: 0 auto;
    max-width: 18ch;
}
.post-lead {
    color: var(--text-muted);
    font-size: 1.15rem;
    max-width: 44ch;
    margin: 20px auto 0;
}
.post-meta {
    margin-top: 22px;
    color: var(--text-dim);
    font-size: 0.9rem;
}
.post-author { color: var(--text-muted); font-weight: 500; }

.post-feature-image {
    margin: 40px auto 0;
    max-width: var(--maxwidth);
    padding: 0 24px;
}
.post-feature-image img {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.post-feature-image figcaption {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 10px;
}

.post-content { padding: 44px 0 24px; }

/* -------------------------------------------------- Long-form typography */
.gh-content { font-size: 1.1rem; }
.gh-content > * { margin-bottom: 1.5em; }
.gh-content h2 { font-size: 1.7rem; margin-top: 1.8em; }
.gh-content h3 { font-size: 1.35rem; margin-top: 1.5em; }
.gh-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(33, 150, 243, 0.4);
    text-underline-offset: 3px;
}
.gh-content a:hover { text-decoration-color: var(--accent); }
.gh-content strong { color: var(--text); }
.gh-content ul, .gh-content ol { padding-left: 1.4em; }
.gh-content li { margin-bottom: 0.5em; }
.gh-content blockquote {
    margin: 1.6em 0;
    padding: 4px 0 4px 22px;
    border-left: 3px solid var(--border-strong);
    color: var(--text-muted);
    font-style: italic;
}
.gh-content img,
.gh-content video { border-radius: var(--radius-sm); }
.gh-content figure { margin: 1.8em 0; }
.gh-content figcaption {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 10px;
}
.gh-content hr {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: 2.4em 0;
}
.gh-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.88em;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 6px;
}
.gh-content pre {
    background: #0a0f1d;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    overflow-x: auto;
    font-size: 0.9rem;
}
.gh-content pre code { background: none; border: 0; padding: 0; }

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

/* ------------------------------------------------------------- Post footer */
.post-footer { padding: 8px 0 48px; }
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border-top: 1px solid var(--border);
    padding-top: 28px;
}
.post-tags .post-tag {
    margin: 0;
    padding: 6px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--text-muted);
}
.post-tags .post-tag:hover { color: var(--text); border-color: var(--accent); }

.post-comments { padding: 20px 0 80px; }

/* =============================================================== Error page */
.error-page { text-align: center; padding: 120px 0; }
.error-code { font-size: clamp(4rem, 14vw, 8rem); font-weight: 800; margin: 0; }
.error-message { color: var(--text-muted); font-size: 1.25rem; margin-bottom: 32px; }
.btn {
    display: inline-block;
    padding: 11px 24px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-weight: 500;
}
.btn:hover { border-color: var(--accent); color: var(--text); }

/* =================================================================== Footer */
.site-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    padding: 40px 0;
}
.site-footer .inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}
.footer-brand { display: flex; flex-direction: column; gap: 6px; }
.footer-brand > a { font-weight: 700; font-size: 1.05rem; }
.footer-tagline { color: var(--text-dim); font-size: 0.9rem; }
.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}
.footer-nav a { color: var(--text-muted); font-size: 0.9rem; }
.footer-nav a:hover { color: var(--text); }
.footer-nav .nav-menu { gap: 20px; }
.footer-copy { color: var(--text-dim); font-size: 0.85rem; margin: 0; }

/* ============================================================== Responsive */
@media (max-width: 700px) {
    body { font-size: 17px; }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: var(--bg-soft);
        border-bottom: 1px solid var(--border);
        padding: 8px 24px 16px;
    }
    .site-header.nav-open .nav-menu { display: flex; }
    .nav-menu li { width: 100%; }
    .nav-menu a { display: block; padding: 12px 0; }

    .nav-toggle { display: flex; }

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

    .pagination { flex-direction: column-reverse; }
}
