/* Blog Page Styles */

/* Blog Hero Section */
.blog-hero {
    background: var(--bg-primary);
    padding: 6rem 2rem 3rem;
    text-align: center;
}

.blog-hero-title {
    font-family: 'Fira Code', monospace;
    font-size: 3rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 700;
    animation: fadeInUp 0.8s ease-out;
}

.blog-hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Blog Feed Section */
.blog-feed-section {
    background: var(--bg-primary);
    padding: 2rem 2rem 4rem;
}

/* Featured posts container - display first 2 side by side */
.blog-feed {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

/* Featured posts (first 2) take up one column each */
.blog-feed .blog-card:nth-child(1),
.blog-feed .blog-card:nth-child(2) {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Ensure featured post card-inner takes full height */
.blog-feed .blog-card:nth-child(1) .blog-card-inner,
.blog-feed .blog-card:nth-child(2) .blog-card-inner {
    height: 100%;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    margin: 0;
    padding: 0;
    flex: 1;
}

/* All other posts (compact) span full width and are centered */
.blog-feed .blog-card:nth-child(n+3) {
    grid-column: 1 / -1;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* Add spacing after featured posts row */
.blog-feed .blog-card:nth-child(2) {
    margin-bottom: 2rem;
}

/* Add visual container for compact posts section */
.blog-feed .blog-card:nth-child(3) {
    padding-top: 2rem;
    border-top: 2px solid rgba(96, 165, 250, 0.2);
}

/* Add background to compact post cards */
.blog-card-compact {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    padding: 0 1rem !important;
    margin-bottom: 0.5rem;
}

.blog-card-compact:first-of-type {
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.blog-card-compact:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(96, 165, 250, 0.4) !important;
    transform: translateX(4px);
}

/* Reduce gap for compact posts */
.blog-card-compact + .blog-card-compact {
    margin-top: 0;
}

/* Blog Card */
.blog-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out both;
}

/* Compact Blog Card (no thumbnail) */
.blog-card-compact {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0;
}

.blog-card-compact:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
    transform: none;
    box-shadow: none;
}

.blog-card-compact .blog-card-inner {
    gap: 0;
}

.blog-card-compact .blog-content {
    padding: 0.75rem 0;
}

.blog-card-compact .blog-title {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

.blog-card-compact .blog-date {
    font-size: 0.7rem;
}

.blog-card-compact .blog-type {
    font-size: 0.6rem;
    padding: 0.2rem 0.4rem;
}

.blog-card:nth-child(1) { animation-delay: 0.1s; }
.blog-card:nth-child(2) { animation-delay: 0.15s; }
.blog-card:nth-child(3) { animation-delay: 0.2s; }
.blog-card:nth-child(4) { animation-delay: 0.25s; }
.blog-card:nth-child(5) { animation-delay: 0.3s; }
.blog-card:nth-child(6) { animation-delay: 0.35s; }
.blog-card:nth-child(7) { animation-delay: 0.4s; }
.blog-card:nth-child(8) { animation-delay: 0.45s; }
.blog-card:nth-child(9) { animation-delay: 0.5s; }
.blog-card:nth-child(10) { animation-delay: 0.55s; }
.blog-card:nth-child(n+11) { animation-delay: 0.6s; }

.blog-card:hover {
    border-color: rgba(96, 165, 250, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.blog-card-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
}

/* Featured posts layout - vertical with large image */
.blog-feed .blog-card:nth-child(1) .blog-card-inner,
.blog-feed .blog-card:nth-child(2) .blog-card-inner {
    flex-direction: column;
}

/* Blog Thumbnail */
.blog-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    overflow: hidden;
    background: var(--bg-tertiary);
    position: relative;
    border-radius: 6px;
}

/* Featured post thumbnails - much larger */
.blog-feed .blog-card:nth-child(1) .blog-thumbnail,
.blog-feed .blog-card:nth-child(2) .blog-thumbnail {
    width: 100%;
    height: 240px;
    border-radius: 8px 8px 0 0;
    margin: 0;
}

.blog-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(129, 140, 248, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.blog-card:hover .blog-thumbnail::after {
    opacity: 1;
}

.blog-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-thumbnail img {
    transform: scale(1.05);
}

/* Blog Content */
.blog-content {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

/* Featured post content - more padding */
.blog-feed .blog-card:nth-child(1) .blog-content,
.blog-feed .blog-card:nth-child(2) .blog-content {
    padding: 1.5rem;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    margin-top: 0;
}

/* Featured post meta - no extra margin */
.blog-feed .blog-card:nth-child(1) .blog-meta,
.blog-feed .blog-card:nth-child(2) .blog-meta {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.blog-date {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.blog-type {
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: rgba(96, 165, 250, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.blog-title {
    font-family: 'Fira Code', monospace;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.4;
    transition: color 0.3s ease;
}

/* Featured post titles - larger */
.blog-feed .blog-card:nth-child(1) .blog-title,
.blog-feed .blog-card:nth-child(2) .blog-title {
    font-size: 1.25rem;
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

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

.blog-excerpt {
    display: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

/* Featured post excerpts - show them */
.blog-feed .blog-card:nth-child(1) .blog-excerpt,
.blog-feed .blog-card:nth-child(2) .blog-excerpt {
    display: block;
    flex-grow: 1;
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Blog Tags */
.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0;
}

/* Push featured post tags to bottom */
.blog-feed .blog-card:nth-child(1) .blog-tags,
.blog-feed .blog-card:nth-child(2) .blog-tags {
    margin-top: auto;
}

.tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
}

/* Blog Link */
.blog-link {
    display: none;
}

.blog-link:hover {
    gap: 0.75rem;
    background: rgba(96, 165, 250, 0.15);
    border-color: var(--accent-primary);
    transform: translateX(4px);
    text-decoration: none;
}

.blog-link i {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.blog-link:hover i {
    transform: translateX(4px);
}

/* Make entire card clickable */
.blog-card {
    cursor: pointer;
}

.blog-card-inner {
    text-decoration: none;
    color: inherit;
    display: flex;
}

/* Responsive Design */
@media (max-width: 992px) {
    /* Stack featured posts on tablets */
    .blog-feed {
        grid-template-columns: 1fr;
    }

    .blog-feed .blog-card:nth-child(1),
    .blog-feed .blog-card:nth-child(2) {
        grid-column: 1;
    }

    /* Reduce featured thumbnail height on tablets */
    .blog-feed .blog-card:nth-child(1) .blog-thumbnail,
    .blog-feed .blog-card:nth-child(2) .blog-thumbnail {
        height: 200px;
    }

    .blog-thumbnail {
        width: 70px;
        height: 70px;
    }

    .blog-title {
        font-size: 0.95rem;
    }

    .blog-feed .blog-card:nth-child(1) .blog-title,
    .blog-feed .blog-card:nth-child(2) .blog-title {
        font-size: 1.125rem;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 4rem 1rem 2rem;
    }

    .blog-hero-title {
        font-size: 2rem;
    }

    .blog-hero-subtitle {
        font-size: 1rem;
    }

    .blog-feed-section {
        padding: 1.5rem 1rem 3rem;
    }

    .blog-feed {
        gap: 1.25rem;
    }

    /* Featured post thumbnails on mobile */
    .blog-feed .blog-card:nth-child(1) .blog-thumbnail,
    .blog-feed .blog-card:nth-child(2) .blog-thumbnail {
        height: 180px;
    }

    .blog-thumbnail {
        height: 220px;
    }

    .blog-content {
        padding: 1.25rem;
    }

    .blog-feed .blog-card:nth-child(1) .blog-content,
    .blog-feed .blog-card:nth-child(2) .blog-content {
        padding: 1.25rem;
    }

    .blog-title {
        font-size: 1.125rem;
    }

    .blog-feed .blog-card:nth-child(1) .blog-title,
    .blog-feed .blog-card:nth-child(2) .blog-title {
        font-size: 1.125rem;
    }

    .blog-excerpt {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .blog-hero-title {
        font-size: 1.75rem;
    }

    .blog-hero-subtitle {
        font-size: 0.95rem;
    }

    .blog-thumbnail {
        height: 180px;
    }

    .blog-content {
        padding: 1rem;
    }

    .blog-title {
        font-size: 1rem;
    }

    .blog-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .blog-date {
        font-size: 0.8rem;
    }

    .blog-type {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }

    .blog-excerpt {
        font-size: 0.85rem;
    }

    .tag {
        font-size: 0.65rem;
    }
}

@media (max-width: 375px) {
    .blog-hero-title {
        font-size: 1.5rem;
    }

    .blog-hero-subtitle {
        font-size: 0.9rem;
    }

    .blog-feed {
        gap: 1rem;
    }

    .blog-card-compact {
        padding: 0 0.75rem !important;
    }

    .blog-feed .blog-card:nth-child(1) .blog-content,
    .blog-feed .blog-card:nth-child(2) .blog-content {
        padding: 1rem;
    }

    .blog-title {
        font-size: 0.95rem;
    }

    .blog-feed .blog-card:nth-child(1) .blog-title,
    .blog-feed .blog-card:nth-child(2) .blog-title {
        font-size: 1rem;
    }
}
