/* Blog section */
/* Blog Section Container */
/* 1. Page Layout & Header */
#blog-page-header {
    padding: 100px 10% 40px; /* Reduced vertical padding */
    text-align: center;
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    border-bottom: 1px solid #e2e8f0;
    box-sizing: border-box;
    width: 100%;
}

#blog-page-header h1 {
    font-size: 2.2rem; /* Reduced from 2.8rem */
    color: #0f172a;
    margin-bottom: 8px;
    font-weight: 800;
}

#blog-page-header p {
    color: #64748b;
    font-size: 1rem; /* Reduced from 1.2rem */
}

/* 2. The Blog Feed Container */
.sr-blog-feed {
    padding: 40px 10%; /* Reduced padding */
    background-color: #f8fafc;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    max-width: 100%;
}

/* 3. The Clickable Heading Bar (Compact) */
.blog-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 15px 20px; /* Tighter padding */
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px; /* Tighter gap between items */
    z-index: 2;
    position: relative;
    box-sizing: border-box;
    max-width: 100%;
}

.blog-list-item:hover {
    border-color: #0ea5e9;
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.1);
}

.blog-list-item h3 {
    margin: 2px 0 0;
    color: #0f172a;
    font-size: 1.05rem; /* Smaller, cleaner title */
    font-weight: 700;
}

.post-date {
    font-size: 0.75rem; /* Smaller date */
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
}

/* 4. Expanding Content Panel */
.blog-content-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    max-width: 100%;
}

.blog-content-panel.active {
    max-height: 2500px;
    margin-bottom: 20px; /* Reduced margin */
}

/* 5. The Content Card */
.sr-blog-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-top: none; 
    border-radius: 0 0 12px 12px;
    padding: 25px; /* Tighter internal padding */
    margin-top: -15px; 
    box-shadow: 0 5px 10px -3px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    max-width: 100%;
    overflow-x: hidden;
}

.sr-story-intro {
    font-style: italic;
    font-size: 0.9rem; /* Smaller text */
    line-height: 1.6;
    color: #475569;
    background: #f1f5f9;
    padding: 15px; /* Tighter padding */
    border-left: 4px solid #0ea5e9;
    border-radius: 6px;
    margin: 15px 0;
    box-sizing: border-box;
    max-width: 100%;
}

.sr-tag {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    padding: 4px 12px; /* Smaller pills */
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 10px;
}

/* 6. Code Terminal Styling */
.sr-code-container {
    margin: 15px 0;
    background: #1e293b;
    border-radius: 8px;
    border: 1px solid #0f172a;
    overflow: hidden;
    box-sizing: border-box;
    max-width: 100%;
}

.sr-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background: #334155;
    border-bottom: 1px solid #475569;
    color: #cbd5e1;
    font-size: 0.75rem;
}

.sr-code-container pre {
    padding: 15px; /* Reduced padding */
    margin: 0;
    overflow-x: auto;
    box-sizing: border-box;
    max-width: 100%;
}

.sr-code-container code {
    color: #7dd3fc;
    font-family: 'Consolas', monospace;
    font-size: 0.85rem; /* Smaller code text */
    line-height: 1.5;
}

/* 7. Copy Button */
.sr-copy-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f1f5f9;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: 0.2s;
}

