/* Grid Layout for Articles with Cover Images */

.article-grid-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header styling within grid container */
.article-grid-container header {
    margin-bottom: 30px;
}

.article-grid-container h1,
.article-grid-container h2 {
    margin-top: 0;
}

.article-grid-container .page-header h1 {
    margin: 0;
    padding: 0;
}

.article-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media screen and (min-width: 768px) {
    .article-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (min-width: 1024px) {
    .article-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.article-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.article-card-cover {
    position: relative;
    width: 100%;
    height: 250px;
    background-color: #f0f0f0;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    overflow: hidden;
}

.article-card-cover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
}

.article-card-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    z-index: 1;
}

.article-card-title h2 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
    line-height: 1.3;
}

.article-card-title h2 a {
    color: #fff;
    text-decoration: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.article-card-title h2 a:hover {
    color: #f0f0f0;
}

.article-card-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9em;
    margin-top: 5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.article-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-card-summary {
    color: #555;
    font-size: 0.95em;
    line-height: 1.6;
    margin-bottom: 15px;
    flex-grow: 1;
}

.article-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    color: #888;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.article-card-category a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
}

.article-card-category a:hover {
    color: #3498db;
}

.article-card-date {
    color: #999;
}

/* Featured Article (First/Large) */
.article-card-featured {
    grid-column: 1 / -1;
}

.article-card-featured .article-card-cover {
    height: 400px;
}

@media screen and (min-width: 768px) {
    .article-card-featured .article-card-cover {
        height: 450px;
    }
}

.article-card-featured .article-card-title h2 {
    font-size: 2em;
}

/* No Cover Image Fallback */
.article-card-no-cover .article-card-cover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-card-no-cover .article-card-cover::after {
    display: none;
}

/* List View Toggle (Optional) */
.view-toggle {
    text-align: right;
    margin-bottom: 20px;
}

.view-toggle a {
    margin-left: 10px;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #555;
}

.view-toggle a.active {
    background: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
}
