/* ═══════════════════════════════════════════════════════════════════════════
   BLOG DESIGN SYSTEM — MODERN DARK THEME (2026)
   Aesthetic: Obsidian Slate, Glowing Accents, Clean Editorial Typography
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* Color Palette */
    --bg-body: #050507;
    --bg-surface: #0c0d14;
    --bg-surface-elevated: #13141f;
    --bg-surface-alt: #1a1b2a;
    --bg-code: #08090e;
    
    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-light: rgba(255, 255, 255, 0.12);
    --border-hover: rgba(129, 140, 248, 0.4);
    --border-glow: rgba(99, 102, 241, 0.3);
    
    /* Typography */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-dim: #475569;
    
    /* Accent Tones */
    --accent-primary: #6366f1;
    --accent-hover: #818cf8;
    --accent-cyan: #00f2fe;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-purple: #a855f7;
    
    /* Gradients */
    --gradient-hero: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 65%),
                     linear-gradient(180deg, #07080f 0%, #050507 100%);
    --gradient-text: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #94a3b8 100%);
    --gradient-card-overlay: linear-gradient(180deg, transparent 50%, rgba(12, 13, 20, 0.95) 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
    
    /* Typography Stacks */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Transitions & Radii */
    --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

/* ─── BASE RESET ─── */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-body);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-top: 0;
}

a {
    color: var(--accent-hover);
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

a:hover {
    color: var(--text-primary);
}

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

/* ─── READING PROGRESS BAR ─── */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-cyan));
    width: 0%;
    z-index: 1050;
    transition: width 0.1s linear;
}

/* ─── NAVBAR ─── */
.navbar-premium {
    background: rgba(7, 8, 15, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.85rem 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    z-index: 1000;
}

.navbar-brand {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary) !important;
    letter-spacing: -0.03em;
}

.navbar-brand em,
.navbar-brand span {
    color: var(--accent-primary);
    font-style: normal;
}

.nav-link {
    font-size: 0.925rem;
    font-weight: 500;
    color: var(--text-secondary) !important;
    padding: 0.5rem 0.85rem !important;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
    color: var(--accent-hover) !important;
    background: rgba(99, 102, 241, 0.08);
}

/* ─── HERO SECTION ─── */
.hero-section {
    position: relative;
    padding: 7.5rem 0 4rem;
    background: var(--gradient-hero);
    border-bottom: 1px solid var(--border-subtle);
    text-align: center;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-hover);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-full);
    font-size: 0.825rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(2.4rem, 5.5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.15;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.25rem;
    letter-spacing: -0.03em;
}

.hero-description {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

/* ─── SEARCH & FILTER CONTROLS ─── */
.search-filter-wrapper {
    max-width: 820px;
    margin: 0 auto;
}

.search-box-container {
    position: relative;
    max-width: 520px;
    margin: 0 auto 2rem;
}

.search-input {
    width: 100%;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 14px 44px 14px 46px;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: all 0.25s ease;
    outline: none;
    box-shadow: var(--shadow-sm);
}

.search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), var(--shadow-md);
    background: var(--bg-surface-alt);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

.search-clear-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    font-size: 0.9rem;
    display: none;
    transition: color 0.2s;
}

.search-clear-btn:hover {
    color: var(--text-primary);
}

/* Category Filter Tabs */
.filter-tabs-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.filter-btn {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    padding: 7px 18px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-btn:hover {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--accent-primary);
    color: #ffffff;
    border-color: var(--accent-primary);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
}

/* Topic Hubs Ribbon */
.topic-hubs-ribbon {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 1.5rem;
}

.hub-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s ease;
}

.hub-pill:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--accent-hover);
    transform: translateY(-2px);
}

/* ─── BLOG GRID & ARTICLES ─── */
.results-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
    padding-bottom: 5rem;
}

.article-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: transform 0.35s var(--ease-smooth),
                border-color 0.35s ease,
                box-shadow 0.35s ease;
}

.article-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* Card Image */
.card-image-wrapper {
    position: relative;
    padding-top: 52%;
    overflow: hidden;
    background-color: var(--bg-surface-elevated);
}

.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-smooth);
}

.article-card:hover .card-image {
    transform: scale(1.06);
}

.card-read-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(5, 5, 7, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    z-index: 2;
}

/* Card Content */
.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.775rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-bottom: 10px;
}

.category-tag {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.725rem;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-hover);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Category Accent Variants */
.category-tag.cyan {
    background: rgba(0, 242, 254, 0.1);
    color: var(--accent-cyan);
    border-color: rgba(0, 242, 254, 0.25);
}

.category-tag.emerald {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
    border-color: rgba(16, 185, 129, 0.25);
}

