/* ===================================================================
   BLOG — Styles matching index.php landing page design
   MindPulse Blog
   Uses the SAME variables and patterns as the main landing page
   =================================================================== */

:root {
    --primary: #4F46E5;
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --accent: #06B6D4;
    --accent-light: #22D3EE;
    --bg: #F8FAFC;
    --bg-alt: #F1F5F9;
    --white: #FFFFFF;
    --text: #0F172A;
    --text-md: #475569;
    --text-lt: #94A3B8;
    --border: #E2E8F0;
    --success: #10B981;
    --danger: #EF4444;
    --grad-hero: linear-gradient(135deg, #EEF2FF 0%, #E0F2FE 50%, #F0FDFA 100%);
    --grad-cta: linear-gradient(135deg, #4F46E5 0%, #06B6D4 100%);
    --grad-card: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06);
    --shadow-md: 0 4px 20px rgba(15, 23, 42, .08);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, .12);
    --shadow-xl: 0 20px 60px rgba(79, 70, 229, .15);
    --radius: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
    line-height: 1.2
}

a {
    text-decoration: none;
    color: inherit
}

/* ---------- Badges & Buttons (same as index.php) ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: .8rem;
    font-weight: 500;
    color: var(--primary)
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all .3s ease
}

.btn-primary {
    background: var(--grad-cta);
    color: #fff;
    box-shadow: 0 4px 20px rgba(79, 70, 229, .3)
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(79, 70, 229, .4)
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary)
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff
}

.btn-white {
    background: #fff;
    color: var(--primary);
    box-shadow: var(--shadow-md)
}

.btn-white:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg)
}

.section-label {
    text-transform: uppercase;
    font-size: .75rem;
    letter-spacing: 2px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 12px
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px
}

.section-sub {
    font-size: 1.1rem;
    color: var(--text-md);
    max-width: 600px;
    margin: 0 auto
}

.text-gradient {
    background: var(--grad-cta);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

/* ---------- Header (same as index.php) ---------- */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 16px 0;
    transition: all .3s
}

.header.scrolled {
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm)
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none
}

.header-logo img {
    height: 36px;
    width: auto
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 32px
}

.header-nav a {
    text-decoration: none;
    color: var(--text-md);
    font-weight: 500;
    font-size: .9rem;
    transition: color .2s
}

.header-nav a:hover,
.header-nav a.active {
    color: var(--primary)
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
    padding: 8px
}

/* ---------- Mobile Nav ---------- */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 360px;
    height: 100vh;
    background: var(--white);
    z-index: 2001;
    padding: 80px 32px 32px;
    transition: right .4s cubic-bezier(.4, 0, .2, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, .1);
    display: flex;
    flex-direction: column;
    gap: 8px
}

.mobile-nav.active {
    right: 0
}

.mobile-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 1rem;
    transition: background .2s
}

.mobile-nav a:hover {
    background: var(--bg-alt)
}

.mobile-nav .close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-md)
}

.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: auto
}

/* ---------- Hero ---------- */
.hero {
    padding: 140px 0 80px;
    background: var(--grad-hero);
    position: relative;
    overflow: hidden
}

.hero::before {
    content: '';
    position: absolute;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(79, 70, 229, .08) 0%, transparent 70%);
    border-radius: 50%
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -150px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(6, 182, 212, .08) 0%, transparent 70%);
    border-radius: 50%
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--text-md);
    margin-bottom: 32px;
    line-height: 1.8
}

/* ---------- Blog Grid ---------- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px
}

.bento-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all .3s;
    display: flex;
    flex-direction: column
}

.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light)
}

.bento-card.span2 {
    grid-column: span 2
}

.blog-card-img {
    display: block;
    height: 200px;
    overflow: hidden
}

.bento-card.span2 .blog-card-img {
    height: 280px
}

.blog-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease
}

.bento-card:hover .blog-card-img img {
    transform: scale(1.04)
}

.blog-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
    color: var(--primary);
    font-size: 2.5rem;
    opacity: .4
}

.blog-card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column
}

.blog-card-category {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--primary);
    margin-bottom: 10px
}

.blog-card-category:hover {
    text-decoration: underline
}

.blog-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px
}

.blog-card-title a {
    color: var(--text);
    transition: color .2s
}

.blog-card-title a:hover {
    color: var(--primary)
}

.blog-card-excerpt {
    font-size: .88rem;
    color: var(--text-md);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1
}

.blog-card-meta {
    display: flex;
    gap: 16px;
    font-size: .78rem;
    color: var(--text-lt);
    margin-top: auto
}

.blog-card-meta i {
    margin-right: 4px
}

/* ---------- Share Buttons ---------- */
.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    color: var(--text-md);
    font-size: 1rem;
    transition: all .2s
}

.share-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary)
}

/* ---------- Post Content ---------- */
.post-content {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text)
}

.post-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 40px 0 16px;
    color: var(--text)
}

.post-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 32px 0 12px
}

.post-content p {
    margin-bottom: 20px
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 24px 0;
    box-shadow: var(--shadow-md)
}

.post-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px
}

.post-content blockquote {
    border-left: 4px solid var(--primary);
    margin: 24px 0;
    padding: 16px 24px;
    background: rgba(79, 70, 229, .04);
    border-radius: 0 12px 12px 0;
    color: var(--text-md);
    font-style: italic
}

.post-content pre {
    background: #1E293B;
    color: #E2E8F0;
    padding: 20px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 24px 0;
    font-size: .9rem
}

.post-content ul,
.post-content ol {
    margin: 16px 0;
    padding-left: 28px
}

.post-content li {
    margin-bottom: 8px
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0
}

.post-content table th,
.post-content table td {
    padding: 10px 16px;
    border: 1px solid var(--border);
    text-align: left
}

.post-content table th {
    background: var(--bg);
    font-weight: 600;
    font-size: .85rem
}

/* ---------- CTA Final ---------- */
.cta-final {
    padding: 100px 0;
    background: var(--grad-cta);
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden
}

.cta-final::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, .05);
    border-radius: 50%
}

.cta-final h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 16px
}

.cta-final p {
    font-size: 1.1rem;
    opacity: .9;
    max-width: 550px;
    margin: 0 auto 40px
}

/* ---------- Footer ---------- */
.footer {
    padding: 60px 0 32px;
    background: var(--text);
    color: rgba(255, 255, 255, .6)
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 24px
}

.footer-logo img {
    height: 32px;
    filter: brightness(10)
}

.footer-links {
    display: flex;
    gap: 24px
}

.footer-links a {
    color: rgba(255, 255, 255, .5);
    text-decoration: none;
    font-size: .85rem;
    transition: color .2s
}

.footer-links a:hover {
    color: #fff
}

.footer-bottom {
    text-align: center;
    font-size: .8rem
}

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media(max-width:1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .bento-card.span2 {
        grid-column: span 2
    }

    .header-nav {
        display: none
    }

    .menu-toggle {
        display: block
    }

    .header-actions .btn {
        display: none
    }
}

@media(max-width:640px) {
    .blog-grid {
        grid-template-columns: 1fr
    }

    .bento-card.span2 {
        grid-column: span 1
    }

    .bento-card.span2 .blog-card-img {
        height: 200px
    }

    .hero {
        padding: 120px 0 60px
    }

    .hero-title {
        font-size: 2.2rem
    }

    section {
        padding: 60px 0 !important
    }
}