@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
    --bg: #08101e;
    --surface: #0f1c30;
    --surface-hover: #162236;
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(99, 179, 237, 0.35);
    --accent: #3b82f6;
    --accent-purple: #7c3aed;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --text: #e8eef7;
    --text-secondary: #7589a4;
    --text-muted: #3d5168;
    --link: #60a5fa;
    --green: #34d399;
    --gold: #fbbf24;
    --transition: 0.2s ease;
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    padding-top: 64px;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

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

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate {
    animation: fadeUp 0.5s ease forwards;
    opacity: 0;
}

/* ─── Layout ──────────────────────────────────────────── */
.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 32px;
}

@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }
}

.main-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 48px;
    margin: 48px 0;
}

@media (max-width: 960px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .sidebar {
        display: none;
    }
}

/* ─── Header ──────────────────────────────────────────── */
header {
    position: fixed;
    inset: 0 0 auto;
    height: 64px;
    background: rgba(8, 16, 30, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.logo img {
    height: 30px;
    border-radius: 6px;
}

.nav-links {
    display: flex;
    gap: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-links a:hover {
    color: var(--text);
}

@media (max-width: 640px) {
    .nav-links {
        gap: 14px;
        font-size: 0.82rem;
    }
}

/* ─── Sticky Header (Post Pages) ─────────────────────── */
.sticky-header {
    position: fixed;
    top: -72px;
    left: 0;
    width: 100%;
    height: 64px;
    background: rgba(8, 16, 30, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    z-index: 1100;
    display: flex;
    align-items: center;
    transition: top 0.25s ease;
}

.sticky-header.visible {
    top: 0;
}

.sticky-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 32px;
    gap: 16px;
}

.sticky-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.sticky-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .sticky-title {
        font-size: 0.85rem;
    }

    .sticky-nav {
        display: none;
    }
}

/* ─── Progress Bar ────────────────────────────────────── */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    z-index: 9999;
    background: transparent;
}

.progress-bar {
    height: 2px;
    width: 0%;
    background: linear-gradient(to right, var(--accent-purple), var(--accent));
    transition: width 0.1s linear;
}

/* ─── Hero (Blog Index) ───────────────────────────────── */
.hero {
    padding: 56px 0 40px;
    text-align: center;
}

/* Inner wrapper used by index.html */
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Content area: wraps filter tabs + post list */
.content-area {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hero-tag {
    display: inline-block;
    background: rgba(59, 130, 246, 0.12);
    color: var(--link);
    border: 1px solid rgba(59, 130, 246, 0.25);
    padding: 4px 14px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 18px;
}

.hero h1 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: clamp(2rem, 6vw, 3.2rem);
    line-height: 1.12;
    color: var(--text);
    margin-bottom: 16px;
    font-weight: 400;
}

.hero p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto;
}

@media (max-width: 640px) {
    .hero {
        padding: 36px 0 24px;
    }
}

/* ─── Featured Section ────────────────────────────────── */
.featured-post {
    grid-column: 1 / -1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px 40px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.featured-post .date {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.featured-post h2 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: clamp(1.4rem, 4vw, 2rem);
    color: var(--text);
    font-weight: 400;
    line-height: 1.2;
}

.featured-post .excerpt {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 600px;
    line-height: 1.65;
}

.featured-image {
    display: none;
}

.featured-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

@media (max-width: 640px) {
    .featured-post {
        padding: 24px;
    }
}

/* ─── Filter Tabs ─────────────────────────────────────── */
.filter-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filter-tab {
    padding: 5px 14px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.filter-tab:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.filter-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.post-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ─── Post List ───────────────────────────────────────── */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ─── Post Cards ──────────────────────────────────────── */
.post-card {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: var(--transition);
    position: relative;
}

.post-card:hover {
    background: var(--surface);
    border-color: var(--border);
}

.post-card .date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.post-card h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
}

.post-card:hover h3 {
    color: #fff;
}

.post-card .excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 4px;
    transition: var(--transition);
}

.read-more::after {
    content: '→';
    display: inline-block;
    transition: transform 0.2s ease;
}

.post-card:hover .read-more {
    color: var(--link);
}

.post-card:hover .read-more::after {
    transform: translateX(4px);
}

