﻿/* ═══════════════════════════════════════
   MineRank Blog — Light theme matching homepage
   ═══════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --fg: #0f172a;
    --muted: #64748b;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #eef2ff;
    --secondary: #ec4899;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --card: #ffffff;
    --radius: 16px;
    --radius-sm: 10px;
}

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--fg);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--primary-hover); }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ─── Navbar ─── */
.blog-topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: #161b22;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.blog-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
}

.brand img {
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.top-links {
    display: flex;
    gap: 4px;
}

.top-links a {
    padding: 8px 16px;
    color: #d1d5db;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
    border: none;
}

.top-links a:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

/* ─── Blog Hub Hero ─── */
.hero {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 72px 0 48px;
}

.hero h1 {
    margin: 0 0 14px;
    line-height: 1.1;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--fg);
}

.hero p {
    margin: 0;
    max-width: 720px;
    color: var(--muted);
    font-size: clamp(1rem, 1.4vw, 1.1rem);
    line-height: 1.7;
}

.hero p a { font-weight: 600; }

/* ─── Pill / Tag ─── */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    border: 1px solid rgba(99,102,241,0.18);
    border-radius: 999px;
    padding: 6px 12px;
    margin-bottom: 8px;
}

/* ─── Blog Grid (Hub) ─── */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    padding: 56px 0 80px;
}

.blog-card {
    background: var(--card);
    border: 1px solid #f1f5f9;
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    border-color: var(--border);
}

.blog-card img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.blog-card-body {
    padding: 20px;
}

.blog-card h2 {
    margin: 10px 0 10px;
    line-height: 1.3;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--fg);
}

.blog-card h2 a { color: var(--fg); }
.blog-card h2 a:hover { color: var(--primary); }

.blog-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.meta {
    margin-top: 12px;
    color: #94a3b8;
    font-size: 12px;
}

/* ─── Post Layout ─── */
.post-shell {
    padding: 40px 0 100px;
    background: var(--bg-alt);
    min-height: 80vh;
}

.post-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 28px;
}

/* ─── Sidebar ─── */
.sidebar {
    position: sticky;
    top: 76px;
    align-self: start;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
}

.sidebar h3 {
    margin: 0 0 10px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.sidebar ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 4px;
}

.sidebar a {
    display: block;
    color: var(--fg);
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.15s;
}

.sidebar a:hover {
    background: var(--primary-light);
    border-color: rgba(99,102,241,0.18);
    color: var(--primary);
}

.sidebar .recommend {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.sidebar .recommend h3 {
    color: var(--muted);
}

.sidebar .recommend a {
    font-size: 12px;
    color: var(--muted);
}

.sidebar .recommend a:hover {
    color: var(--primary);
}

/* ─── Article ─── */
article.post {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.04);
}

.post-hero {
    position: relative;
}

.post-hero img {
    width: 100%;
    aspect-ratio: 16/6;
    object-fit: cover;
    display: block;
}

.post-hero .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15,23,42,0.15) 0%, rgba(15,23,42,0.75) 100%);
}

.post-hero-content {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 24px;
}

.post-hero h1 {
    margin: 10px 0 0;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #fff;
}

.post-hero .pill {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}

/* ─── Post Content ─── */
.post-content {
    padding: 32px;
}

.post-content h2 {
    margin-top: 40px;
    margin-bottom: 14px;
    font-size: clamp(1.25rem, 2vw, 1.55rem);
    line-height: 1.25;
    font-weight: 800;
    color: var(--fg);
}

.post-content p {
    margin: 0 0 18px;
    color: #475569;
    font-size: 1rem;
    line-height: 1.8;
}

.post-content strong { color: var(--fg); }

.post-content a { font-weight: 500; }

.jump {
    display: inline-flex;
    margin-top: 8px;
    font-size: 12px;
    color: var(--primary);
}

/* ─── CTA Box ─── */
.cta-box {
    margin-top: 42px;
    background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(236,72,153,0.04));
    border: 1px solid rgba(99,102,241,0.18);
    border-radius: 14px;
    padding: 24px;
}

.cta-box h2, .cta-box h3 {
    color: var(--fg);
}

.cta-box p {
    color: var(--muted);
}

.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99,102,241,0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 8px 20px rgba(99,102,241,0.3);
    color: #fff;
}

.btn-ghost {
    background: var(--card);
    border-color: var(--border);
    color: var(--fg);
}

.btn-ghost:hover {
    border-color: var(--border-strong);
    color: var(--fg);
}

/* ─── Footer ─── */
.footer-pad {
    padding: 28px 0 52px;
    color: var(--muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: 0;
}

/* ─── Responsive ─── */
@media (max-width: 1080px) {
    .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .post-layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
}

@media (max-width: 720px) {
    .top-links { display: none; }
    .blog-grid { grid-template-columns: 1fr; }
    .post-content { padding: 20px; }
    .hero { padding: 48px 0 32px; }
}
