/* Knowledge Hub — listing (index) page styles.
   Extracted from templates/blog/listing.html inline <style> in the Stage-2
   Knowledge Hub refactor. Loaded via that template's additional_head block.
   :root tokens kept as-is for visual parity. */

    :root {
        --color-bg-deep: #060b14;
        --color-bg: #0a1220;
        --color-bg-elevated: #0f1a2e;
        --color-surface: rgba(15, 26, 46, 0.6);
        --color-surface-solid: #121d30;
        --color-border: rgba(0, 242, 254, 0.1);
        --color-border-hover: rgba(0, 242, 254, 0.3);
        --color-text: #ffffff;
        --color-text-secondary: rgba(255, 255, 255, 0.7);
        --color-text-muted: rgba(255, 255, 255, 0.65);
        --color-cyan: #00f2fe;
        --color-cyan-dim: rgba(0, 242, 254, 0.6);
        --color-purple: #7b5cff;
        --color-magenta: #c471ed;
        --color-orange: #ff6b35;
        --font-display: 'Syne', sans-serif;
        --font-body: 'Space Grotesk', sans-serif;
        --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
        --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    * {
        box-sizing: border-box;
    }

    /* ===== COSMIC BACKGROUND ===== */
    .blog-wrapper {
        position: relative;
        min-height: 100vh;
        overflow: hidden;
    }

    .cosmic-bg {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        pointer-events: none;
        z-index: 0;
    }

    .cosmic-bg::before {
        content: '';
        position: absolute;
        top: -30%;
        right: -20%;
        width: 80%;
        height: 80%;
        background: radial-gradient(ellipse at center, 
            rgba(123, 92, 255, 0.15) 0%, 
            rgba(196, 113, 237, 0.08) 30%,
            transparent 70%);
        filter: blur(80px);
        animation: nebula-drift 20s ease-in-out infinite alternate;
    }

    .cosmic-bg::after {
        content: '';
        position: absolute;
        bottom: -20%;
        left: -10%;
        width: 60%;
        height: 60%;
        background: radial-gradient(ellipse at center, 
            rgba(0, 242, 254, 0.1) 0%, 
            transparent 60%);
        filter: blur(60px);
        animation: nebula-drift 15s ease-in-out infinite alternate-reverse;
    }

    @keyframes nebula-drift {
        0% { transform: translate(0, 0) scale(1); }
        100% { transform: translate(30px, -20px) scale(1.1); }
    }

    /* Floating orbs */
    .orb {
        position: absolute;
        border-radius: 50%;
        filter: blur(1px);
        animation: float-orb 8s ease-in-out infinite;
    }

    .orb-1 {
        width: 4px;
        height: 4px;
        background: var(--color-cyan);
        top: 20%;
        left: 15%;
        animation-delay: 0s;
    }

    .orb-2 {
        width: 3px;
        height: 3px;
        background: var(--color-magenta);
        top: 40%;
        right: 20%;
        animation-delay: -2s;
    }

    .orb-3 {
        width: 5px;
        height: 5px;
        background: var(--color-purple);
        bottom: 30%;
        left: 25%;
        animation-delay: -4s;
    }

    .orb-4 {
        width: 2px;
        height: 2px;
        background: var(--color-cyan);
        top: 60%;
        right: 35%;
        animation-delay: -1s;
    }

    @keyframes float-orb {
        0%, 100% { transform: translateY(0) scale(1); opacity: 0.6; }
        50% { transform: translateY(-20px) scale(1.2); opacity: 1; }
    }

    /* ===== MAIN CONTAINER ===== */
    .blog-container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 100px 48px 80px;
        position: relative;
        z-index: 1;
    }

    /* ===== HERO HEADER ===== */
    .blog-hero {
        text-align: center;
        margin-bottom: 80px;
        position: relative;
    }

    .blog-hero::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 600px;
        height: 400px;
        background: radial-gradient(ellipse at center, 
            rgba(0, 242, 254, 0.08) 0%, 
            transparent 50%);
        pointer-events: none;
    }

    .hero-badge {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        padding: 10px 24px;
        background: linear-gradient(135deg, rgba(0, 242, 254, 0.1) 0%, rgba(123, 92, 255, 0.1) 100%);
        border: 1px solid var(--color-border);
        border-radius: 50px;
        margin-bottom: 32px;
        backdrop-filter: blur(10px);
    }

    .hero-badge-dot {
        width: 8px;
        height: 8px;
        background: var(--color-cyan);
        border-radius: 50%;
        animation: pulse-dot 2s ease-in-out infinite;
    }

    @keyframes pulse-dot {
        0%, 100% { opacity: 1; transform: scale(1); }
        50% { opacity: 0.5; transform: scale(0.8); }
    }

    .hero-badge-text {
        font-family: var(--font-body);
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--color-cyan);
        letter-spacing: 0.1em;
        text-transform: uppercase;
    }

    .blog-hero h1 {
        font-family: var(--font-display);
        font-size: clamp(3rem, 8vw, 5.5rem);
        font-weight: 800;
        color: var(--color-text);
        line-height: 1.05;
        margin: 0 0 24px;
        letter-spacing: -0.03em;
        position: relative;
    }

    .blog-hero h1 span {
        background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-purple) 50%, var(--color-magenta) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

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

    /* ===== FILTER BAR ===== */
    .filter-section {
        margin-bottom: 60px;
    }

    .filter-bar {
        display: flex;
        gap: 12px;
        justify-content: center;
        flex-wrap: wrap;
        padding: 20px;
        background: var(--color-surface);
        backdrop-filter: blur(20px);
        border-radius: 100px;
        border: 1px solid var(--color-border);
        max-width: 900px;
        margin: 0 auto;
    }

    .filter-btn {
        font-family: var(--font-body);
        padding: 12px 24px;
        background: transparent;
        color: var(--color-text-secondary);
        border-radius: 50px;
        text-decoration: none;
        transition: all 0.4s var(--ease-out-expo);
        font-weight: 500;
        font-size: 0.9rem;
        border: 1px solid transparent;
        position: relative;
        overflow: hidden;
    }

    .filter-btn::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
        opacity: 0;
        transition: opacity 0.4s ease;
        border-radius: 50px;
        z-index: -1;
    }

    .filter-btn:hover {
        color: var(--color-text);
        border-color: var(--color-border-hover);
        background: rgba(0, 242, 254, 0.05);
    }

    .filter-btn.active {
        color: var(--color-bg-deep);
        font-weight: 600;
        border-color: transparent;
    }

    .filter-btn.active::before {
        opacity: 1;
    }

    /* ===== POSTS GRID ===== */
    .posts-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
        gap: 28px;
        margin-bottom: 80px;
    }

    /* ===== POST CARD - THE STAR ===== */
    .post-card {
        position: relative;
        background: var(--color-surface);
        backdrop-filter: blur(20px);
        border-radius: 24px;
        padding: 36px;
        text-decoration: none;
        display: flex;
        flex-direction: column;
        border: 1px solid var(--color-border);
        transition: all 0.5s var(--ease-out-expo);
        overflow: hidden;
        cursor: pointer;
    }

    /* Animated gradient border */
    .post-card::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 24px;
        padding: 1px;
        background: linear-gradient(135deg, 
            var(--color-cyan) 0%, 
            var(--color-purple) 50%, 
            var(--color-magenta) 100%);
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        opacity: 0;
        transition: opacity 0.5s ease;
    }

    /* Glow effect */
    .post-card::after {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle at center, 
            rgba(0, 242, 254, 0.15) 0%, 
            transparent 40%);
        opacity: 0;
        transition: opacity 0.5s ease;
        pointer-events: none;
    }

    .post-card:hover {
        transform: translateY(-8px);
        border-color: transparent;
        box-shadow: 
            0 30px 60px -20px rgba(0, 0, 0, 0.5),
            0 0 40px rgba(0, 242, 254, 0.1);
    }

    .post-card:hover::before {
        opacity: 1;
    }

    .post-card:hover::after {
        opacity: 1;
    }

    .post-card-inner {
        position: relative;
        z-index: 1;
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    /* Card Header */
    .post-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 24px;
    }

    .post-category {
        font-family: var(--font-body);
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 16px;
        background: linear-gradient(135deg, rgba(0, 242, 254, 0.15) 0%, rgba(123, 92, 255, 0.15) 100%);
        border: 1px solid rgba(0, 242, 254, 0.2);
        border-radius: 50px;
        font-weight: 600;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--color-cyan);
    }

    .post-number {
        font-family: var(--font-display);
        font-size: 3rem;
        font-weight: 800;
        color: rgba(255, 255, 255, 0.03);
        line-height: 1;
    }

    /* Meta */
    .post-meta {
        display: flex;
        gap: 20px;
        margin-bottom: 20px;
    }

    .post-meta-item {
        font-family: var(--font-body);
        color: var(--color-text-muted);
        font-size: 0.8rem;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .post-meta-item i {
        color: var(--color-cyan-dim);
        font-size: 0.75rem;
    }

    /* Title */
    .post-card h2 {
        font-family: var(--font-display);
        color: var(--color-text);
        font-size: 1.6rem;
        margin: 0 0 16px;
        line-height: 1.3;
        font-weight: 700;
        transition: all 0.4s var(--ease-out-expo);
    }

    .post-card:hover h2 {
        background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-magenta) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    /* Excerpt */
    .post-excerpt {
        font-family: var(--font-body);
        color: var(--color-text-secondary);
        line-height: 1.75;
        margin: 0 0 28px;
        font-size: 0.95rem;
        flex-grow: 1;
    }

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

    .post-author {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .author-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--color-orange) 0%, #ff9b7a 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: var(--font-display);
        font-weight: 700;
        color: white;
        font-size: 0.9rem;
        box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    }

    .author-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .author-name {
        font-family: var(--font-body);
        color: var(--color-text);
        font-size: 0.875rem;
        font-weight: 600;
    }

    .author-role {
        font-family: var(--font-body);
        color: var(--color-text-muted);
        font-size: 0.75rem;
    }

    /* Read Button */
    .read-btn {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 24px;
        background: transparent;
        border: 1px solid var(--color-border);
        border-radius: 50px;
        color: var(--color-cyan);
        font-family: var(--font-body);
        font-weight: 600;
        font-size: 0.85rem;
        transition: all 0.4s var(--ease-out-expo);
    }

    .read-btn i {
        transition: transform 0.4s var(--ease-spring);
    }

    .post-card:hover .read-btn {
        background: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
        border-color: transparent;
        color: var(--color-bg-deep);
        box-shadow: 0 8px 24px rgba(0, 242, 254, 0.3);
    }

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

    /* ===== PAGINATION ===== */
    .pagination {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 12px;
        margin-top: 60px;
    }

    .pagination a,
    .pagination span {
        font-family: var(--font-body);
        padding: 14px 24px;
        background: var(--color-surface);
        backdrop-filter: blur(10px);
        border: 1px solid var(--color-border);
        border-radius: 12px;
        color: var(--color-text-secondary);
        text-decoration: none;
        transition: all 0.4s var(--ease-out-expo);
        font-weight: 500;
        font-size: 0.9rem;
    }

    .pagination a:hover {
        background: rgba(0, 242, 254, 0.1);
        border-color: var(--color-border-hover);
        color: var(--color-cyan);
    }

    .pagination .active {
        background: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
        color: var(--color-bg-deep);
        border-color: transparent;
        font-weight: 600;
    }

    .pagination .disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }

    /* ===== EMPTY STATE ===== */
    .empty-state {
        text-align: center;
        padding: 120px 40px;
        background: var(--color-surface);
        backdrop-filter: blur(20px);
        border-radius: 32px;
        border: 1px solid var(--color-border);
    }

    .empty-state-icon {
        width: 80px;
        height: 80px;
        background: linear-gradient(135deg, rgba(0, 242, 254, 0.1), rgba(123, 92, 255, 0.1));
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 24px;
    }

    .empty-state-icon i {
        font-size: 2rem;
        color: var(--color-cyan);
    }

    .empty-state h2 {
        font-family: var(--font-display);
        color: var(--color-text);
        margin-bottom: 12px;
        font-size: 1.75rem;
        font-weight: 700;
    }

    .empty-state p {
        font-family: var(--font-body);
        color: var(--color-text-muted);
        font-size: 1rem;
    }

    /* ===== RESPONSIVE ===== */
    @media (max-width: 1024px) {
        .blog-container {
            padding: 80px 24px 60px;
        }
        
        .posts-grid {
            grid-template-columns: 1fr;
            gap: 24px;
        }

        .filter-bar {
            border-radius: 20px;
            padding: 16px;
        }
    }

    @media (max-width: 640px) {
        .blog-hero h1 {
            font-size: 2.5rem;
        }
        
        .filter-bar {
            flex-direction: column;
            gap: 8px;
        }
        
        .filter-btn {
            width: 100%;
            text-align: center;
        }
        
        .post-card {
            padding: 28px;
        }
        
        .post-card h2 {
            font-size: 1.35rem;
        }

        .post-header {
            flex-direction: column;
            gap: 16px;
        }

        .post-number {
            display: none;
        }
    }
