/* ============================
   Cybervalhalla Blog — Styles
   ============================ */

:root {
    --bg: #0f0f11;
    --bg-card: #1a1a1e;
    --bg-hover: #242429;
    --text: #e4e4e7;
    --text-dim: #888899;
    --text-muted: #5c5c6e;
    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --accent-green: #00cec9;
    --border: #2a2a30;
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
    --max-width: 720px;
}

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

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

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

a:hover {
    color: var(--accent);
}

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

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    overflow-x: hidden;
}

/* --- Header --- */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 48px;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

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

.site-nav {
    display: flex;
    gap: 24px;
}

.site-nav a {
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 500;
}

.site-nav a:hover {
    color: var(--text);
}

/* --- Hero --- */
.hero {
    text-align: center;
    padding: 40px 0 48px;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--accent), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.subtitle {
    color: var(--text-dim);
    font-size: 1.05rem;
    max-width: 500px;
    margin: 0 auto 16px;
}

.channel-link {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- Post Images --- */
.post-thumb-link {
    display: block;
    margin: -24px -24px 16px -24px;
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
    line-height: 0;
}

.post-thumb {
    width: 100%;
    height: auto;
    max-height: 340px;
    object-fit: cover;
    transition: transform 0.2s;
}

.post-preview:hover .post-thumb {
    transform: scale(1.02);
}

.post-image {
    margin: 0 0 24px 0;
    border-radius: var(--radius);
    overflow: hidden;
    line-height: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.post-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    display: block;
}

/* --- Posts List --- */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-preview {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color 0.2s, background 0.2s;
}

.post-preview:hover {
    border-color: rgba(108, 92, 231, 0.3);
    background: var(--bg-hover);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.post-meta time {
    color: var(--text-dim);
}

.post-id {
    font-family: var(--mono);
    font-size: 0.78rem;
    background: var(--border);
    padding: 2px 8px;
    border-radius: 4px;
}

.post-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
}

.post-text p {
    margin-bottom: 8px;
}

.post-text p:last-child {
    margin-bottom: 0;
}

.post-text a {
    color: var(--accent-light);
    word-break: break-word;
}

.post-text a:hover {
    text-decoration: underline;
}

.post-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.views, .forwards {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.reactions-list {
    display: flex;
    gap: 6px;
}

.reaction {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.read-more {
    margin-left: auto;
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 40px 0;
}

.pagination a.page,
.pagination span.page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
}

.pagination a.page {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-dim);
}

.pagination a.page:hover {
    border-color: var(--accent);
    color: var(--text);
}

.pagination span.current {
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
}

/* --- Full Post --- */
.post-full {
    padding-bottom: 48px;
}

.post-header {
    margin-bottom: 32px;
}

.post-header .post-meta {
    font-size: 0.9rem;
    margin-bottom: 0;
}

.post-content {
    font-size: 1rem;
    line-height: 1.8;
}

.post-content p {
    margin-bottom: 16px;
}

.post-content a {
    color: var(--accent-light);
    word-break: break-word;
}

.post-content a:hover {
    text-decoration: underline;
}

.post-links {
    margin-top: 32px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.post-links h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-dim);
}

.post-links ul {
    list-style: none;
}

.post-links li {
    padding: 4px 0;
}

.post-links li::before {
    content: "🔗 ";
}

.post-reactions {
    display: flex;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.post-reactions .reaction {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.post-source {
    margin-top: 24px;
}

.source-link {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    transition: opacity 0.15s;
}

.source-link:hover {
    opacity: 0.9;
    color: #fff;
}

/* --- Post Navigation --- */
.post-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}

.post-navigation a {
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-home {
    color: var(--text-muted) !important;
}

.nav-home:hover {
    color: var(--text) !important;
}

/* --- Footer --- */
.site-footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid var(--border);
    margin-top: 48px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-note {
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .site-header {
        flex-direction: column;
        gap: 12px;
        padding: 16px 0;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .post-preview {
        padding: 16px;
    }

    .post-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .read-more {
        margin-left: 0;
    }

    .post-navigation {
        flex-direction: column;
        align-items: flex-start;
    }
}
