/* ============================================================
   CriticalBuzzer Knowledge Platform — Blog CSS
   "Editorial Light" Design System
   ============================================================ */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;1,14..32,400;1,14..32,500&display=swap');

/* --- CSS Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:           #FFFFFF;
    --bg-soft:      #F9FAFB;
    --bg-muted:     #F3F4F6;
    --border:       #E5E7EB;
    --border-light: #F3F4F6;

    --text-primary:   #111827;
    --text-secondary: #6B7280;
    --text-muted:     #9CA3AF;
    --text-inverse:   #FFFFFF;

    --accent:       #6366F1;
    --accent-dark:  #4F46E5;
    --accent-light: #EEF2FF;

    --code-bg:      #1E1E2E;
    --code-text:    #CDD6F4;

    --radius-sm:  6px;
    --radius:     10px;
    --radius-lg:  16px;
    --radius-xl:  24px;

    --shadow-sm:  0 1px 2px rgba(0,0,0,.05);
    --shadow:     0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg:  0 10px 15px rgba(0,0,0,.07), 0 4px 6px rgba(0,0,0,.05);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --reading-width: 768px;
    --page-width:    1200px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-dark); }

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

/* --- Reading Progress Bar --- */
#reading-progress {
    position: fixed;
    top: 0; left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #818CF8);
    z-index: 1000;
    transition: width .1s linear;
}

/* --- Site Header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(2, 6, 23, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.header-brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.site-header .brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom right, #60a5fa, #9333ea);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.2);
}

.site-header .brand-icon-text {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.125rem;
    line-height: 1;
}

.site-header .brand-text {
    background: linear-gradient(to right, #60a5fa, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
}

.site-header .header-nav {
    display: flex;
    align-items: center;
    gap: 32px;
    flex: 1;
    justify-content: center;
}

.site-header .header-nav a {
    padding: 6px 0;
    color: #94A3B8;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease;
}

.site-header .header-nav a:hover,
.site-header .header-nav a.active {
    color: #FFFFFF;
    background: transparent;
}

.site-header .header-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
}

.site-header .header-login-link {
    color: #94A3B8;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease;
}

.site-header .header-login-link:hover {
    color: #FFFFFF;
}

.site-header .btn-primary {
    background-color: #FFFFFF;
    color: #0F172A;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 8px 20px;
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.site-header .btn-primary:hover {
    background-color: #F8FAFC;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.15);
}

/* Header Responsiveness */
@media (min-width: 768px) {
    .site-header .mobile-only { display: none !important; }
    .site-header .desktop-only { display: inline-flex !important; }
}

@media (max-width: 767px) {
    .site-header .desktop-only { display: none !important; }
    .site-header .mobile-only { display: flex !important; }
    .site-header .header-nav { display: none !important; }
    .header-inner { padding: 0 16px; height: 64px; }
}

.mobile-menu-btn {
    background: transparent;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw; height: 100vh;
    z-index: 99999;
    background-color: #020617;
    box-sizing: border-box;
    overflow-y: auto;
}

.mobile-menu-inner {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    padding: 24px 24px 32px;
    box-sizing: border-box;
}

.mobile-menu-close-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    margin-bottom: 32px;
}

.mobile-menu-close-btn {
    background: none;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    padding: 4px;
}

.mobile-nav-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
}

.mobile-nav-link {
    display: block;
    width: 100%;
    text-align: left;
    padding: 14px 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #FFFFFF;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.mobile-nav-link.btn-mobile-register {
    margin-top: 16px;
    background-color: #FFFFFF;
    color: #0F172A;
    text-align: center;
    border-radius: 9999px;
    border-bottom: none;
    padding: 12px 24px;
}

/* --- Page Container --- */
.page-container {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================
   BLOG INDEX PAGE
   ============================================================ */

.blog-hero {
    padding: 64px 0 48px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(180deg, #F0F0FF 0%, var(--bg) 100%);
}

.blog-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 16px;
}
.blog-hero h1 span { color: var(--accent); }

.blog-hero p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Featured Article */
.featured-article {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    padding: 64px 0;
    border-bottom: 1px solid var(--border-light);
}

.featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--accent);
    background: var(--accent-light);
    padding: 4px 10px;
    border-radius: 99px;
    margin-bottom: 16px;
}

