/* Popular Posts Ranking - Frontend Styles */

/* Base container */
.ppr-popular-posts {
    margin: 30px 0;
}

.ppr-popular-posts .ppr-title {
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: 600;
    color: inherit;
    line-height: 1.4;
}

/* Posts container */
.ppr-posts {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Individual post */
.ppr-post {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    position: relative;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.ppr-post:last-child {
    border-bottom: none;
}

.ppr-post:hover {
    transform: translateX(5px);
}

/* Rank number */
.ppr-rank {
    font-size: 24px;
    font-weight: 700;
    color: #888;
    min-width: 30px;
    text-align: center;
    line-height: 1;
}

/* Thumbnail */
.ppr-thumbnail {
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 5px;
}

.ppr-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ppr-thumbnail:hover img {
    transform: scale(1.05);
}

/* Content */
.ppr-content {
    flex: 1;
}

.ppr-post-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.4;
}

.ppr-post-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ppr-post-title a:hover {
    color: #27cbc0; /* Salient theme accent color */
}

/* Meta info */
.ppr-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #888;
    margin-bottom: 10px;
}

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

.ppr-meta i {
    font-size: 14px;
    opacity: 0.7;
}

/* Excerpt */
.ppr-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin-top: 10px;
}

/* Grid style */
.ppr-style-grid .ppr-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.ppr-style-grid .ppr-post {
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.ppr-style-grid .ppr-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.ppr-style-grid .ppr-rank {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #27cbc0;
    color: #fff;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 10;
}

.ppr-style-grid .ppr-thumbnail {
    width: 100%;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.ppr-style-grid .ppr-thumbnail img {
    width: 100%;
    height: 180px;
}

/* Minimal style */
.ppr-style-minimal .ppr-post {
    padding: 10px 0;
    gap: 10px;
}

.ppr-style-minimal .ppr-post-title {
    font-size: 16px;
    margin-bottom: 5px;
}

.ppr-style-minimal .ppr-thumbnail {
    display: none;
}

.ppr-style-minimal .ppr-excerpt {
    display: none;
}

.ppr-style-minimal .ppr-meta {
    font-size: 12px;
}

/* Dark mode support for Salient */
body[data-color-scheme="dark"] .ppr-post {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body[data-color-scheme="dark"] .ppr-style-grid .ppr-post {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.1);
}

body[data-color-scheme="dark"] .ppr-excerpt {
    color: #aaa;
}

body[data-color-scheme="dark"] .ppr-meta {
    color: #999;
}

/* Responsive */
@media (max-width: 768px) {
    .ppr-posts {
        gap: 15px;
    }
    
    .ppr-post {
        gap: 10px;
        padding: 10px 0;
    }
    
    .ppr-thumbnail img {
        width: 60px;
        height: 60px;
    }
    
    .ppr-post-title {
        font-size: 16px;
    }
    
    .ppr-rank {
        font-size: 20px;
        min-width: 25px;
    }
    
    .ppr-style-grid .ppr-posts {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* No posts message */
.ppr-no-posts {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 16px;
}

/* Loading state */
.ppr-popular-posts.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ppr-post {
    animation: fadeIn 0.5s ease forwards;
}

.ppr-post:nth-child(1) { animation-delay: 0.1s; }
.ppr-post:nth-child(2) { animation-delay: 0.2s; }
.ppr-post:nth-child(3) { animation-delay: 0.3s; }
.ppr-post:nth-child(4) { animation-delay: 0.4s; }
.ppr-post:nth-child(5) { animation-delay: 0.5s; }