/* ═══════════════════════════════════════════════════════════
   Blog Theme — Shared styles for all blog pages
   ═══════════════════════════════════════════════════════════ */

/* ═══════════ CSS VARIABLES ═══════════ */
:root {
    --blog-bg: #050507;
    --blog-bg2: #0a0a0f;
    --blog-bg3: #0f0f18;
    --blog-surface: #12121e;
    --blog-surface2: #181828;
    --blog-border: #1e1e32;
    --blog-border2: #2a2a44;
    --blog-text: #e4e4f0;
    --blog-text2: #b0b0cc;
    --blog-text3: #6e6e8c;
    --blog-sol: #9945FF;
    --blog-sol2: #7b32d9;
    --blog-green: #14F195;
    --blog-green2: #0bc47a;
    --blog-cyan: #00D4FF;
    --blog-rust: #F74C00;
    --blog-yellow: #FFCF36;
    --blog-red: #FF4466;
    --blog-gradient: linear-gradient(135deg, #9945FF, #14F195);
    --blog-gradient2: linear-gradient(135deg, #14F195, #00D4FF);
    --blog-gradient3: linear-gradient(135deg, #9945FF, #00D4FF);
    --blog-glow-sol: 0 0 60px rgba(153,69,255,0.15);
    --blog-glow-green: 0 0 60px rgba(20,241,149,0.1);
}

/* ═══════════ BASE RESET ═══════════ */
.blog-page,
.blog-page * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.blog-page {
    font-family: 'Outfit', sans-serif;
    background: var(--blog-bg);
    color: var(--blog-text);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

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

/* ═══════════ TOP NAV ═══════════ */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(5,5,7,0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--blog-border);
    padding: 0 32px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-nav a {
    color: var(--blog-text2);
    text-decoration: none;
    font-size: 14px;
    transition: color .2s;
}

.top-nav a:hover {
    color: var(--blog-green);
}

.nav-logo {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 16px;
    font-weight: 600;
    color: var(--blog-text) !important;
}

.nav-logo .bracket {
    color: var(--blog-sol);
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-links a {
    font-size: 13px;
    letter-spacing: 0.5px;
}

.back-to-portfolio {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    background: var(--blog-surface);
    border: 1px solid var(--blog-border);
    color: var(--blog-text2) !important;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px !important;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}

.back-to-portfolio:hover {
    border-color: var(--blog-text3);
    color: var(--blog-text) !important;
}

.back-to-portfolio svg {
    transition: transform 0.2s ease;
}

.back-to-portfolio:hover svg {
    transform: translateX(-3px);
}

/* ═══════════ BLOG CONTAINER (for individual posts) ═══════════ */
.blog-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ═══════════ BLOG HEADER (list page) ═══════════ */
.blog-header {
    padding: 120px 0 40px;
    max-width: 680px;
    margin: 0 auto;
    padding-left: 32px;
    padding-right: 32px;
}

.blog-header h1 {
    font-family: 'Newsreader', serif;
    font-size: clamp(36px, 5vw, 52px);
    font-weight: 700;
    color: var(--blog-text);
    letter-spacing: -1px;
    line-height: 1.1;
    margin-bottom: 12px;
}

.blog-header p {
    font-size: 17px;
    color: var(--blog-text3);
    font-weight: 300;
}

/* ═══════════ CATEGORY FILTER ═══════════ */
.blog-filters {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 32px 40px;
}

.blog-filter-btn {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.3px;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid var(--blog-border);
    background: transparent;
    color: var(--blog-text3);
    cursor: pointer;
    transition: all .2s;
}

.blog-filter-btn:hover {
    border-color: var(--blog-border2);
    color: var(--blog-text2);
}

.blog-filter-btn.active {
    background: var(--blog-surface);
    border-color: var(--blog-border2);
    color: var(--blog-text);
}

/* ═══════════ BLOG LIST ═══════════ */
.blog-list-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 32px 80px;
}

.blog-list {
    list-style: none;
}

.blog-list-item {
    border-top: 1px solid var(--blog-border);
}

.blog-list-item:last-child {
    border-bottom: 1px solid var(--blog-border);
}

.blog-list-link {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
    padding: 28px 0;
    text-decoration: none;
    transition: all 0.15s ease;
}

.blog-list-link:hover {
    padding-left: 12px;
}

/* Main content: title + description */
.blog-list-main {
    flex: 1;
    min-width: 0;
}

.blog-list-main h2 {
    font-family: 'Newsreader', serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--blog-text);
    line-height: 1.35;
    margin-bottom: 6px;
    transition: color 0.15s ease;
}

.blog-list-link:hover .blog-list-main h2 {
    color: var(--blog-green);
}

.blog-list-main p {
    font-size: 14px;
    color: var(--blog-text3);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* External link icon */
.external-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-left: 6px;
    opacity: 0.35;
    stroke: var(--blog-text3);
    transition: opacity 0.15s;
}

.blog-list-link:hover .external-icon {
    opacity: 0.7;
}

/* Meta: date, read time, tags */
.blog-list-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
    padding-top: 4px;
}

.blog-list-date {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--blog-text3);
    white-space: nowrap;
}

.blog-list-read {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--blog-text3);
    opacity: 0.6;
    white-space: nowrap;
}

