/* Ultra Blog Design System v9.1 - Spacing Fixes */
:root {
    --bg-dark: #020c1b;
    /* Restored transparency for Glassmorphism */
    --bg-card: rgba(17, 34, 64, 0.6); 
    --bg-card-hover: rgba(23, 42, 69, 0.8);
    --accent-primary: #64ffda;
    --accent-secondary: #00b4d8;
    --accent-alert: #ff6b6b;
    --text-main: #e6f1ff;
    --text-muted: #a8b2d1;
    
    --border-light: rgba(100, 255, 218, 0.15);
    --border-glow: rgba(100, 255, 218, 0.5);
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 30px rgba(100, 255, 218, 0.15);
    
    --font-heading: 'Inter', system-ui, sans-serif;
    --font-mono: 'Fira Code', monospace;
}

body.blog-ultra-page {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-heading);
    margin: 0;
    overflow-x: hidden;
}

/* === Background FX === */
.bg-noise { position: fixed; inset: 0; z-index: -10; opacity: 0.07; background: url('/images/patterns/dots-pattern.svg'); pointer-events: none; }
.bg-scanline { position: fixed; inset: 0; z-index: 900; opacity: 0.12; background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.3) 50%); background-size: 100% 4px; pointer-events: none; }
.bg-grid { position: fixed; z-index: -9; opacity: 0.25; width: 200%; height: 200%; transform: perspective(500px) rotateX(60deg); pointer-events: none; background-image: linear-gradient(rgba(100, 255, 218, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(100, 255, 218, 0.05) 1px, transparent 1px); background-size: 60px 60px; }
.reading-progress { z-index: 1002; position: fixed; top: 0; left: 0; height: 4px; background: var(--accent-primary); width: 0%; box-shadow: 0 0 15px var(--accent-primary); }

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 5;
}

/* === Hero Section === */
.blog-hero {
    padding: 160px 0 100px;
    position: relative;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: clamp(3rem, 5vw, 4.8rem);
    font-weight: 800;
    letter-spacing: -1px;
    margin: 0 0 1.5rem;
    line-height: 1.1;
    background: linear-gradient(135deg, #fff 0%, #8892b0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-lead {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

/* === Hero Visual (Glass Stack) === */
.glass-stack {
    background: linear-gradient(145deg, rgba(17, 34, 64, 0.6), rgba(2, 12, 27, 0.8));
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: perspective(1000px) rotateY(-5deg) rotateX(3deg);
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.3s;
}

.glass-stack:hover {
    transform: perspective(1000px) rotateY(0) rotateX(0);
    box-shadow: var(--shadow-glow);
    border-color: var(--accent-primary);
}

.glass-stack::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0.5;
}

/* === Featured Card === */
.featured-section { padding: 2rem 0 6rem; }

.featured-card {
    position: relative;
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    overflow: hidden;
    min-height: 500px;
    display: flex;
    align-items: flex-end;
    border: 1px solid var(--border-light);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.featured-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, #020c1b 0%, rgba(2,12,27,0.9) 40%, transparent 100%);
}

.featured-content {
    position: relative;
    z-index: 2;
    padding: 3rem;
    width: 100%;
}

/* === Article Hero Box (Single Post) === */
.article-hero {
    padding: 180px 0 60px;
    position: relative;
}

.article-hero-box {
    background: linear-gradient(160deg, rgba(17, 34, 64, 0.6), rgba(2, 12, 27, 0.8));
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 4rem;
    position: relative;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    overflow: hidden;
}

.article-hero-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

/* === Filtering Section (New) === */
.filters-section {
    padding-bottom: 2rem; /* Added breathing room */
}

/* === Grids === */
.insights-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

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

.article-grid {
    display: grid;
    grid-template-columns: 2.4fr 1fr;
    gap: 4rem;
    padding-bottom: 6rem;
    align-items: start;
}

/* === Insight Cards (Restored Glass) === */
.insight-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    backdrop-filter: blur(12px); /* RESTORED BLUR */
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.insight-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    background: var(--bg-card-hover);
}

.insight-card h3 a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.4rem;
    line-height: 1.3;
    display: block;
    margin: 1rem 0;
    transition: color 0.2s;
}

.insight-card h3 a:hover { color: var(--accent-primary); }

/* === Sidebar === */
.article-rail, .insights-rail {
    position: sticky;
    top: 120px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.rail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

.rail-card-featured {
    background: linear-gradient(145deg, rgba(17,34,64,0.8), rgba(100,255,218,0.05));
    border: 1px solid rgba(100,255,218,0.2);
}

/* ... rest of styles (typography, buttons, blocks) ... */
.author { display: flex; align-items: center; gap: 12px; }
.author img { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--border-light); }
.author-name { display: block; font-weight: 700; color: var(--text-main); }
.author-title { display: block; font-size: 0.85rem; color: var(--text-muted); }
.meta-right { margin-left: auto; display: flex; gap: 2rem; color: var(--text-muted); font-family: var(--font-mono); font-size: 0.9rem; }

