/* ============================================
   BLOG PAGE - Cosmic News Grid
   v1.0 - Space-themed Blog Layout
   ============================================ */

/* --- BLOG HERO SECTION --- */
.blog-hero-section {
    position: relative;
    min-height: 55vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 160px 0 120px;
    background-color: #080912;
}

/* Hero Background */
.blog-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url('../images/hero-images/hero-nebula-vertical.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* Hero Overlay */
.blog-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to bottom,
            rgba(5, 5, 8, 0.3) 0%,
            rgba(5, 5, 8, 0.2) 30%,
            rgba(5, 5, 8, 0.5) 70%,
            #080912 100%);
}

/* Hero to section transition */
.blog-hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom,
            transparent 0%,
            #080912 100%);
    pointer-events: none;
    z-index: 3;
}

/* Hero Content */
.blog-hero-content {
    position: relative;
    z-index: 5;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.blog-hero-content .section-tag-cosmic {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 8px 20px;
    border-radius: 30px;
    margin-bottom: var(--spacing-md);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.blog-hero-content h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    color: #fff;
    margin-bottom: var(--spacing-md);
    font-weight: 700;
    line-height: 1.1;
}

.blog-hero-content .hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto;
}

/* Text Glow */
.text-glow {
    background: linear-gradient(135deg, #a855f7 0%, #2dd4bf 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}


/* ============================================
   BLOG GRID SECTION
   ============================================ */

.blog-grid-section {
    position: relative;
    padding: 80px 0 120px;
    background: #080912;
}

/* Wider container for blog grid */
.blog-grid-section .container {
    max-width: 1400px;
    width: 94%;
}

/* Top gradient for smooth transition from hero */
.blog-grid-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to bottom,
            #080912 0%,
            rgba(8, 9, 18, 0.5) 50%,
            transparent 100%);
    z-index: 1;
    pointer-events: none;
}

/* Category Filter */
.blog-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 50px;
}

.category-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Space Grotesk', sans-serif;
}

.category-btn:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.3);
    color: #a855f7;
}

.category-btn.active {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.5);
    color: #a855f7;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.2);
}


/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
    align-items: stretch;
}


/* ============================================
   BLOG CARD
   ============================================ */

.blog-card {
    --card-color: 168, 85, 247;
    --card-hex: #a855f7;

    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s ease, opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Card Color Variations */
.blog-card:nth-child(6n+1) {
    --card-color: 168, 85, 247;
    --card-hex: #a855f7;
}

.blog-card:nth-child(6n+2) {
    --card-color: 45, 212, 191;
    --card-hex: #2dd4bf;
}

.blog-card:nth-child(6n+3) {
    --card-color: 59, 130, 246;
    --card-hex: #3b82f6;
}

.blog-card:nth-child(6n+4) {
    --card-color: 236, 72, 153;
    --card-hex: #ec4899;
}

.blog-card:nth-child(6n+5) {
    --card-color: 251, 191, 36;
    --card-hex: #fbbf24;
}

.blog-card:nth-child(6n+6) {
    --card-color: 16, 185, 129;
    --card-hex: #10b981;
}

.blog-card:hover {
    background: rgba(var(--card-color), 0.05);
    border-color: rgba(var(--card-color), 0.25);
    transform: translateY(-8px);
    box-shadow:
        0 20px 50px rgba(var(--card-color), 0.15),
        0 0 0 1px rgba(var(--card-color), 0.1);
}

/* Card Image */
.blog-card-image {
    display: block;
    position: relative;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg,
            rgba(var(--card-color), 0.1) 0%,
            rgba(var(--card-color), 0.05) 100%);
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.08);
}

/* Image Overlay */
.blog-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(8, 9, 18, 0.9) 0%,
            transparent 50%);
    pointer-events: none;
}

/* Category Badge on Image */
.blog-category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 5;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Card Content */
.blog-card-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Meta Info */
.blog-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
}