.featured-article h2 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.015em;
    margin-bottom: 12px;
}
.featured-article h2 a { color: var(--text-primary); }
.featured-article h2 a:hover { color: var(--accent); }

.featured-article p {
    color: var(--text-secondary);
    font-size: 1.0625rem;
    line-height: 1.7;
    margin-bottom: 24px;
}

.featured-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 16/10;
    background: var(--bg-muted);
}
.featured-image img { width: 100%; height: 100%; object-fit: cover; }
.featured-image-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent-light), #E0E7FF);
    font-size: 4rem;
}

/* Article Meta */
.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: .8125rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.article-meta .author { color: var(--text-secondary); font-weight: 500; }
.article-meta .dot { color: var(--border); }
.article-meta .reading-time { display: flex; align-items: center; gap: 4px; }

/* Category Badge */
.category-badge {
    display: inline-flex;
    align-items: center;
    font-size: .75rem;
    font-weight: 600;
    color: var(--accent-dark);
    background: var(--accent-light);
    padding: 3px 10px;
    border-radius: 99px;
    text-decoration: none;
    transition: all .15s;
}
.category-badge:hover { background: var(--accent); color: white; }

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 48px 0 24px;
    border-bottom: 2px solid var(--text-primary);
    margin-bottom: 32px;
}
.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.01em;
}
.section-header a {
    font-size: .875rem;
    font-weight: 500;
    color: var(--accent);
}

/* Article Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 48px;
}

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

/* Article Card */
.article-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    background: var(--bg);
    transition: all .2s;
    box-shadow: var(--shadow-sm);
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border);
}

.card-image {
    aspect-ratio: 16/9;
    background: var(--bg-muted);
    overflow: hidden;
}
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.article-card:hover .card-image img { transform: scale(1.03); }
.card-image-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent-light), #E0E7FF);
    font-size: 2.5rem;
}

.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.card-category { margin-bottom: 4px; }
.card-title {
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -.01em;
    color: var(--text-primary);
    flex: 1;
}
.card-title a { color: inherit; }
.card-title a:hover { color: var(--accent); }
.card-excerpt {
    font-size: .875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .8rem;
    color: var(--text-muted);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 48px 0;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 500;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all .15s;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.pagination .current { background: var(--accent); color: white; border-color: var(--accent); }

/* ============================================================
   ARTICLE PAGE
   ============================================================ */

.article-layout {
    max-width: var(--reading-width);
    margin: 0 auto;
    padding: 50px 0 0;
    position: relative;
}

/* Article Header */
.article-header {
    max-width: var(--reading-width);
    margin: 0 auto;
    padding: 40px 0 8px;
}
.article-header .breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .875rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.article-header .breadcrumbs a { color: var(--text-secondary); }
.article-header .breadcrumbs a:hover { color: var(--accent); }
.article-header .breadcrumbs span,
.article-header .breadcrumbs .breadcrumb-current { color: var(--text-secondary); font-weight: normal; }

.article-header h1 {
    font-size: 2.625rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.025em;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.article-header .subtitle {
    font-size: 1.1875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
    font-weight: 400;
}

.article-header .meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 0;
}

.author-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
}
.author-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: .875rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.author-name { font-weight: 600; font-size: .875rem; }
.author-date { font-size: .8rem; color: var(--text-muted); }

.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.tag-pill {
    font-size: .75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-muted);
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: 99px;
    text-decoration: none;
    transition: all .15s;
}
.tag-pill:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* Featured Image in Article */
.article-featured-image {
    max-width: var(--reading-width);
    margin: 32px auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.article-featured-image img { width: 100%; }

/* Article Body */
.article-body {
    max-width: var(--reading-width);
    margin: 0 auto;
    padding: 0 0 64px;
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--text-primary);
}