.blog-list-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.blog-list-tags span {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--blog-surface);
    color: var(--blog-text3);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Tag colors — official brand colors */
.tag-k8s {
    color: #326CE5 !important;
    background: rgba(50, 108, 229, 0.1) !important;
}

.tag-go {
    color: #00ADD8 !important;
    background: rgba(0, 173, 216, 0.1) !important;
}

.tag-rust {
    color: #F74C00 !important;
    background: rgba(247, 76, 0, 0.1) !important;
}

.tag-solana {
    color: #9945FF !important;
    background: rgba(153, 69, 255, 0.1) !important;
}

/* Platform tags */
.tag-medium {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.tag-blog {
    color: #14F195 !important;
    background: rgba(20, 241, 149, 0.1) !important;
}

/* ═══════════ BLOG HUB HERO (kept for backwards compat if needed) ═══════════ */
.blog-hub-hero {
    padding: 140px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.blog-hub-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 50% 40%, rgba(153,69,255,0.08), transparent),
        radial-gradient(ellipse 40% 30% at 30% 70%, rgba(20,241,149,0.04), transparent),
        radial-gradient(ellipse 40% 30% at 70% 60%, rgba(0,212,255,0.03), transparent);
    pointer-events: none;
}

.blog-hub-hero .hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(153,69,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(153,69,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black, transparent);
}

.blog-hub-hero .hero-content {
    position: relative;
    z-index: 1;
}

.blog-hero-tag {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--blog-green);
    margin-bottom: 24px;
    display: inline-block;
    padding: 6px 18px;
    border: 1px solid rgba(20,241,149,0.2);
    border-radius: 100px;
}

.blog-hub-hero h1 {
    font-family: 'Newsreader', serif;
    font-size: clamp(42px, 6vw, 72px);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -1.5px;
}

.blog-hub-hero h1 .grad {
    background: var(--blog-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.blog-hub-hero .hero-sub {
    font-size: clamp(16px, 2vw, 19px);
    color: var(--blog-text2);
    max-width: 560px;
    margin: 0 auto;
    font-weight: 300;
    line-height: 1.7;
}

/* ═══════════ FOOTER ═══════════ */
.blog-footer-section {
    border-top: 1px solid var(--blog-border);
    padding: 48px 32px;
    text-align: center;
    color: var(--blog-text3);
    font-size: 13px;
}

.blog-footer-section a {
    color: var(--blog-text3);
    text-decoration: none;
    transition: color .2s;
}

.blog-footer-section a:hover {
    color: var(--blog-text);
}

.blog-footer-section .footer-back {
    display: inline-block;
    margin-top: 16px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.5px;
    padding: 8px 20px;
    border: 1px solid var(--blog-border);
    border-radius: 6px;
    color: var(--blog-text3);
    text-decoration: none;
    transition: all .2s;
}

.blog-footer-section .footer-back:hover {
    border-color: var(--blog-border2);
    color: var(--blog-text2);
}

/* ═══════════ FADE-IN ANIMATION ═══════════ */
.blog-fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: all .5s cubic-bezier(.16,1,.3,1);
}

.blog-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 600px) {
    .blog-container,
    .blog-list-container {
        padding-left: 18px;
        padding-right: 18px;
    }

    .top-nav {
        padding: 0 18px;
    }

    .blog-header {
        padding: 100px 18px 32px;
    }

    .blog-filters {
        padding: 0 18px 32px;
    }

    .blog-list-link {
        flex-direction: column;
        gap: 12px;
    }

    .blog-list-meta {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .blog-list-tags {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .nav-links .hide-mobile {
        display: none;
    }
}