.category-tag.amber {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-amber);
    border-color: rgba(245, 158, 11, 0.25);
}

.meta-dot {
    width: 4px;
    height: 4px;
    background: var(--text-dim);
    border-radius: 50%;
}

.card-heading {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.85rem;
}

.card-heading a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

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

.card-excerpt {
    color: var(--text-secondary);
    font-size: 0.925rem;
    line-height: 1.65;
    margin-bottom: 1.25rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Footer */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    margin-top: auto;
}

.author-block {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    object-fit: cover;
}

.author-name {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.read-btn {
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--accent-hover);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.2s ease, color 0.2s ease;
}

.read-btn:hover {
    color: #ffffff;
    gap: 8px;
}

.card-share-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.card-share-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

/* Empty State */
.no-results-box {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 1.5rem;
    background: var(--bg-surface);
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-lg);
    margin: 2rem 0;
    display: none;
}

.no-results-box i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.no-results-box h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.no-results-box p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ─── TOAST NOTIFICATION ─── */
#blogToast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-hover);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 99999;
    opacity: 0;
    transform: translateY(16px);
    transition: all 0.3s var(--ease-smooth);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

#blogToast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ─── ARTICLE HEADER SHARE BAR ─── */
.share-buttons-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    margin-top: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.share-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s var(--ease-smooth);
    padding: 0;
    margin: 0;
    line-height: 1;
    outline: none;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    color: #ffffff;
}

.share-btn.linkedin:hover {
    background: #0a66c2;
    color: #ffffff;
    border-color: #0a66c2;
}

.share-btn.twitter:hover {
    background: #1da1f2;
    color: #ffffff;
    border-color: #1da1f2;
}

.share-btn.whatsapp:hover {
    background: #25d366;
    color: #ffffff;
    border-color: #25d366;
}

.share-btn.copy-link-btn:hover,
.share-btn.copy-btn:hover {
    background: var(--accent-primary);
    color: #ffffff;
    border-color: var(--accent-primary);
}

/* ─── ARTICLE CASE STUDY LAYOUTS ─── */
.article-header {
    padding: 5rem 0 2.5rem;
    text-align: center;
}

.article-content-wrapper {
    font-family: var(--font-body);
    color: var(--text-primary);
}

.article-content-wrapper p {
    font-size: 1.15rem;
    line-height: 1.85;
    margin-bottom: 1.85rem;
    color: var(--text-secondary);
}

.article-content-wrapper h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-top: 3.5rem;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.article-content-wrapper h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.dropcap::first-letter {
    font-family: 'Libre Baskerville', serif;
    font-size: 4.2rem;
    float: left;
    line-height: 0.85;
    margin-right: 1.15rem;
    margin-top: 0.2rem;
    color: var(--accent-primary);
    font-weight: 700;
}

.highlight-box {
    background: var(--bg-surface-alt);
    border-left: 5px solid var(--accent-primary);
    padding: 2rem 2.25rem;
    border-radius: var(--radius-md);
    margin: 3rem 0;
    position: relative;
    overflow: hidden;
    border-top: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin: 2.5rem 0;
}

@media (max-width: 992px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--bg-surface);
    padding: 1.5rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-align: center;
    border: 1px solid var(--border-subtle);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent-hover) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    margin-bottom: 0.35rem;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.775rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    font-weight: 700;
}

.sticky-top-sidebar {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding-right: 4px;
}

.toc-wrapper {
    background: var(--bg-surface);
    padding: 1.75rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2.5rem;
    border: 1px solid var(--border-subtle);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 0.85rem;
}

.toc-list a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease, padding-left 0.2s ease;
    display: block;
}

.toc-list a:hover {
    color: var(--accent-hover);
    padding-left: 4px;
}

pre {
    background: var(--bg-code);
    color: #f8fafc;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    overflow-x: auto;
    margin-bottom: 2rem;
    border: 1px solid var(--border-subtle);
}

.mermaid {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
    overflow-x: auto;
}

/* ─── FOOTER ─── */
.blog-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    padding: 4rem 0 3rem;
    margin-top: 5rem;
    text-align: center;
}

.footer-social-links {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.footer-social-links a {
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: color 0.2s, transform 0.2s;
}

.footer-social-links a:hover {
    color: var(--accent-hover);
    transform: translateY(-2px);
}

/* ─── RESPONSIVE BREAKPOINTS ─── */
@media (max-width: 992px) {
    .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    .toc-wrapper {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 5.5rem 0 3rem;
    }
    .hero-title {
        font-size: 2.3rem;
    }
    .hero-description {
        font-size: 1rem;
    }
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .filter-tabs-container {
        gap: 6px;
    }
    .filter-btn {
        padding: 6px 14px;
        font-size: 0.8rem;
    }
}
