/* ======================================= */
/* 1. Card Container (Grid Layout) */
/* ======================================= */
.card-container {
    /* Use CSS Grid for a flexible and responsive layout */
    display: grid;
    /* This creates columns that are at least 350px wide and fill available space */
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px; /* Space between the cards */
    padding: 30px 20px;
    margin: 0 auto;
    max-width: 1300px; /* Adjust as needed for your desired max width */
}

/* ======================================= */
/* 2. Individual Post Card Style */
/* ======================================= */
.post-card {
    background-color: #ffffff;
    border-radius: 12px; /* Softly rounded corners */
    /* Key for the 'card' look: a subtle shadow */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden; 
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    height: 100%; /* Ensures all cards in a row are the same height */
    display: flex; /* Helps ensure 100% height works correctly */
    flex-direction: column;
}

/* Make the entire card link clickable */
.post-card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Hover effect: Lifts the card and deepens the shadow */
.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* ======================================= */
/* 3. Card Image Style (.card-image) */
/* ======================================= */
.card-image {
    width: 100%;
    height: 250px; /* Increase this to make the image more prominent */
    object-fit: cover; /* Ensures the image covers the area without distortion */
    /* Match border radius of the card */
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

/* ======================================= */
/* 4. Card Content and Typography */
/* ======================================= */
.card-content {
    padding: 20px 25px 30px;
    flex-grow: 1; /* Allows content area to fill remaining vertical space */
}

.card-title {
    font-size: 1.6rem;
    color: #333;
    margin-top: 0;
    margin-bottom: 8px;
    line-height: 1.3;
}

.card-subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-top: 0;
    margin-bottom: 15px;
}

.card-excerpt {
    font-size: 1rem;
    color: #555;
    margin-bottom: 20px;
}

.card-meta {
    font-size: 0.9rem;
    color: #777;
    margin-top: auto; /* Pushes meta info to the bottom */
}

.card-date {
    display: block;
    text-transform: uppercase;
    font-weight: bold;
    color: #999;
    margin-top: 5px;
}

/* ======================================= */
/* 5. Mobile Responsiveness */
/* ======================================= */
@media (max-width: 768px) {
    .card-container {
        /* On small screens, allow cards to stack (minimum width of 100% minus padding) */
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 20px;
    }
    
    .card-image {
        height: 200px; /* Slightly smaller image on mobile */
    }

    .card-content {
        padding: 15px 20px;
    }

    .card-title {
        font-size: 1.4rem;
    }
}