.article-body > hr:first-child { display: none; }
.article-body > *:first-child,
.article-body > hr:first-child + * { margin-top: 0 !important; }

.article-body h1, .article-body h2, .article-body h3,
.article-body h4, .article-body h5, .article-body h6 {
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.015em;
    color: var(--text-primary);
    margin-top: 2.5em;
    margin-bottom: .75em;
}
.article-body h2 { font-size: 1.75rem; padding-bottom: .5em; border-bottom: 2px solid var(--border-light); }
.article-body h3 { font-size: 1.375rem; }
.article-body h4 { font-size: 1.125rem; }

.article-body p { margin-bottom: 16px; }

.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { color: var(--accent-dark); }

.article-body ul, .article-body ol {
    padding-left: 1.75em;
    margin-bottom: 1.5em;
}
.article-body li { margin-bottom: .5em; }
.article-body li::marker { color: var(--accent); }

/* ── Premium Callout Card ──────────────────────────────────── */
.article-body blockquote {
    position: relative;
    margin: 2.5rem 0;
    padding: 1.625rem 1.875rem 1.625rem 1.875rem;
    background: #0F172A;
    border-left: 4px solid #6366F1;
    border-radius: 0 12px 12px 0;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.14), 0 1px 6px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    transition: box-shadow 0.25s ease;
}

.article-body blockquote:hover {
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.2), 0 2px 8px rgba(15, 23, 42, 0.10);
}

/* Subtle top-right indigo glow */
.article-body blockquote::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.article-body blockquote::after {
    content: none;
}

.article-body blockquote p {
    position: relative;
    z-index: 1;
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: #E2E8F0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.8;
    font-style: normal;
    letter-spacing: 0.005em;
}

.article-body blockquote p:last-child {
    margin-bottom: 0;
}

/* First paragraph — slightly larger as the pull-quote lead */
.article-body blockquote p:first-child {
    color: #F1F5F9;
    font-size: 1.0375rem;
    font-weight: 500;
}

.article-body img {
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin: 2em auto;
    display: block;
}

