/* RTL support for category-breadcrumb */
body.rtl .popular-posts-page .category-breadcrumb {
    direction: rtl;
    text-align: right;
}
body.rtl .popular-posts-page .category-breadcrumb .separator {
    transform: scaleX(-1);
}
/**
 * Popular Posts Page Styles
 * 4 posts per row grid layout
 */

.popular-posts-page {
    padding: 60px 0;
    background-color: var(--bg-primary);
}

.popular-posts-page .container {
    max-width: 1200px;
}

.popular-posts-page .category-header {
    margin-bottom: 40px;
}

.popular-posts-page .category-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.popular-posts-page .category-breadcrumb .current {
    color: var(--text-primary);
    font-weight: 600;
}

.popular-posts-page .category-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.popular-posts-page .category-breadcrumb a:hover {
    color: var(--sheesha-red);
}

/* Grid Layout - 4 columns */
.popular-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

/* Post Card */
.popular-post-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.popular-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Post Image */
.popular-post-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.popular-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.popular-post-card:hover .popular-post-image img {
    transform: scale(1.05);
}

/* Post Content */
.popular-post-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.popular-post-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.popular-post-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-post-title a:hover {
    color: var(--sheesha-red);
}

.popular-post-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Post Meta */
.popular-post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 12px;
    color: var(--text-secondary);
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.popular-post-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.popular-post-meta i {
    color: var(--sheesha-red);
}

/* Pagination */
.popular-posts-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 50px;
}

.popular-posts-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
}

.popular-posts-pagination .page-numbers:hover {
    background: var(--sheesha-red);
    color: white;
    border-color: var(--sheesha-red);
}

.popular-posts-pagination .page-numbers.current {
    background: var(--sheesha-red);
    color: white;
    border-color: var(--sheesha-red);
}

.popular-posts-pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

/* No Posts Message */
.popular-posts-grid .no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .popular-posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .popular-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .popular-post-image {
        height: 180px;
    }
    
    .popular-post-title {
        font-size: 15px;
    }
    
    .popular-posts-page {
        padding: 40px 0;
    }
}

@media (max-width: 576px) {
    .popular-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .popular-post-image {
        height: 220px;
    }
    
    .popular-post-title {
        font-size: 16px;
    }
    
    .popular-posts-page {
        padding: 30px 0;
    }
}

/* Dark Mode Styles */
body.dark-mode .popular-post-card {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

body.dark-mode .popular-post-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

body.dark-mode .popular-posts-pagination .page-numbers {
    background: #2a2a2a;
    border-color: #3a3a3a;
}