@media (max-width: 640px) {
    .post-card {
        padding: 16px;
    }
}

/* ─── Category Badges ─────────────────────────────────── */
.category-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid;
    width: fit-content;
}

.category-badge.purple {
    background: rgba(124, 58, 237, 0.1);
    color: #a78bfa;
    border-color: rgba(124, 58, 237, 0.2);
}

.category-badge.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.2);
}

.category-badge.green {
    background: rgba(52, 211, 153, 0.1);
    color: #6ee7b7;
    border-color: rgba(52, 211, 153, 0.2);
}

.category-badge.gold {
    background: rgba(251, 191, 36, 0.1);
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.2);
}

.category-badge.orange {
    background: rgba(251, 146, 60, 0.1);
    color: #fdba74;
    border-color: rgba(251, 146, 60, 0.2);
}

.category-badge.teal {
    background: rgba(20, 184, 166, 0.1);
    color: #5eead4;
    border-color: rgba(20, 184, 166, 0.2);
}

/* ─── Sidebar ─────────────────────────────────────────── */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.widget h4 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.widget-content {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ─── Newsletter Widget ───────────────────────────────── */
.newsletter-widget {
    background: rgba(59, 130, 246, 0.06);
    border-color: rgba(59, 130, 246, 0.2);
}

.newsletter-widget h4 {
    color: var(--link);
}

.newsletter-widget p {
    color: var(--text-secondary);
    margin-bottom: 14px;
    font-size: 0.9rem;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.newsletter-form input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.newsletter-form input::placeholder {
    color: var(--text-muted);
}

.newsletter-form button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 9px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
    font-family: inherit;
}

.newsletter-form button:hover {
    background: #2563eb;
}

.newsletter-success {
    text-align: center;
    color: var(--green);
    font-weight: 600;
    font-size: 0.9rem;
    padding-top: 6px;
}

.hidden {
    display: none !important;
}

/* ─── Mobile Newsletter ───────────────────────────────── */
.mobile-newsletter {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-top: 32px;
}

.mobile-newsletter h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.mobile-newsletter p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

@media (max-width: 960px) {
    .mobile-newsletter {
        display: block;
    }
}

/* ─── Blog Post (Individual) ──────────────────────────── */
.post-detail-container {
    max-width: 720px;
    margin: 56px auto;
    padding: 0 16px;
}

.post-header {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.post-header h1 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: clamp(1.8rem, 6vw, 2.8rem);
    line-height: 1.15;
    color: var(--text);
    font-weight: 400;
    margin: 16px 0 20px;
}

.post-meta-line {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* ─── Hero Image (Post) ───────────────────────────────── */
.hero-image-container {
    margin: 0 0 40px;
    border-radius: 12px;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

/* ─── Content Body ────────────────────────────────────── */
.content-body {
    font-size: 1.05rem;
    color: #c8d8ec;
    line-height: 1.82;
}

.content-body h2 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: clamp(1.4rem, 4vw, 1.9rem);
    margin: 48px 0 16px;
    color: var(--text);
    font-weight: 400;
    line-height: 1.2;
}

.content-body h3 {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    margin: 32px 0 12px;
    color: var(--text);
    font-weight: 600;
}

.content-body p {
    margin-bottom: 22px;
}

.content-body strong {
    color: var(--text);
    font-weight: 600;
}

.content-body em {
    color: var(--text-secondary);
}

.content-body ul,
.content-body ol {
    padding-left: 20px;
    margin-bottom: 22px;
}

.content-body li {
    margin-bottom: 6px;
    line-height: 1.7;
}

.content-body a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-color: rgba(96, 165, 250, 0.3);
    text-underline-offset: 3px;
}

.content-body a:hover {
    color: #93c5fd;
}

/* ─── Info Box / Snapshot ─────────────────────────────── */
.snapshot,
.content-body .snapshot {
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 10px;
    padding: 20px 24px;
    margin: 28px 0;
    background-color: transparent !important;
}

.content-body div[style*="border:1px solid"],
.content-body div[style*="border: 1px solid"] {
    background: rgba(59, 130, 246, 0.06) !important;
    border: 1px solid rgba(59, 130, 246, 0.15) !important;
    border-radius: 10px;
    padding: 20px 24px;
    margin: 28px 0;
}

.content-body div[style*="border:1px solid"] ul,
.content-body div[style*="border: 1px solid"] ul {
    list-style: none;
    padding: 0;
}

.content-body div[style*="border:1px solid"] li,
.content-body div[style*="border: 1px solid"] li {
    padding: 4px 0;
    border: none;
    color: var(--text);
    background: none;
}

/* ─── Takeaways / Insight Cards ───────────────────────── */
.takeaways-card {
    background: rgba(124, 58, 237, 0.06);
    border: 1px solid rgba(124, 58, 237, 0.18);
    border-radius: 10px;
    padding: 24px;
    margin: 32px 0;
}

.takeaways-card h4 {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #a78bfa;
    margin-bottom: 14px;
    font-weight: 700;
}

.takeaways-card ul {
    list-style: none;
}

.takeaways-card li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    font-size: 1rem;
    color: var(--text);
    line-height: 1.6;
}

