/* ============================
   BLOG PAGE STYLES
   ============================ */

/* Header */
.blog-header {
    padding: calc(var(--nav-height) + 4rem) 2rem 3rem;
    text-align: center;
    position: relative;
}

.blog-header-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 4px;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.blog-header-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    letter-spacing: 6px;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.blog-header-title .accent { color: var(--accent); }

.blog-header-sub {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    opacity: 0.7;
}

/* Filters */
.blog-filters {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 2px;
    padding: 0.5rem 1.2rem;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.filter-btn:hover,
.filter-btn.active {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.04);
}

/* Blog Section */
.blog-section {
    padding: 0 2rem 4rem;
}

.blog-container {
    max-width: clamp(900px, 85vw, 2000px);
    margin: 0 auto;
}

.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Loading */
.blog-loading {
    text-align: center;
    padding: 3rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================
   POST CARD
   ============================ */
.post-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    background: rgba(10, 14, 20, 0.6);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s ease;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 20px; height: 20px;
    border-top: 2px solid var(--accent);
    border-left: 2px solid var(--accent);
    pointer-events: none;
    z-index: 1;
}

.post-card::after {
    content: '';
    position: absolute;
    bottom: 0; right: 0;
    width: 20px; height: 20px;
    border-bottom: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
    pointer-events: none;
    z-index: 1;
}

.post-card:hover {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.02), inset 0 0 30px rgba(255, 255, 255, 0.01);
    transform: translateY(-2px);
}

/* Left: Content */
.post-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 1px;
}

.post-date {
    color: var(--text-secondary);
}

.post-threat {
    padding: 0.15rem 0.5rem;
    font-size: 0.5rem;
    letter-spacing: 2px;
    font-weight: 700;
}

