/* Blog Hero Section */
.blog-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: calc(4rem + 80px) 0 4rem 0;
    /* Add header height to top padding */
    text-align: center;
    margin-top: -80px;
    /* Negative margin to align with header */
}

.blog-hero__content {
    max-width: 800px;
    margin: 0 auto;
}

.blog-hero__title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.blog-hero__description {
    font-size: 1.25rem;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 0;
}

/* Blog Content */
.blog-content {
    padding: 4rem 0;
    background-color: #f8fafc;
}

/* Pinned Article */
.blog-pinned {
    margin-bottom: 4rem;
    margin-top: 2rem;
    /* Add some space after hero section */
}

.blog-pinned__title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: #1e293b;
    text-align: center;
}

/* Blog Grid */
.blog-grid {
    margin-top: 4rem;
}

.blog-grid__title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: #1e293b;
    text-align: center;
}

.blog-grid__container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Blog Cards */
.blog-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 450px;
    justify-self: start;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.blog-card--pinned {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    max-width: 1000px;
    margin: 0 auto;
    height: 400px;
}

.blog-card__image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
    z-index: 1;
    /* Ensure proper layering */
}

.blog-card--pinned .blog-card__image {
    aspect-ratio: auto;
    height: 100%;
}

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

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

.blog-card__badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #2563eb;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1;
}

.blog-card__content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card--pinned .blog-card__content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card__meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #64748b;
}

.blog-card__date {
    font-weight: 500;
}

.blog-card__category {
    background: #e2e8f0;
    color: #475569;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: 500;
    align-self: flex-start;
    margin-top: auto;
}

.blog-card__title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #1e293b;
}

.blog-card--pinned .blog-card__title {
    font-size: 1.5rem;
}

.blog-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card__title a:hover {
    color: #2563eb;
}

.blog-card__excerpt {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
}

.blog-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.blog-card__author {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.blog-card__footer .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .blog-hero {
        padding: calc(3rem + 70px) 0 3rem 0;
        /* Add mobile header height to top padding */
        margin-top: -70px;
        /* Negative margin to align with mobile header */
    }

    .blog-hero__title {
        font-size: 2rem;
    }

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

    .blog-content {
        padding: 2rem 0;
    }

    .blog-pinned {
        margin-top: 1rem;
        /* Reduced spacing on mobile */
    }

    .blog-pinned__title,
    .blog-grid__title {
        font-size: 1.5rem;
    }

    .blog-card--pinned {
        grid-template-columns: 1fr;
        height: auto;
        /* Allow natural height on mobile */
    }

    .blog-card--pinned .blog-card__content {
        padding: 1.5rem;
    }

    .blog-card--pinned .blog-card__title {
        font-size: 1.25rem;
    }

    .blog-grid__container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .blog-card__footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .blog-card__footer .btn {
        align-self: stretch;
        text-align: center;
    }
}

/* Pagination Styles */
.pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 3rem;
    gap: 1rem;
}

.pagination__controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: nowrap;
}

.pagination__numbers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination__button {
    background: white;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination__button:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.pagination__button--active {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.pagination__button--active:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.pagination__button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8fafc;
}

.pagination__button:disabled:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}

.pagination__info {
    font-size: 0.875rem;
    color: #64748b;
    text-align: center;
    margin: 0;
}

.pagination__ellipsis {
    color: #64748b;
    padding: 0.75rem 0.5rem;
    cursor: default;
}

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

    .blog-card__content {
        padding: 1rem;
    }

    .blog-card--pinned .blog-card__content {
        padding: 1rem;
    }

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

    .blog-card--pinned .blog-card__title {
        font-size: 1.125rem;
    }

    .pagination {
        margin-top: 2rem;
        gap: 0.75rem;
    }

    .pagination__controls {
        gap: 0.125rem;
        flex-wrap: wrap;
    }

    .pagination__button {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        min-width: 40px;
    }

    .pagination__info {
        font-size: 0.75rem;
    }
}