/* ========================================
   PlayNexus Blog — Dark Theme
   ======================================== */

:root {
    --bg-primary: #06060d;
    --bg-secondary: #0c0c18;
    --bg-card: rgba(15, 15, 30, 0.6);
    --bg-card-hover: rgba(20, 20, 40, 0.8);
    --text-primary: #f0f0ff;
    --text-secondary: #8888aa;
    --text-muted: #5a5a7a;
    --blue: #00b4ff;
    --violet: #8b5cf6;
    --cyan: #00e5ff;
    --green: #22c55e;
    --yellow: #eab308;
    --red: #ef4444;
    --gradient-primary: linear-gradient(135deg, var(--blue), var(--violet));
    --font-heading: 'Sora', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --font-mono: 'Fira Code', 'Consolas', monospace;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 5px;
    --radius-lg: 16px;
    --topbar-height: 64px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   Topbar
   ======================================== */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--topbar-height);
    background: transparent;
    transition: all 0.3s;
}
.topbar.scrolled {
    background: rgba(6, 6, 13, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 180, 255, 0.08);
}
.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
}
.topbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.topbar-logo-img { height: 36px; width: auto; }
.topbar-label {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cyan);
    background: rgba(0, 229, 255, 0.08);
    padding: 3px 10px;
    border-radius: 100px;
    border: 1px solid rgba(0, 229, 255, 0.15);
}
.topbar-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
}
.topbar-link {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s;
}
.topbar-link:hover { color: var(--text-primary); }
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}
.topbar-link-muted {
    font-size: 0.82rem;
    color: var(--text-muted);
    transition: color 0.2s;
}
.topbar-link-muted:hover { color: var(--text-secondary); }
.topbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
}

/* ========================================
   Blog Main
   ======================================== */
.blog-main {
    padding-top: calc(var(--topbar-height) + 32px);
    min-height: calc(100vh - 200px);
    padding-bottom: 64px;
}

/* ========================================
   Tags
   ======================================== */
.blog-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tag-color, var(--blue));
    background: color-mix(in srgb, var(--tag-color, var(--blue)) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--tag-color, var(--blue)) 25%, transparent);
}
.blog-tag-sm { font-size: 0.68rem; padding: 3px 10px; }

/* ========================================
   Hero / Featured
   ======================================== */
.blog-hero {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 56px;
}
.blog-hero-card {
    position: relative;
    display: block;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 420px;
    transition: transform 0.3s;
}
.blog-hero-card:hover { transform: translateY(-4px); }
.blog-hero-cover {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s;
}
.blog-hero-card:hover .blog-hero-cover { transform: scale(1.03); }
.blog-hero-cover-gradient {
    background: var(--gradient-primary);
    opacity: 0.3;
}
.blog-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(6,6,13,0.95) 0%, rgba(6,6,13,0.4) 50%, rgba(6,6,13,0.1) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 36px;
}
.blog-hero-overlay h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    margin: 12px 0 8px;
    line-height: 1.25;
}
.blog-hero-overlay p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 500px;
}
.blog-hero-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.blog-hero-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.blog-hero-side-card {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    flex: 1;
}
.blog-hero-side-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255,255,255,0.1);
}
.blog-hero-side-cover {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-xs);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}
.blog-hero-side-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.blog-hero-side-content h3 {
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-hero-side-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========================================
   Section Title
   ======================================== */
.blog-section-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* ========================================
   Post Grid
   ======================================== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.blog-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.25s;
}
.blog-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255,255,255,0.1);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.blog-card-cover {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-secondary);
}
.blog-card-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-muted);
    opacity: 0.3;
}
.blog-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.blog-card-body h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card:hover h3 { color: var(--cyan); }
.blog-card-body p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========================================
   Pagination
   ======================================== */
.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.blog-pagination-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 0 20px rgba(0,180,255,0.2);
}
.btn-primary:hover { box-shadow: 0 0 30px rgba(0,180,255,0.3); transform: translateY(-1px); }
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.08);
}
.btn-ghost:hover {
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.15);
}

/* ========================================
   Empty State
   ======================================== */
.blog-empty {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
}
.blog-empty i { font-size: 2.5rem; opacity: 0.3; margin-bottom: 16px; display: block; }
.blog-empty h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.blog-empty p { font-size: 0.92rem; }

/* ========================================
   Category Header
   ======================================== */