.takeaways-card li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-purple);
    font-size: 0.8rem;
    top: 2px;
}

/* ─── Insight Quote Card ───────────────────────────────── */
.insight-card {
    border-left: 3px solid var(--accent);
    background: rgba(59, 130, 246, 0.05);
    padding: 18px 24px;
    margin: 32px 0;
    font-style: italic;
    color: var(--text-secondary);
    border-radius: 0 8px 8px 0;
    font-size: 1.02rem;
    line-height: 1.75;
}

/* ─── Comparison Table ────────────────────────────────── */
.comparison-table-wrapper {
    overflow-x: auto;
    margin: 32px 0;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.comparison-table thead {
    background: var(--surface);
}

.comparison-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.comparison-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
    line-height: 1.4;
}

.comparison-table td:first-child {
    color: var(--link);
    font-weight: 500;
}

.comparison-table tbody tr:hover {
    background: var(--surface);
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

/* ─── Breadcrumb ───────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb a:hover {
    color: var(--link);
}

.breadcrumb span {
    color: var(--text-muted);
}

.breadcrumb .bc-title {
    color: var(--text-secondary);
}

.breadcrumb .bc-cat {
    color: var(--text-secondary);
}

/* ─── ToC Widget ───────────────────────────────────────── */
#toc-widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 24px;
    margin: 40px 0;
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.toc-header span {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
}

.toc-toggle {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
}

.toc-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.toc-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toc-list li {
    font-size: 0.9rem;
    padding-left: 14px;
    border-left: 2px solid transparent;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.toc-list li:has(a.toc-active) {
    border-left-color: var(--accent);
}

.toc-list a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.toc-list a:hover,
.toc-list a.toc-active {
    color: var(--text);
}

/* ─── Back to Top ──────────────────────────────────────── */
#back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 44px;
    height: 44px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.3s ease;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

@media (max-width: 640px) {
    #back-to-top {
        bottom: 20px;
        right: 16px;
    }
}

/* ─── Ad Containers ────────────────────────────────────── */
.ad-container {
    margin: 20px auto;
    padding: 10px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    text-align: center;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ad-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

/* ─── Metadata / Status Badges ─────────────────────────── */
.metadata-badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.78rem;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

/* ─── Footer ───────────────────────────────────────────── */
footer {
    border-top: 1px solid var(--border);
    padding: 48px 0;
    margin-top: 80px;
    text-align: center;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 14px;
    color: var(--text);
}

.footer-logo img {
    height: 28px;
    border-radius: 5px;
}

footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
    max-width: 500px;
    margin: 0 auto 10px;
}

/* ─── Tag Cloud ────────────────────────────────────────── */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: var(--transition);
}

.tag:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
    color: var(--link);
}

/* ─── Gain Bar ─────────────────────────────────────────── */
.gain-bar-wrap {
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    max-width: 72px;
    margin-top: 4px;
}

.gain-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--green), var(--accent));
}

/* ─── Rank Number ──────────────────────────────────────── */
.rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    margin-right: 7px;
}

.rank-num.top3 {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.25);
}

