/* ========================================
   Nempire Blog — Dark Post-Apocalyptic Theme
   7 Days To Die Server News & Guides
   ======================================== */

/* --- Reset --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- Base --- */
:root {
    --bg-body: #0d0d1a;
    --bg-card: #1a1a2e;
    --bg-surface: #16213e;
    --text-body: #e0e0e0;
    --text-heading: #f5f5f5;
    --accent: #e85d26;
    --accent-red: #c0392b;
    --cat-news: #e85d26;
    --cat-guide: #2ecc71;
    --tag-bg: #2a2a4a;
    --border: #2a2a4a;
    --max-width: 800px;
    --radius: 6px;
    --transition: 0.2s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
        Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-body);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: #ff7b47;
}

/* --- Header / Nav --- */
header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    font-family: "Courier New", Courier, monospace;
    font-weight: 900;
    font-size: 1.4rem;
    letter-spacing: 0.15em;
    color: var(--accent) !important;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
}

.nav-links a {
    color: var(--text-body);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: background var(--transition), color var(--transition);
}

.nav-links a:hover {
    background: var(--bg-surface);
    color: var(--text-heading);
}

.nav-links a.active {
    background: var(--accent);
    color: #fff;
}

/* --- Main --- */
main {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem;
    flex: 1;
}

/* --- Posts List --- */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* --- Post Card --- */
.post-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.post-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(232, 93, 38, 0.15);
}

/* Pinned card */
.post-card.pinned {
    border-left: 3px solid var(--accent-red);
}

.pin-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--accent-red);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius);
}

/* Post meta line */
.post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.post-category {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.cat-news { background: var(--cat-news); }
.cat-guide { background: var(--cat-guide); }

.post-meta time {
    color: #888;
}

/* Card title */
.post-card h2 {
    font-size: 1.15rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.post-card h2 a {
    color: var(--text-heading);
}

.post-card h2 a:hover {
    color: var(--accent);
}

/* Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    background: var(--tag-bg);
    color: #aaa;
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

/* --- Post Full (single post page) --- */
.post-full {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}

.post-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.post-header h1 {
    font-size: 1.6rem;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

/* --- Post Content (rendered markdown) --- */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    color: var(--text-heading);
    margin: 1.5em 0 0.5em;
    line-height: 1.3;
}

.post-content h1 { font-size: 1.5rem; }
.post-content h2 { font-size: 1.3rem; }
.post-content h3 { font-size: 1.15rem; }
.post-content h4 { font-size: 1.05rem; }

.post-content p {
    margin-bottom: 1em;
}

.post-content ul,
.post-content ol {
    margin: 0.75em 0;
    padding-left: 1.5em;
}

.post-content li {
    margin-bottom: 0.3em;
}

.post-content code {
    font-family: "Courier New", Courier, monospace;
    background: #0d0d1a;
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-size: 0.88em;
    color: #f0a070;
}

.post-content pre {
    background: #0a0a16;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    margin: 1em 0;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: var(--text-body);
    font-size: 0.85em;
}

.post-content blockquote {
    border-left: 3px solid var(--accent);
    margin: 1em 0;
    padding: 0.5em 1em;
    background: rgba(232, 93, 38, 0.05);
    color: #bbb;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.post-content th,
.post-content td {
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.post-content th {
    background: var(--bg-surface);
    color: var(--text-heading);
    font-weight: 600;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1em 0;
}

.post-content a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- Back Link --- */
.back-link {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--accent);
    font-size: 0.9rem;
}

/* --- Empty State --- */
.empty {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    padding: 4rem 1rem;
}

/* --- Footer --- */
footer {
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 1.25rem 1rem;
    color: #555;
    font-size: 0.8rem;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
    }

    .post-full {
        padding: 1.25rem;
    }

    .post-header h1 {
        font-size: 1.3rem;
    }

    .post-card {
        padding: 1rem;
    }
}