.threat-LOW { background: rgba(255, 255, 255, 0.04); color: var(--status-green, #00cc33); border: 1px solid rgba(255, 255, 255, 0.06); }
.threat-MED { background: rgba(255, 165, 2, 0.1); color: #c9a227; border: 1px solid rgba(255, 165, 2, 0.2); }
.threat-HIGH { background: rgba(255, 71, 87, 0.1); color: #ff2d2d; border: 1px solid rgba(255, 71, 87, 0.2); }
.threat-CRITICAL { background: rgba(255, 0, 0, 0.15); color: #ff0040; border: 1px solid rgba(255, 0, 0, 0.3); animation: criticalPulse 2s ease infinite; }

@keyframes criticalPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.post-time {
    color: var(--accent);
    opacity: 0.5;
}

.post-card-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
    transition: color 0.3s;
}

.post-card:hover .post-card-title { color: var(--accent); }

.post-card-excerpt {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.post-card-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.post-tag {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    letter-spacing: 1px;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Right: Stat Bars */
.post-card-stats {
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.008);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 0.5rem;
}

.post-card-stats .stats-header {
    grid-column: 1 / -1;
    font-family: var(--font-mono);
    font-size: 0.5rem;
    letter-spacing: 2px;
    color: var(--text-secondary);
    text-align: center;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.25rem;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-row-label {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    letter-spacing: 1px;
    color: var(--text-secondary);
    width: 55px;
    flex-shrink: 0;
}

.stat-bar-container {
    flex: 1;
    display: flex;
    gap: 3px;
}

.stat-pip {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.5s ease;
}

.stat-pip.filled {
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent-glow);
    border-color: var(--accent);
}

.stat-pip.filled.warn {
    background: #c9a227;
    box-shadow: 0 0 6px rgba(255, 165, 2, 0.4);
    border-color: #c9a227;
}

.stat-pip.filled.danger {
    background: #ff2d2d;
    box-shadow: 0 0 6px rgba(255, 71, 87, 0.4);
    border-color: #ff2d2d;
}

.stat-bpm {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--accent);
    text-shadow: 0 0 6px var(--accent-glow);
    text-align: right;
}

.stat-bpm-label {
    font-size: 0.45rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.stat-coffee {
    font-size: 0.6rem;
    letter-spacing: 2px;
}

/* ============================
   SINGLE POST PAGE
   ============================ */
.post-page-header {
    padding: calc(var(--nav-height) + 3rem) 2rem 2rem;
    max-width: clamp(900px, 85vw, 2000px);
    margin: 0 auto;
}

.post-back {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: 2px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    transition: color 0.3s;
}

.post-back:hover { color: var(--accent); }

.post-page-layout {
    max-width: clamp(900px, 85vw, 2000px);
    margin: 0 auto;
    padding: 0 2rem 4rem;
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 2rem;
}

/* Post Content */
.post-body {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.9;
    color: var(--text-secondary);
}

.post-body h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 2px;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.post-body h2::before {
    content: '// ';
    color: var(--accent);
    opacity: 0.5;
}

.post-body p { margin-bottom: 1.2rem; }

.post-body strong { color: var(--text-primary); }

.post-body em { color: var(--accent); font-style: italic; opacity: 0.8; }

.post-body ul, .post-body ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.post-body li {
    margin-bottom: 0.5rem;
    position: relative;
}

.post-body ul li::marker { color: var(--accent); }

.post-body code {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    padding: 0.15rem 0.4rem;
    font-size: 0.8rem;
    color: var(--accent);
}

.post-body pre {
    background: rgba(6, 6, 8, 0.8);
    border: 1px solid var(--border);
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    position: relative;
}

.post-body pre::before {
    content: 'TERMINAL';
    position: absolute;
    top: 0; right: 0;
    font-family: var(--font-mono);
    font-size: 0.45rem;
    letter-spacing: 2px;
    color: var(--text-secondary);
    padding: 0.3rem 0.6rem;
    background: rgba(255, 255, 255, 0.015);
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.post-body pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent);
    font-size: 0.78rem;
    line-height: 1.6;
}

/* Stat Sidebar */
.post-stat-sidebar {
    position: sticky;
    top: calc(var(--nav-height) + 2rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-panel {
    border: 1px solid var(--border);
    background: rgba(10, 14, 20, 0.6);
    position: relative;
}

.sidebar-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 14px; height: 14px;
    border-top: 2px solid var(--accent);
    border-left: 2px solid var(--accent);
    pointer-events: none;
}

.sidebar-panel::after {
    content: '';
    position: absolute;
    bottom: 0; right: 0;
    width: 14px; height: 14px;
    border-bottom: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
    pointer-events: none;
}

.sidebar-header {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    letter-spacing: 3px;
    color: var(--text-secondary);
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.01);
}

.sidebar-body {
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.sidebar-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-stat-label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.sidebar-stat-bars {
    display: flex;
    gap: 3px;
}

.sidebar-pip {
    width: 16px;
    height: 10px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-pip.filled {
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent-glow);
    border-color: var(--accent);
}

.sidebar-bpm-display {
    text-align: center;
    padding: 0.5rem;
}

.sidebar-bpm-val {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent);
    text-shadow: 0 0 15px var(--accent-glow);
    line-height: 1;
}

.sidebar-bpm-unit {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    letter-spacing: 2px;
    color: var(--text-secondary);
    display: block;
    margin-top: 0.3rem;
}

.sidebar-meta-item {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.6rem;
}

.sidebar-meta-label { color: var(--text-secondary); letter-spacing: 1px; }
.sidebar-meta-value { color: var(--accent); }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
    .post-card {
        grid-template-columns: 1fr;
    }
    .post-card-stats {
        border-left: none;
        border-top: 1px solid var(--border);
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    .post-card-stats .stats-header {
        width: 100%;
    }
    .stat-row { min-width: 120px; }
    .post-page-layout {
        grid-template-columns: 1fr;
    }
    .post-stat-sidebar {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .sidebar-panel { flex: 1; min-width: 200px; }
}


/* Blog grid responsive */
@media (max-width: 1024px) {
    .blog-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .blog-posts-grid {
        grid-template-columns: 1fr;
    }
}
