/* assets/css/posts-grid.css */

.posts-grid-container {
    position: relative;
    margin: 30px 0;
}

.posts-grid-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
}

.posts-grid-container.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #333;
    border-radius: 50%;
    z-index: 11;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.posts-grid-header {
    margin-bottom: 30px;
}

.posts-grid-title {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
}

/* Grid Layout */
.articles-grid {
    display: grid;
}

.articles-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.articles-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.articles-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 991px) {
    .articles-grid.columns-3,
    .articles-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .articles-grid.columns-2,
    .articles-grid.columns-3,
    .articles-grid.columns-4 {
        grid-template-columns: 1fr;
    }
}

/* Pagination */
.posts-grid-pagination {
    margin-top: 40px;
    text-align: center;
}

.posts-grid-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.posts-grid-nav .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.posts-grid-nav .page-link:hover {
    background: #f5f5f5;
    border-color: #333;
}

.posts-grid-nav .page-link.current {
    background: #333;
    border-color: #333;
    color: #fff;
    cursor: default;
}

.posts-grid-nav .page-dots {
    padding: 0 8px;
    color: #999;
}

.posts-grid-nav .prev-page,
.posts-grid-nav .next-page {
    padding: 0 16px;
}

/* No posts message */
.no-posts-found {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.no-posts-found h2 {
    margin: 0 0 10px;
    font-size: 22px;
}

.no-posts-found p {
    margin: 0;
    color: #666;
}