.article-body hr {
    border: none;
    border-top: 2px solid var(--border-light);
    margin: 3em 0;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    font-size: .9375rem;
    overflow-x: auto;
    display: block;
}
.article-body table th {
    background: var(--bg-muted);
    font-weight: 600;
    text-align: left;
    padding: 10px 16px;
    border: 1px solid var(--border);
    font-size: .875rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.article-body table td {
    padding: 10px 16px;
    border: 1px solid var(--border);
    vertical-align: top;
}
.article-body table tr:nth-child(even) td { background: var(--bg-soft); }

/* Code Blocks (Dark Syntax Console Theme) */
.code-block-wrapper {
    margin: 2em 0;
    background: #141416;
    border: 1px solid #28282D;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.45);
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: #1B1B1E;
    border-bottom: 1px solid #28282D;
}

.code-block-lang {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #8A8A8E;
    text-transform: lowercase;
    letter-spacing: 0.03em;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #98989D;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.15s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.2);
}

.copy-btn.copied {
    color: #30D158;
    border-color: #30D158;
    background: rgba(48, 209, 88, 0.1);
}

.article-body pre {
    position: relative;
    background: #141416;
    border-radius: 0;
    padding: 20px 24px;
    margin: 0;
    overflow-x: auto;
    border: none !important;
    box-shadow: none !important;
}

.article-body pre code,
.article-body pre code *,
.article-body pre span {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.65;
}

.article-body pre code {
    color: #F8FAFC;
    display: block;
}

/* Dark Syntax Highlighting Tokens */
.article-body pre .hljs-attr { color: #FF453A; font-weight: 500; } /* Crimson Red for Keys */
.article-body pre .hljs-string { color: #A3E235; } /* Lime Green for Strings */
.article-body pre .hljs-number { color: #FFB020; font-weight: 500; } /* Amber Gold for Numbers */
.article-body pre .hljs-keyword { color: #C678DD; font-weight: 600; } /* Purple for Keywords */
.article-body pre .hljs-built_in { color: #61AFEF; font-weight: 500; } /* Cyan/Blue for Built-ins */
.article-body pre .hljs-comment { color: #6E7681; font-style: italic; } /* Slate Gray for Comments */

/* Inline Code Only (not inside pre) */
.article-body :not(pre) > code {
    background: #F1F5F9;
    color: #4F46E5;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.875em;
    padding: 2px 6px;
    border-radius: 5px;
    border: 1px solid #E2E8F0;
}

/* TOC Sidebar */
.toc-sidebar {
    position: absolute;
    left: calc(100% + 36px);
    top: 0;
    bottom: 0;
    height: 100%;
    width: 260px;
    pointer-events: none;
    z-index: 10;
}

@media (max-width: 1180px) {
    .toc-sidebar { display: none !important; }
}

.sticky-toc {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.2) transparent;
    pointer-events: auto;
    /* Elegant card */
    background: #FFFFFF;
    border: 1px solid rgba(99, 102, 241, 0.14);
    border-radius: 14px;
    box-shadow: 0 10px 30px -5px rgba(99, 102, 241, 0.08), 0 4px 12px -2px rgba(17, 24, 39, 0.03);
    padding: 20px 16px;
}

.sticky-toc::-webkit-scrollbar { width: 4px; }
.sticky-toc::-webkit-scrollbar-track { background: transparent; }
.sticky-toc::-webkit-scrollbar-thumb { background: rgba(99, 102, 241, 0.2); border-radius: 4px; }

/* TOC Header label */
.toc-sidebar h3 {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #9CA3AF;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.10);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toc-sidebar h3::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236366F1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='6' x2='21' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='12' x2='15' y2='12'%3E%3C/line%3E%3Cline x1='3' y1='18' x2='12' y2='18'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    flex-shrink: 0;
}

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

.toc-list li {
    margin-bottom: 3px;
}

.toc-list a {
    display: flex;
    align-items: flex-start;
    padding: 6px 10px 6px 8px;
    font-size: 0.8125rem;
    font-weight: 450;
    color: #4B5563;
    border-radius: 8px;
    border-left: 2.5px solid transparent;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
    line-height: 1.45;
    text-decoration: none;
    word-break: break-word;
}

.toc-list a:hover {
    color: #4F46E5;
    background: rgba(99, 102, 241, 0.06);
    transform: translateX(2px);
}

/* Active state — premium gradient pill */
.toc-list a.active {
    color: #4338CA;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(79, 70, 229, 0.06) 100%);
    border-left-color: #6366F1;
    font-weight: 600;
}

/* Indentation by Heading Level */
.toc-list .toc-h1 > a {
    padding-left: 8px;
    font-weight: 500;
}

.toc-list .toc-h2 > a {
    padding-left: 14px;
    font-weight: 500;
}

.toc-list .toc-h3 > a {
    padding-left: 24px;
    font-size: 0.775rem;
    color: #6B7280;
}

.toc-list .toc-h4 > a {
    padding-left: 34px;
    font-size: 0.725rem;
    color: #9CA3AF;
}

/* Related Articles */
.related-articles {
    max-width: var(--reading-width);
    margin: 0 auto;
    padding: 48px 0;
    border-top: 2px solid var(--border-light);
}
.related-articles h2 {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -.01em;
}
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 700px) { .related-grid { grid-template-columns: 1fr; } }

/* Feedback Widget */
.feedback-widget {
    max-width: var(--reading-width);
    margin: 40px auto 48px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
    transition: all 0.2s ease;
}

.feedback-widget h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #0F172A;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

.feedback-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: center;
}

.feedback-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 9999px;
    border: 1.5px solid #E2E8F0;
    background: #FFFFFF;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--font);
    color: #475569;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.feedback-btn .feedback-icon {
    transition: transform 0.2s ease, stroke 0.2s ease;
    flex-shrink: 0;
}

.feedback-btn:hover {
    transform: translateY(-2px);
}

.feedback-btn:active {
    transform: translateY(0) scale(0.97);
}

.feedback-btn.yes:hover {
    background: #ECFDF5;
    border-color: #10B981;
    color: #047857;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.18);
}

.feedback-btn.yes:hover .feedback-icon {
    transform: rotate(-10deg) scale(1.1);
    stroke: #047857;
}

.feedback-btn.no:hover {
    background: #FEF2F2;
    border-color: #F43F5E;
    color: #BE123C;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.18);
}

.feedback-btn.no:hover .feedback-icon {
    transform: rotate(10deg) scale(1.1);
    stroke: #BE123C;
}

.feedback-submitted {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 16px;
    animation: feedbackFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.feedback-submitted-icon {
    font-size: 1.25rem;
}

.feedback-submitted-text {
    font-weight: 600;
    font-size: 0.95rem;
    color: #0F172A;
    margin: 0;
}

@keyframes feedbackFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   SITE FOOTER
   ============================================================ */

/* --- Site Footer (Matching Homepage Footer) --- */
footer.py-20, .site-footer {
    background-color: #020617 !important;
    color: #94A3B8 !important;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
    padding-bottom: 80px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 80px;
}

footer a, .site-footer a {
    text-decoration: none;
}

.footer-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 3rem !important;
    max-width: 1280px;
    margin: 0 auto 64px auto;
    padding: 0 24px;
}

.footer-grid > .brand-section {
    grid-column: span 2 / span 2 !important;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

.footer-grid .brand-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-grid .brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom right, #60a5fa, #9333ea);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.2);
}

.footer-grid .brand-text {
    background: linear-gradient(to right, #60a5fa, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
}

.footer-grid h4 {
    color: #FFFFFF !important;
    font-weight: 700;
    margin-bottom: 24px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.footer-grid ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-grid ul li a {
    font-size: 0.875rem;
    color: #94A3B8;
    transition: color 0.15s ease;
}

.footer-grid ul li a:hover {
    color: #60A5FA;
}

.footer-bottom-bar {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px 0 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #475569;
    font-family: monospace;
}

@media (max-width: 767px) {
    .footer-bottom-bar {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* ============================================================
   SEARCH PAGE
   ============================================================ */

.search-header { padding: 48px 0 32px; border-bottom: 1px solid var(--border-light); }
.search-header h1 { font-size: 2rem; font-weight: 700; margin-bottom: 8px; }
.search-header p { color: var(--text-secondary); }
.search-form-lg {
    display: flex;
    gap: 12px;
    max-width: 600px;
    margin-top: 20px;
}
.search-form-lg input {
    flex: 1;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 18px;
    font-size: 1rem;
    font-family: var(--font);
    outline: none;
    transition: border-color .15s;
}
.search-form-lg input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.search-form-lg button {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 12px 24px;
    font-size: .9375rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: background .15s;
}
.search-form-lg button:hover { background: var(--accent-dark); }

.search-results { padding: 32px 0; }
.search-count { font-size: .875rem; color: var(--text-secondary); margin-bottom: 24px; }

/* ============================================================
   404 PAGE
   ============================================================ */

.error-page {
    text-align: center;
    padding: 120px 24px;
    max-width: 560px;
    margin: 0 auto;
}
.error-page .error-code {
    font-size: 7rem;
    font-weight: 800;
    line-height: 1;
    color: var(--accent);
    opacity: .15;
    letter-spacing: -.04em;
}
.error-page h1 { font-size: 2rem; font-weight: 700; margin-bottom: 12px; }
.error-page p { color: var(--text-secondary); margin-bottom: 32px; }
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: .9375rem;
    transition: all .15s;
    text-decoration: none;
}
.btn-primary:hover { background: var(--accent-dark); color: white; transform: translateY(-1px); }

/* ============================================================
   RESPONSIVE UTILITIES
   ============================================================ */

@media (max-width: 768px) {
    .blog-hero h1 { font-size: 2.25rem; }
    .featured-article { grid-template-columns: 1fr; gap: 32px; }
    .article-header h1 { font-size: 2rem; }
    .header-search { display: none; }
    .header-nav { display: none; }
}
