/* ============================================
   HOMEPAGE BLOG SECTION
   Cosmic theme - Latest blog posts preview
   ============================================ */

.homepage-blog-section {
    position: relative;
    padding: 100px 20px 120px;
    /* Softly blends from terminal section end into the start of nebula footer */
    background: linear-gradient(180deg,
            #0d0e16 0%,
            #0a0b12 50%,
            #0d0e16 100%);
    z-index: 2;
}

/* Subtle ambient glow */
.homepage-blog-section::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 60%;
    background: radial-gradient(ellipse at center,
            rgba(168, 85, 247, 0.05) 0%,
            rgba(45, 212, 191, 0.02) 40%,
            transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Section Header */
.homepage-blog-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 2;
}

.homepage-blog-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 15px;
}

.homepage-blog-header p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    max-width: 600px;
    margin: 0 auto;
}

/* Blog Cards Grid */
.homepage-blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Blog Card */
.homepage-blog-card {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    /* GPU acceleration */
    will-change: transform;
    transform: translateZ(0);
}

/* Left accent line */
.homepage-blog-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg,
            rgba(45, 212, 191, 0.5) 0%,
            rgba(168, 85, 247, 0.3) 100%);
    opacity: 0.3;
    transition: opacity 0.4s ease;
}

.homepage-blog-card:hover {
    transform: translateY(-5px);
    border-color: rgba(45, 212, 191, 0.2);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.homepage-blog-card:hover::before {
    opacity: 1;
}

/* Card Image */
.homepage-blog-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.homepage-blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    filter: brightness(0.8);
}

.homepage-blog-card:hover .homepage-blog-card-image img {
    transform: scale(1.05);
    filter: brightness(0.9);
}

/* Category Badge on Image */
.homepage-blog-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 20px;
    color: #fff;
    text-transform: uppercase;
    z-index: 2;
}

/* Card Content */
.homepage-blog-card-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Meta info */
.homepage-blog-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    font-family: 'Space Grotesk', sans-serif;
}

.homepage-blog-meta-separator {
    color: rgba(45, 212, 191, 0.5);
}

/* Card Title */
.homepage-blog-card-content h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.homepage-blog-card:hover .homepage-blog-card-content h3 {
    color: #2dd4bf;
}

/* Card Excerpt */
.homepage-blog-card-content p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Read More Link */
.homepage-blog-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Space Grotesk', sans-serif;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: auto;
}

.homepage-blog-read-more .arrow {
    transition: transform 0.3s ease;
}

.homepage-blog-card:hover .homepage-blog-read-more {
    color: #2dd4bf;
}

.homepage-blog-card:hover .homepage-blog-read-more .arrow {
    transform: translateX(4px);
}

/* View All Button */
.homepage-blog-cta {
    text-align: center;
    margin-top: 50px;
    position: relative;
    z-index: 2;
}

.homepage-blog-cta a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #2dd4bf;
    text-decoration: none;
    background: rgba(45, 212, 191, 0.08);
    border: 1px solid rgba(45, 212, 191, 0.3);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.homepage-blog-cta a:hover {
    background: rgba(45, 212, 191, 0.15);
    border-color: #2dd4bf;
    box-shadow: 0 0 25px rgba(45, 212, 191, 0.2);
    transform: translateY(-2px);
}

.homepage-blog-cta a .arrow {
    transition: transform 0.3s ease;
}

.homepage-blog-cta a:hover .arrow {
    transform: translateX(4px);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 992px) {
    .homepage-blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Hide third card on tablet */
    .homepage-blog-card:nth-child(3) {
        display: none;
    }
}

@media (max-width: 640px) {
    .homepage-blog-section {
        padding: 60px 15px 80px;
    }

    .homepage-blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Show all cards on mobile (stacked) */
    .homepage-blog-card:nth-child(3) {
        display: flex;
    }

    .homepage-blog-card-image {
        height: 180px;
    }
}