.sr-copy-btn:hover { background: #0ea5e9; }

/* 8. View More Button */
.view-more-area { text-align: center; margin-top: 30px; }
.sr-btn-outline {
    padding: 10px 25px;
    border: 2px solid #1e293b;
    background: transparent;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}
.sr-btn-outline:hover { background: #1e293b; color: #fff; }

/* Creative Roadmap Guide Section */
.sr-guide-container {
    margin-top: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.guide-title {
    font-size: 1rem;
    color: #0f172a;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.guide-steps { position: relative; padding-left: 10px; }
.guide-steps::before {
    content: ''; position: absolute; left: 25px; top: 10px; bottom: 20px; width: 2px; background: #cbd5e1; z-index: 1;
}

.step-item { display: flex; gap: 15px; margin-bottom: 20px; position: relative; z-index: 2; }
.step-node {
    width: 32px; height: 32px; background: #ffffff; border: 2px solid #0ea5e9;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; box-shadow: 0 0 8px rgba(14, 165, 233, 0.2);
}
.step-number { font-size: 0.75rem; font-weight: 800; color: #0ea5e9; }
.step-content strong { display: block; color: #1e293b; font-size: 0.9rem; margin-bottom: 2px; }
.step-content p { font-size: 0.85rem; color: #64748b; margin: 0; line-height: 1.4; }

/* Premium Link Animation */
.sr-cta-box { margin-top: 15px; text-align: right; }
.premium-link { color: #0ea5e9; text-decoration: none; font-weight: 700; font-size: 0.85rem; transition: 0.3s; }
.premium-link:hover { letter-spacing: 0.5px; color: #0369a1; }

/* Scroll Progress Bar */
.scroll-progress-container { position: fixed; top: 0; left: 0; width: 100%; height: 3px; background: transparent; z-index: 2000; }
.scroll-progress-bar { height: 100%; background: linear-gradient(to right, #0ea5e9, #22d3ee); width: 0%; }

/* Nav Breadcrumb Styling */
@media screen and (min-width: 901px) {
    .nav-menu { display: flex; align-items: center; gap: 30px; list-style: none; }
}
.nav-back-link { color: #64748b; text-decoration: none; display: flex; align-items: center; gap: 6px; font-size: 0.85rem; transition: color 0.3s; }
.nav-back-link:hover { color: #0ea5e9; }
.breadcrumb-separator { color: #cbd5e1; font-size: 0.65rem; }
.breadcrumb-item.active { color: #0f172a; font-weight: 700; font-size: 0.85rem; }

/* Nav Action Button */
.sr-nav-btn { background: #1e293b; color: #fff; padding: 6px 15px; border-radius: 50px; text-decoration: none; font-size: 0.8rem; font-weight: 600; transition: 0.3s; }
.sr-nav-btn:hover { background: #0ea5e9; }

.sr-search-container {
    max-width: 500px; margin: 20px auto 0; background: #ffffff; border: 1px solid #e2e8f0;
    padding: 10px 20px; border-radius: 50px; display: flex; align-items: center; gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); transition: all 0.3s ease;
}
.sr-search-container:focus-within { border-color: #0ea5e9; }
.sr-search-container i { color: #94a3b8; font-size: 1rem; }
.sr-search-container input { width: 100%; border: none; outline: none; font-size: 0.9rem; color: #1e293b; background: transparent; }
#noResults { text-align: center; padding: 30px; color: #64748b; font-size: 0.9rem; }

/* Main Layout: Feed on Left, Sidebar on Right */
.sr-blog-layout {
    display: flex; justify-content: center; gap: 25px; padding: 30px 5%; background-color: #f8fafc;
    align-items: flex-start; max-width: 1400px; margin: 0 auto; box-sizing: border-box; overflow-x: hidden;
}

.item-info { flex: 1; display: flex; flex-direction: column; align-items: flex-start; }

/* =========================================
   SIDEBAR & WIDGET BASE STYLES
   ========================================= */
.sr-sidebar { flex: 1; display: flex; flex-direction: column; gap: 15px; position: sticky; top: 80px; }
.sr-widget { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 15px; }
.widget-header { font-size: 0.7rem; font-weight: 800; color: #94a3b8; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; text-transform: uppercase; }
.terminal-text { font-family: 'Fira Code', 'Courier New', monospace; font-size: 0.75rem; color: #10b981; background: #0f172a; padding: 12px; border-radius: 6px; line-height: 1.5; border-left: 3px solid #0ea5e9; }
.coffee-content { text-align: center; }
#coffee-count { font-size: 1.25rem; font-weight: 800; color: #1e293b; display: block; }
.coffee-btn { width: 100%; margin-top: 10px; background: #7c2d12; color: white; border: none; padding: 8px; border-radius: 50px; cursor: pointer; font-size: 0.85rem; font-weight: 600; transition: 0.3s; }
.coffee-btn:hover { background: #9a3412; }

/* News Feed Styling */
.news-list { display: flex; flex-direction: column; gap: 8px; }
.news-item { text-decoration: none; display: flex; align-items: flex-start; gap: 8px; padding: 8px; background: #f1f5f9; border-radius: 6px; border: 1px solid transparent; cursor: pointer !important; position: relative; z-index: 5; }
.news-item:hover { background: #ffffff; border-color: #0ea5e9; }
.news-item i, .news-item span { pointer-events: none; }
.news-item i { color: #0ea5e9; margin-top: 3px; font-size: 0.75rem; }
.news-item span { font-size: 0.8rem; color: #334155; font-weight: 500; line-height: 1.3; }
.news-loading { text-align: center; font-size: 0.75rem; color: #94a3b8; padding: 15px 0; }
.news-footer { margin-top: 12px; border-top: 1px solid #e2e8f0; padding-top: 8px; text-align: center; font-size: 0.8rem; }

/* =========================================
   MOBILE RESPONSIVENESS (ULTRA COMPACT)
   ========================================= */

/* Tablet View */
@media screen and (max-width: 1024px) {
    .sr-blog-layout { flex-direction: column; padding: 20px 5%; width: 100%; box-sizing: border-box; }
    .sr-sidebar { width: 100%; position: relative; top: 0; }
}

/* Mobile View */
@media screen and (max-width: 768px) {
    /* 1. Feed Container Spacing */
    .sr-blog-feed {
        padding: 5px 0 !important; 
        width: 100%; 
        box-sizing: border-box;
    }

    /* 2. Blog Heading Cards - Ultra Compact */
    .blog-list-item {
        flex-direction: column !important; 
        align-items: flex-start !important; 
        text-align: left !important;
        padding: 12px 15px !important; /* Extremely tight padding */
        height: auto !important;
        gap: 6px; /* Less space between title and arrow */
        width: 100%; 
        box-sizing: border-box; 
    }

    /* 3. Info (Date + Title) */
    .item-info {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        margin-bottom: 0;
        box-sizing: border-box; 
    }

    .blog-list-item h3 {
        font-size: 1rem !important; /* Smaller title font */
        margin: 2px 0 0 0 !important;
        line-height: 1.3;
        word-wrap: break-word; 
        overflow-wrap: break-word; 
        max-width: 100%; 
    }

    .post-date {
        margin: 0 !important;
        font-size: 0.7rem !important; /* Tiny date */
        color: #64748b;
    }

    /* 4. Position the Arrow neatly */
    .nav-arrow {
        position: relative !important; 
        align-self: flex-end; 
        margin: -5px 0 0 0 !important;
        font-size: 0.9rem;
    }

    /* 5. Fix Content Card (Expanded Part) */
    .sr-blog-card {
        padding: 15px 12px !important; /* Tighter text box */
        margin-top: 2px !important;
        border-radius: 8px !important;
        width: 100%; 
        box-sizing: border-box; 
        overflow-x: hidden; 
    }
    
    .sr-story-intro {
        font-size: 0.85rem !important;
        padding: 12px !important;
        margin: 10px 0 !important;
    }

    /* 6. Header Text Sizing */
    #blog-page-header {
        padding: 90px 5% 25px !important; /* Much less empty space at top */
    }
    #blog-page-header h1 {
        font-size: 1.5rem !important; /* Scaled down hero text */
        line-height: 1.2;
        margin-bottom: 5px;
    }
    #blog-page-header p {
        font-size: 0.9rem !important;
    }
}

/* =========================================
   BLOG PROFESSIONAL MOTION LAYER
   ========================================= */

#blog-page-header {
    position: relative;
    overflow: hidden;
    background: linear-gradient(130deg, #f3f8ff 0%, #f8fcff 52%, #effaf7 100%);
}

#blog-page-header::before {
    content: "";
    position: absolute;
    width: 460px;
    height: 460px;
    top: -220px;
    right: -160px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.16), transparent 66%);
    animation: blogGlowFloat 8s ease-in-out infinite alternate;
}

@keyframes blogGlowFloat {
    0% { transform: translateY(0) scale(0.95); }
    100% { transform: translateY(12px) scale(1.05); }
}

.blog-list-item {
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 260ms ease, border-color 260ms ease, background-color 260ms ease;
}

.blog-list-item:hover {
    transform: translateX(8px) translateY(-2px);
    box-shadow: 0 14px 24px rgba(14, 165, 233, 0.16);
    background: linear-gradient(180deg, #ffffff 0%, #f8fcff 100%);
}

.blog-content-panel.active .sr-blog-card {
    animation: panelRise 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes panelRise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.sr-code-container {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
    transition: box-shadow 260ms ease, transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sr-code-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 30px rgba(14, 165, 233, 0.24);
}

.sr-copy-btn {
    transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.sr-copy-btn:hover {
    transform: translateY(-1px);
}

.sr-blog-layout,
.sr-blog-feed {
    background: linear-gradient(180deg, #f8fbff 0%, #f2f7fd 58%, #edf8f5 100%);
}

.blog-list-item,
.sr-widget,
.sr-blog-card {
    border-color: #d8e3ef;
}

.blog-list-item:hover,
.sr-widget:hover {
    border-color: rgba(11, 111, 214, 0.35);
}

.blog-list-item h3,
.guide-title {
    color: #0e1b31;
}

.premium-link {
    color: #0b6fd6;
}

.premium-link:hover {
    color: #0f766e;
}

/* Startup Visual Mode */
body[data-visual="startup"] #blog-page-header {
    background: linear-gradient(120deg, #eef5ff 0%, #f6fbff 42%, #e8f7f1 100%);
}

body[data-visual="startup"] #blog-page-header::before {
    background: radial-gradient(circle, rgba(11, 111, 214, 0.26), transparent 66%);
    animation-duration: 5.2s;
}

body[data-visual="startup"] .blog-list-item {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border-color: rgba(11, 111, 214, 0.2);
}

body[data-visual="startup"] .blog-list-item:hover {
    transform: translateX(12px) translateY(-3px) scale(1.01);
    box-shadow: 0 18px 30px rgba(11, 111, 214, 0.24);
}

body[data-visual="startup"] .sr-blog-card {
    border-color: rgba(11, 111, 214, 0.2);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.1);
}

body[data-visual="startup"] .sr-code-container {
    border-color: rgba(125, 211, 252, 0.4);
    box-shadow: 0 14px 28px rgba(11, 111, 214, 0.25);
}