.blog-category-header {
    margin-bottom: 40px;
}
.blog-category-header h1 { margin: 12px 0 8px; }
.blog-category-header p {
    font-size: 0.92rem;
    color: var(--text-muted);
}
.blog-back {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color 0.2s;
    display: inline-block;
    margin-bottom: 12px;
}
.blog-back:hover { color: var(--cyan); }

/* ========================================
   Article Page
   ======================================== */
.blog-article {
    padding-bottom: 48px;
}
.blog-article-header {
    max-width: 720px;
    margin: 0 auto 32px;
}
.blog-article-header h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 12px 0 16px;
}
.blog-article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.blog-article-author { color: var(--text-secondary); font-weight: 500; }
.blog-article-cover {
    max-width: 900px;
    margin: 0 auto 40px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.blog-article-cover img {
    width: 100%;
    height: auto;
    display: block;
}

/* Article Content */
.blog-article-content {
    max-width: 720px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
}
.blog-article-content h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 2.5rem 0 1rem;
}
.blog-article-content h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2rem 0 0.75rem;
}
.blog-article-content p { margin-bottom: 1.25rem; }
.blog-article-content a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.blog-article-content a:hover { color: var(--blue); }
.blog-article-content strong { color: var(--text-primary); }
.blog-article-content ul, .blog-article-content ol {
    margin: 0.75rem 0 1.25rem 1.5rem;
}
.blog-article-content li { margin-bottom: 0.5rem; }
.blog-article-content blockquote {
    border-left: 3px solid var(--blue);
    padding: 16px 20px;
    margin: 1.5rem 0;
    background: rgba(0, 180, 255, 0.04);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
    font-style: italic;
}
.blog-article-content code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: rgba(0, 229, 255, 0.06);
    color: var(--cyan);
    padding: 2px 7px;
    border-radius: 4px;
}
.blog-article-content pre {
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin: 1.5rem 0;
    overflow-x: auto;
}
.blog-article-content pre code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.blog-article-content img {
    border-radius: var(--radius-sm);
    margin: 1.5rem 0;
}
.blog-article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}
.blog-article-content th, .blog-article-content td {
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.06);
    text-align: left;
    font-size: 0.9rem;
}
.blog-article-content th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

/* Article Footer */
.blog-article-footer {
    max-width: 720px;
    margin: 48px auto 0;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.blog-share {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.blog-share a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: all 0.2s;
}
.blog-share a:hover {
    background: rgba(0, 229, 255, 0.08);
    border-color: rgba(0, 229, 255, 0.2);
    color: var(--cyan);
}

/* Related Posts */
.blog-related {
    padding: 48px 0;
    border-top: 1px solid rgba(255,255,255,0.04);
}

/* ========================================
   Footer
   ======================================== */
.blog-footer {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 48px 0 32px;
}
.blog-footer-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 32px;
}
.blog-footer-brand p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 12px;
    max-width: 280px;
}
.blog-footer-links {
    display: flex;
    gap: 24px;
}
.blog-footer-links a {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color 0.2s;
}
.blog-footer-links a:hover { color: var(--cyan); }
.blog-footer-bottom {
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.04);
}
.blog-footer-bottom p {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 900px) {
    .blog-hero { grid-template-columns: 1fr; }
    .blog-hero-card { min-height: 320px; }
    .blog-hero-side { flex-direction: row; }
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .topbar-nav, .topbar-actions { display: none; }
    .topbar-toggle { display: block; }

    body.nav-open .topbar-nav {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: var(--topbar-height);
        left: 0;
        right: 0;
        background: rgba(6,6,13,0.97);
        backdrop-filter: blur(20px);
        padding: 20px 24px;
        gap: 12px;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        z-index: 99;
    }
    body.nav-open .topbar-actions {
        display: flex;
        position: fixed;
        top: calc(var(--topbar-height) + 200px);
        left: 0;
        right: 0;
        background: rgba(6,6,13,0.97);
        padding: 0 24px 20px;
        gap: 20px;
        z-index: 99;
    }

    .blog-hero-side { flex-direction: column; }
    .blog-grid { grid-template-columns: 1fr; }
    .blog-card-cover { height: 160px; }

    .blog-article-header h1 { font-size: 1.5rem; }
    .blog-article-content { font-size: 0.95rem; }

    .blog-footer-inner { flex-direction: column; }
    .blog-footer-links { flex-wrap: wrap; gap: 16px; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .blog-hero-card { min-height: 260px; }
    .blog-hero-overlay { padding: 24px; }
    .blog-hero-overlay h2 { font-size: 1.3rem; }
}