.action-signals { background: linear-gradient(160deg, rgba(17,34,64,0.95), rgba(0,180,216,0.08)); border-color: var(--accent-primary); }
.rail-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.signal-item { display: flex; gap: 12px; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.signal-item:last-child { border-bottom: none; margin-bottom: 0; }
.good-icon { color: var(--accent-primary); margin-top: 4px; }
.bad-icon { color: var(--accent-alert); margin-top: 4px; }
.author-avatar-lg { width: 80px; height: 80px; border-radius: 50%; border: 2px solid var(--accent-primary); margin-bottom: 1rem; box-shadow: 0 0 20px rgba(100,255,218,0.2); }
.author-role { color: var(--accent-secondary); font-family: var(--font-mono); font-size: 0.85rem; margin-top: 0.5rem; }
.center-text { text-align: center; }
.full-width { width: 100%; box-sizing: border-box; }

.article-body { font-size: 1.15rem; line-height: 1.8; color: var(--text-muted); }
.article-body h2 { font-size: 2.2rem; color: var(--text-main); margin: 3.5rem 0 1.5rem; border-bottom: 1px solid var(--border-light); padding-bottom: 0.5rem; }
.article-body h3 { font-size: 1.5rem; color: var(--accent-primary); margin: 2.5rem 0 1rem; }
.callout { padding: 2rem; border-radius: 12px; margin: 2.5rem 0; }
.glow-box { background: rgba(100, 255, 218, 0.03); border: 1px solid var(--accent-primary); box-shadow: 0 0 30px rgba(100, 255, 218, 0.05); }
.case-study { background: linear-gradient(145deg, rgba(2,12,27,0.8), rgba(17,34,64,0.6)); border: 1px solid var(--border-light); }
.case-study-title { color: var(--accent-secondary); font-family: var(--font-mono); margin-top: 0; }
.dual-block { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin: 3rem 0; }
.block-bad, .block-good { padding: 2rem; border-radius: 16px; }
.block-bad { background: rgba(255, 107, 107, 0.04); border: 1px solid rgba(255, 107, 107, 0.2); }
.block-good { background: rgba(100, 255, 218, 0.04); border: 1px solid rgba(100, 255, 218, 0.2); }
.block-title { font-family: var(--font-mono); margin-top: 0; font-size: 1rem; display: flex; align-items: center; gap: 10px; }
.block-title.bad { color: var(--accent-alert); }
.block-title.good { color: var(--accent-primary); }
.dual-block ul { list-style: none; padding: 0; margin: 0; }
.dual-block li { display: flex; align-items: center; gap: 10px; margin-bottom: 0.8rem; font-size: 0.95rem; }
.dual-block li i { font-size: 0.8rem; opacity: 0.7; }
.block-bad li i { color: var(--accent-alert); }
.block-good li i { color: var(--accent-primary); }

.mono-label { font-family: var(--font-mono); color: var(--accent-primary); font-size: 0.75rem; letter-spacing: 1px; text-transform: uppercase; background: rgba(100, 255, 218, 0.08); padding: 6px 10px; border-radius: 4px; border: 1px solid transparent; display: inline-block; margin-bottom: 1rem; }
.filter-chip { background: var(--bg-card); border: 1px solid var(--border-light); color: var(--text-muted); padding: 8px 16px; border-radius: 20px; cursor: pointer; font-family: var(--font-mono); font-size: 0.85rem; transition: all 0.2s; }
.filter-chip:hover, .filter-chip.active { background: rgba(100, 255, 218, 0.1); border-color: var(--accent-primary); color: var(--accent-primary); box-shadow: 0 0 15px rgba(100, 255, 218, 0.1); }
.article-cta { margin-top: 6rem; padding: 3rem; background: linear-gradient(135deg, rgba(17, 34, 64, 0.5), rgba(0, 180, 216, 0.05)); border: 1px solid var(--border-light); border-radius: 20px; text-align: center; }
.article-cta h2 { font-size: 2.5rem; margin: 0 0 1rem; border: none; }
.article-cta p { font-size: 1.2rem; max-width: 700px; margin: 0 auto 2rem; }

.ultra-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.8rem 1.5rem; border-radius: 6px; font-family: var(--font-mono); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; transition: all 0.2s ease; text-decoration: none; font-size: 0.9rem; }
.ultra-btn-primary { border: 1px solid var(--accent-primary); color: var(--accent-primary); background: transparent; }
.ultra-btn-primary:hover { background: rgba(100, 255, 218, 0.1); box-shadow: 0 0 20px rgba(100, 255, 218, 0.2); transform: translateY(-2px); }
.ultra-btn-ghost { border: 1px solid var(--border-light); color: var(--text-muted); }
.ultra-btn-ghost:hover { border-color: var(--text-main); color: var(--text-main); }

@media (max-width: 992px) {
    .hero-grid, .insights-grid, .article-grid, .dual-block { grid-template-columns: 1fr; gap: 3rem; }
    .article-hero-box { padding: 2rem; }
    .hero-title { font-size: 3rem; }
    .article-meta { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .meta-right { margin-left: 0; }
    .article-rail { position: relative; top: 0; order: 2; }
}
