/* FILE: assets/css/blog.css (Revised) */

.blog-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 1.5rem;
}

.blog-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.blog-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.blog-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Base grid for desktop */
.blog-posts-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Default to 5 columns */
    gap: 1.5rem;
    align-items: stretch; /* Ensures tiles in a row have the same height */
}

.blog-post-tile {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.blog-post-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.post-tile-image {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.post-tile-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
}

.post-tile-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.post-tile-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.post-tile-meta {
    font-size: 0.8rem;
    color: #9ca3af;
    border-top: 1px solid var(--border-color);
    padding-top: 0.8rem;
    margin-top: auto; 
}

.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- RESPONSIVE ADJUSTMENTS --- */

/* For smaller desktops and large tablets */
@media (max-width: 1200px) {
    .blog-posts-container {
        grid-template-columns: repeat(4, 1fr); /* 4 columns */
    }
}

/* For standard tablets */
@media (max-width: 992px) {
    .blog-posts-container {
        grid-template-columns: repeat(3, 1fr); /* 3 columns */
    }
}

/* For mobile phones */
@media (max-width: 768px) {
    .blog-posts-container {
        grid-template-columns: 1fr; /* Switch to a single column */
    }
}