.blog-meta-separator {
    opacity: 0.5;
}

.blog-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.blog-meta-icon {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Card Title */
.blog-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
    line-height: 1.4;
    transition: color 0.3s ease;
    /* Limit to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.blog-card:hover .blog-card-title {
    color: var(--card-hex);
}

/* Card Excerpt */
.blog-card-excerpt {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
    flex: 1;
    margin-bottom: 20px;
    /* Limit to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Read More Link */
.blog-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--card-hex);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.blog-read-more:hover {
    gap: 12px;
    color: #fff;
}

.read-more-arrow {
    transition: transform 0.3s ease;
}

.blog-read-more:hover .read-more-arrow {
    transform: translateX(5px);
}


/* ============================================
   FEATURED POST (Optional - First Post Larger)
   ============================================ */

.blog-card.featured {
    grid-column: span 2;
}

.blog-card.featured .blog-card-image {
    height: 280px;
}

.blog-card.featured .blog-card-title {
    font-size: 1.6rem;
}

@media (max-width: 768px) {
    .blog-card.featured {
        grid-column: span 1;
    }

    .blog-card.featured .blog-card-image {
        height: 200px;
    }
}


/* ============================================
   PAGINATION
   ============================================ */

.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 60px;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'Space Grotesk', sans-serif;
}

.pagination-btn:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.3);
    color: #a855f7;
}

.pagination-btn.active {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.5);
    color: #a855f7;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.25);
}

.pagination-btn.prev,
.pagination-btn.next {
    width: auto;
    padding: 0 18px;
    gap: 6px;
}


/* ============================================
   NEWSLETTER SECTION
   ============================================ */

.blog-newsletter-section {
    padding: 100px 0 80px;
    background: #080912;
    position: relative;
}

/* Top gradient for smooth transition */
.blog-newsletter-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to bottom,
            #080912 0%,
            transparent 100%);
    z-index: 1;
    pointer-events: none;
}

.newsletter-container {
    max-width: 650px;
    margin: 0 auto;
    text-align: center;
    padding: 50px 40px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

/* Decorative Glow */
.newsletter-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center,
            rgba(168, 85, 247, 0.08) 0%,
            transparent 50%);
    pointer-events: none;
}

.newsletter-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.newsletter-container h3 {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 12px;
    font-weight: 600;
}

.newsletter-container p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 30px;
    line-height: 1.6;
}

.newsletter-form {
    display: flex;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.newsletter-input {
    flex: 1;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.newsletter-input:focus {
    outline: none;
    border-color: rgba(168, 85, 247, 0.5);
    background: rgba(168, 85, 247, 0.05);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.15);
}

.newsletter-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Space Grotesk', sans-serif;
    white-space: nowrap;
}

.newsletter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.4);
}

@media (max-width: 600px) {
    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-btn {
        width: 100%;
    }
}


/* ============================================
   FOOTER WRAPPER
   ============================================ */

.blog-footer-wrapper {
    background-color: #080912;
    position: relative;
    z-index: 5;
}

.blog-footer-wrapper .nebula-footer {
    padding-top: 120px;
}

/* Top gradient for smooth transition from newsletter */
.blog-footer-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 250px;
    background: linear-gradient(to bottom,
            #080912 0%,
            rgba(8, 9, 18, 0.6) 30%,
            transparent 100%);
    z-index: 10;
    pointer-events: none;
}


/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .blog-hero-section {
        min-height: 40vh;
        padding: 120px 0 80px;
    }

    .blog-grid-section {
        padding: 60px 0 100px;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .blog-categories {
        gap: 8px;
        margin-bottom: 40px;
    }

    .category-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .newsletter-container {
        padding: 35px 25px;
    }
}

@media (max-width: 480px) {
    .blog-hero-content h1 {
        font-size: 1.8rem;
    }

    .blog-card-content {
        padding: 20px;
    }

    .blog-card-title {
        font-size: 1.1rem;
    }

    .pagination-btn {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
}