/* ============================================== */
/* DEVGAINX BLOG SYSTEM — blog.css                */
/* ============================================== */

:root {
    --primary: #5850ec;
    --primary-light: #818cf8;
    --accent: #ec4899;
    --text-main: #0f172a;
    --text-dim: #475569;
    --text-muted: #94a3b8;
    --bg-alt: #f8fafc;
    --glass-border: rgba(15, 23, 42, 0.08);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-alt);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Background Animation */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: #fdfdfd;
}

.blob {
    position: absolute;
    width: 45vw;
    height: 45vw;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.blob-1 { top: -10%; right: -10%; background: #e0e7ff; }
.blob-2 { bottom: -10%; left: -10%; background: #fae8ff; }

/* Navbar Hub Integration */
nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 5%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #5850ec, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
    text-decoration: none;
    display: inline-block;
}
.logo span {
    color: inherit;
    -webkit-text-fill-color: inherit;
}

.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-link { 
    text-decoration: none; 
    color: var(--text-dim); 
    font-weight: 700; 
    font-size: 0.95rem; 
    transition: all 0.3s; 
}
.nav-link:hover { color: var(--primary); }

/* Hero Section */
.blog-header {
    padding: 8rem 5% 4rem;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.blog-header h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 1.05;
    color: var(--text-main);
}

.blog-header p {
    font-size: 1.2rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Search & Filters */
.blog-controls {
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 0 5%;
}

.search-wrap {
    background: white;
    padding: 0.5rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    display: flex;
    align-items: center;
    max-width: 600px;
    margin: 0 auto 2.5rem;
    transition: all 0.3s;
}

.search-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 15px 35px rgba(88, 80, 236, 0.1);
}

.search-wrap input {
    flex: 1;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
}

.filter-chips {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.chip {
    padding: 0.6rem 1.5rem;
    background: white;
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.3s;
}

.chip.active { background: var(--primary); color: white; border-color: var(--primary); }
.chip:hover:not(.active) { background: var(--bg-alt); color: var(--primary); }

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 3rem;
    max-width: 1300px;
    margin: 0 auto 6rem;
    padding: 0 5%;
}

.blog-card {
    background: white;
    border-radius: 32px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.08);
    border-color: var(--primary-light);
}

.card-img {
    height: 240px;
    background: #f1f5f9;
    position: relative;
    overflow: hidden;
}

.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s; }
.blog-card:hover .card-img img { transform: scale(1.05); }

.tag {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    padding: 0.4rem 1rem;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary);
}

.card-body { padding: 2rem; flex: 1; }
.card-body h3 { font-size: 1.5rem; font-weight: 800; margin-bottom: 1rem; line-height: 1.3; color: var(--text-main); }
.card-body p { font-size: 1rem; color: var(--text-muted); margin-bottom: 1.5rem; }

.card-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.read-more { font-weight: 800; color: var(--primary); font-size: 0.9rem; }

/* Single Article Layout */
.article-page {
    max-width: 850px;
    margin: 4rem auto 8rem;
    padding: 0 1.5rem;
}

.back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 800;
    margin-bottom: 3rem;
    transition: all 0.3s;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.back-link:hover { color: var(--primary); transform: translateX(-5px); }

.article-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
}

.article-header h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    text-align: center;
}

.article-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.article-hero {
    width: 100%;
    height: 450px;
    border-radius: 32px;
    overflow: hidden;
    margin-bottom: 4rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.05);
}

.article-hero img { width: 100%; height: 100%; object-fit: cover; }

.content { font-size: 1.15rem; color: var(--text-dim); line-height: 1.8; }
.content p { margin-bottom: 2rem; }
.content h2 { font-size: 2rem; font-weight: 800; color: var(--text-main); margin: 4rem 0 1.5rem; }
.content h3 { font-size: 1.5rem; font-weight: 800; color: var(--text-main); margin: 2.5rem 0 1rem; }

.content ul, .content ol { margin-bottom: 2.5rem; padding-left: 1.5rem; }
.content li { margin-bottom: 0.75rem; }

/* CTA SECTION */
.cta-box {
    background: linear-gradient(135deg, #5850ec, #ec4899);
    border-radius: 32px;
    padding: 4rem 2rem;
    text-align: center;
    color: white;
    margin: 4rem 0;
    box-shadow: 0 30px 60px rgba(88, 80, 236, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.cta-box h2 { 
    font-size: 2.25rem; 
    font-weight: 900; 
    margin: 0; 
    color: white; 
}
.cta-box p { 
    font-size: 1.1rem; 
    opacity: 0.9; 
    margin-bottom: 1.5rem; 
    color: white;
    max-width: 500px;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    background: #ffffff;
    color: #5850ec !important;
    text-decoration: none !important;
    border-radius: 16px;
    font-weight: 800;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    min-width: 240px;
    margin-top: 1rem;
}

.cta-btn:hover { 
    transform: translateY(-5px) scale(1.02); 
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    background: #fdfdfd;
}

/* Footer */
footer {
    padding: 6rem 5%;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    background: white;
}

.footer-logo {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #5850ec, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 2rem;
}
.footer-logo span {
    color: inherit;
    -webkit-text-fill-color: inherit;
}
.footer-links { display: flex; justify-content: center; gap: 3rem; margin-bottom: 3rem; flex-wrap: wrap; }
.footer-link { text-decoration: none; color: var(--text-dim); font-weight: 700; }
.footer-copy { color: var(--text-muted); font-size: 0.9rem; }

/* Mobile */
@media (max-width: 768px) {
    .blog-header { padding: 6rem 5% 3rem; }
    .blog-grid { grid-template-columns: 1fr; gap: 2rem; }
    .article-hero { height: 250px; }
    .article-header h1 { font-size: 2.25rem; }
    .cta-box { padding: 2.5rem 1.5rem; }
    .cta-box h2 { font-size: 1.8rem; }
}