/* --- Premium UI Overrides ------------------------------ */
:root {
    --glass-bg: rgba(15, 28, 48, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glow-shadow: 0 8px 32px 0 rgba(59, 130, 246, 0.15);
}

html {
    scroll-behavior: smooth;
}

/* Custom Webkit Scrollbar for Premium Feel */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Enhanced Post Cards */
.post-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.post-card:hover {
    background: rgba(15, 28, 48, 0.75);
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: var(--glow-shadow);
    transform: translateY(-6px);
}

/* Enhanced Title Gradient */
.post-header h1 {
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent; 
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.hero h1 {
    background: linear-gradient(135deg, #60a5fa 0%, #a855f7 50%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Insight Cards & Takeaways with Glowing Borders */
.takeaways-card, .insight-card {
    background: linear-gradient(145deg, rgba(124, 58, 237, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 20px rgba(124, 58, 237, 0.02);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.takeaways-card:hover, .insight-card:hover {
    border-color: rgba(124, 58, 237, 0.35);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.15);
}

/* Dynamic Links in Body */
.content-body a {
    text-decoration: none;
    background-image: linear-gradient(var(--link), var(--link));
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;
    transition: background-size 0.3s ease;
    padding-bottom: 2px;
}

.content-body a:hover {
    background-size: 100% 2px;
    color: #c4dafc;
}

/* Refined Badges with Subtle Glow */
.category-badge.green { box-shadow: 0 0 12px rgba(52, 211, 153, 0.2); }
.category-badge.purple { box-shadow: 0 0 12px rgba(124, 58, 237, 0.2); }
.category-badge.blue { box-shadow: 0 0 12px rgba(59, 130, 246, 0.2); }
.category-badge.orange { box-shadow: 0 0 12px rgba(251, 146, 60, 0.2); }
.category-badge.gold { box-shadow: 0 0 12px rgba(251, 191, 36, 0.2); }

/* Pulse animation on the Read More arrow */
@keyframes pulseArrow {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}
.post-card:hover .read-more::after {
    animation: pulseArrow 1.2s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar Widget Glow Enhancements */
.newsletter-widget {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(124, 58, 237, 0.08) 100%);
    border: 1px solid rgba(59, 130, 246, 0.25);
    box-shadow: 0 10px 30px -10px rgba(59, 130, 246, 0.2);
}

.newsletter-form button:hover {
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}


/* --- Header & Top Bar Fixes ---------------------------- */

/* Fix anchor jumps (like Table of Contents) hiding behind the fixed header */
html {
    scroll-padding-top: 80px; 
}

/* Make the title bar scrollable horizontally without visible scrollbars */
.sticky-header-inner {
    overflow-x: auto;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}
.sticky-header-inner::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Ensure the title text can breathe and naturally scroll */
.sticky-title {
    flex-shrink: 0;
    padding-right: 20px;
}

.sticky-nav {
    flex-shrink: 0;
}

/* On mobile, re-enable the navigation in the sticky header but strictly scrollable */
@media (max-width: 640px) {
    .sticky-nav {
        display: flex !important;
        gap: 12px;
        font-size: 0.8rem;
    }
}

/* Enable a smooth glass transition for the main header */
header {
    background: rgba(8, 16, 30, 0.75);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}



/* --- Remove Fixed Headers ------------------------------ */
/* The user requested headers to behave like normal text */
.sticky-header {
    display: none !important;
}

header {
    position: relative !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body {
    padding-top: 24px !important;
}



/* --- Header Placement Polish --------------------------- */
/* Fix the ugly gap by removing body padding and adding space below the header instead */
body {
    padding-top: 0 !important;
}
header {
    margin-bottom: 40px !important;
    width: 100% !important;
}



/* --- Overlap Fixes ---------------------------- */
header {
    height: auto !important;
    min-height: 64px;
    padding: 14px 0 !important;
}

.header-inner {
    height: auto !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 0 !important;
}

/* Ensure the main title text never overlaps line-to-line */
.post-header h1, .hero h1 {
    line-height: 1.4 !important;
    word-break: break-word;
}



/* --- Mermaid Custom Diagrams -------------------------- */
.mermaid {
    background: var(--glass-bg, rgba(15, 28, 48, 0.4));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    padding: 24px;
    margin: 32px 0;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: thin;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.mermaid svg {
    max-width: 100%;
}

