/* blog.css */

/* Global styles (like --primary-color, --spacing-md etc.) are assumed to be loaded from style.css */

/* ========== Blog Page Specific Styles ========== */
.landing.blog-page {
    /* Adjust landing page padding for blog */
    padding-top: var(--spacing-xxl);
    padding-bottom: var(--spacing-xxl);
    text-align: center; /* Center main page title */
}

/* Remove or adjust radial background glow if it clashes with blog layout, or keep it */
.landing.blog-page::before {
    top: 50px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(72, 158, 69, 0.1) 0%, transparent 70%);
}


/* ========== Page Title Section ========== */
.page-title {
    margin-bottom: var(--spacing-xxxl);
    padding: var(--spacing-xxl) var(--spacing-lg); /* Add horizontal padding for text */
    background: var(--form-bg); /* A subtle background for the title section */
    border-radius: var(--border-radius-large);
    box-shadow: var(--box-shadow-light);
    animation: fadeUp 0.9s ease-out forwards;
    animation-delay: 0.2s;
    opacity: 0;
    will-change: transform, opacity;
    animation-fill-mode: forwards;
}

.page-title h1 {
    font-size: 3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

.page-title p {
    font-size: 1.15rem;
    color: var(--light-text-color);
    max-width: 700px; /* Limit width for readability */
    margin: 0 auto;
}

/* ========== Articles List Section ========== */
.articles-list {
    display: grid; /* Use CSS Grid for a responsive article layout */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Auto-fit columns */
    gap: var(--spacing-xxxl); /* Gap between article cards */
    margin-bottom: var(--spacing-xxxl); /* Space below the list */
    padding: var(--spacing-md); /* Slight padding for the grid container */
}

.article-card {
    background: var(--bg-color);
    border-radius: var(--border-radius-large);
    box-shadow: var(--box-shadow-medium);
    overflow: hidden; /* Ensures image corners are rounded */
    display: flex;
    flex-direction: column; /* Stack image on top of content */
    text-align: left; /* Align text within card to the left */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px); /* Lift effect on hover */
    box-shadow: var(--box-shadow-heavy); /* Stronger shadow on hover */
}

.article-card-image {
    width: 100%;
    height: 200px; /* Fixed height for consistent image size */
    overflow: hidden; /* Hide overflow for object-fit */
}

.article-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the area, cropping if necessary */
    display: block; /* Remove extra space below image */
    transition: transform 0.3s ease;
}

.article-card:hover .article-card-image img {
    transform: scale(1.05); /* Slight zoom on image hover */
}

.article-card-content {
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allow content to grow and push footer down */
}

.article-card-content h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: var(--spacing-md);
    line-height: 1.3;
    color: var(--text-color);
}

.article-card-content h3 a {
    text-decoration: none;
    color: inherit; /* Inherit color from h3 */
    transition: color 0.3s ease;
}

.article-card-content h3 a:hover {
    color: var(--primary-color);
}

.article-card .article-meta {
    font-size: 0.85rem;
    color: var(--light-text-color);
    margin-bottom: var(--spacing-md);
}

.article-card .article-meta .author {
    font-weight: 600;
    color: var(--primary-color);
}

.article-card-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: var(--spacing-lg);
    flex-grow: 1; /* Allows description to take up available space */
}

.article-card-content .read-more {
    display: inline-block; /* Allows padding and margin */
    margin-top: var(--spacing-sm);
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease, transform 0.3s ease;
}

.article-card-content .read-more:hover {
    color: #3a8038; /* Darker shade */
    transform: translateX(5px);
}

/* Optional: Pagination styles if you decide to add it */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xxl);
    margin-bottom: var(--spacing-xxxl);
}

.pagination a {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    text-decoration: none;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius-small);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.pagination a:hover,
.pagination a.active {
    background-color: var(--primary-color);
    color: white;
}

/* ========== Responsive Adjustments for Blog Page ========== */
@media (max-width: 992px) {
    .articles-list {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--spacing-xxl);
    }
    .page-title h1 {
        font-size: 2.5rem;
    }
    .page-title p {
        font-size: 1.05rem;
    }
    .article-card-content h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .landing.blog-page {
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
    }

    .page-title {
        padding: var(--spacing-xl) var(--spacing-md);
        margin-bottom: var(--spacing-xxl);
    }

    .page-title h1 {
        font-size: 2.2rem;
    }

    .page-title p {
        font-size: 1rem;
    }

    .articles-list {
        grid-template-columns: 1fr; /* Stack cards vertically on smaller screens */
        gap: var(--spacing-xl);
        margin-bottom: var(--spacing-xxl);
    }

    .article-card-image {
        height: 180px;
    }

    .article-card-content {
        padding: var(--spacing-lg);
    }

    .article-card-content h3 {
        font-size: 1.15rem;
    }

    .article-card-content p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .page-title h1 {
        font-size: 1.8rem;
    }
    .page-title p {
        font-size: 0.9rem;
    }
    .article-card-content h3 {
        font-size: 1.05rem;
    }
}