/**
 * Filtered Posts - Styles
 * CSS for category filters and posts grid
 */

/* ============================================
   Category Filters
   ============================================ */

.filtered-posts-categories {
    margin-bottom: 30px;
    padding: 20px 0;
}

.filter-category {
    display: inline-block;
    margin: 0 10px 10px 10px;
    padding: 10px 20px;
    background-color: #f5f5f5;
    color: #666666;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
}

.filter-category:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-category.active {
    background-color: #0073aa;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(0, 115, 170, 0.3);
}

.filter-category:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* ============================================
   Posts Grid
   ============================================ */

.filtered-posts-wrapper {
    position: relative;
}

.filtered-posts-container {
    position: relative;
    min-height: 300px;
}

.filtered-posts-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
    transition: opacity 0.3s ease;
}

/* Grid Columns */
.filtered-posts-grid.columns-1 {
    grid-template-columns: 1fr;
}

.filtered-posts-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.filtered-posts-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.filtered-posts-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.filtered-posts-grid.columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Responsive Grid */
@media (max-width: 1024px) {

    .filtered-posts-grid.columns-4,
    .filtered-posts-grid.columns-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {

    .filtered-posts-grid.columns-3,
    .filtered-posts-grid.columns-4,
    .filtered-posts-grid.columns-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: Single column for better readability */
@media (max-width: 600px) {
    .filtered-posts-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   Post Item
   ============================================ */

.filtered-post-item {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.filtered-post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.filtered-post-item .post-thumbnail {
    overflow: hidden;
    position: relative;
    padding-bottom: 66.67%;
    /* 3:2 aspect ratio */
    background: #f5f5f5;
}

.filtered-post-item .post-thumbnail a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.filtered-post-item .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.filtered-post-item:hover .post-thumbnail img {
    transform: scale(1.05);
}

.filtered-post-item .post-content {
    padding: 20px;
}

.filtered-post-item .post-title {
    margin: 0 0 15px 0;
    font-size: 20px;
    line-height: 1.4;
}

.filtered-post-item .post-title a {
    color: #333333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.filtered-post-item .post-title a:hover {
    color: #0073aa;
}

.filtered-post-item .post-excerpt {
    margin: 0 0 15px 0;
    color: #666666;
    font-size: 14px;
    line-height: 1.6;
}

.filtered-post-item .read-more {
    display: inline-block;
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.3s ease;
}

.filtered-post-item .read-more:hover {
    color: #005177;
    text-decoration: underline;
}

/* ============================================
   No Posts Found
   ============================================ */

.no-posts-found {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    grid-column: 1 / -1;
    /* Span all columns */
}

.no-posts-found p {
    margin: 0;
    color: #666666;
    font-size: 16px;
}

/* ============================================
   Pagination
   ============================================ */

.filtered-posts-pagination {
    margin-top: 40px;
    margin-bottom: 40px;
}

.pagination-wrapper {
    text-align: center;
}

.pagination-wrapper .page-numbers {
    display: inline-block;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination-wrapper .page-numbers li {
    display: inline-block;
    margin: 0 3px;
}

.pagination-wrapper .page-numbers a,
.pagination-wrapper .page-numbers span {
    display: inline-block;
    min-width: 40px;
    padding: 10px 15px;
    background: #ffffff;
    color: #666666;
    border: 1px solid #dddddd;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    line-height: 1;
}

.pagination-wrapper .page-numbers a:hover {
    background: #0073aa;
    color: #ffffff;
    border-color: #0073aa;
}

.pagination-wrapper .page-numbers .current {
    background: #0073aa;
    color: #ffffff;
    border-color: #0073aa;
}

.pagination-wrapper .page-numbers .dots {
    border: none;
    background: transparent;
    cursor: default;
}

/* ============================================
   Loading Spinner
   ============================================ */

.filtered-posts-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.filtered-posts-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ============================================
   Accessibility
   ============================================ */

.filter-category:focus-visible,
.pagination-wrapper .page-numbers a:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* ============================================
   RTL Support
   ============================================ */

.rtl .filter-category {
    margin: 0 10px 10px 10px;
}

.rtl .filtered-posts-grid {
    direction: rtl;
}