/* Latest Posts Styles */
.latest-posts-section {
    padding: 20px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #333333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title .icon-wrapper {
    display: inline-flex;
    align-items: center;
}

.section-title img {
    width: 24px;
    height: 24px;
}

body.dark-mode .section-title {
    color: #ffffff;
}

.latest-posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.latest-post {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 15px;
    justify-content: space-between;
}

body.dark-mode .latest-post {
    border-bottom: 1px solid #2a2a2a;
}

.post-details-container {
    flex: 0 0 65%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
}

.post-image-container {
    flex: 0 0 30%;
}

.post-image-container .post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 16px;
    transition: opacity 0.3s ease;
}

.post-image-container:hover .post-image {
    opacity: 0.7;
}

.post-category a {
    font-size: 14px;
    color: #666666;
    text-decoration: none;
}

body.dark-mode .post-category a {
    color: #cccccc;
}

.post-category a:hover {
    color: #e20a0b;
}

.post-title {
    font-size: 18px;
    font-weight: 800;
    color: #333333;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark-mode .post-title {
    color: #ffffff;
}

.post-title a {
    color: inherit;
    text-decoration: none;
}

.post-title a:hover {
    color: #e20a0b;
}

.post-excerpt-last {
    font-size: 13px;
    color: #666666;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark-mode .post-excerpt-last {
    color: #cccccc;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666666;
}

body.dark-mode .post-author {
    color: #cccccc;
}

.post-author .author-image {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.post-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666666;
}

body.dark-mode .post-stats {
    color: #cccccc;
}

.post-stats .post-time,
.post-stats .post-views,
.post-stats .post-comments {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-stats .post-time img,
.post-stats .post-views img,
.post-stats .post-comments img {
    width: 16px;
    height: 16px;
}

body.dark-mode .post-stats img {
    filter: brightness(0) invert(1);
}

.post-stats .separator {
    color: #666666;
}

body.dark-mode .post-stats .separator {
    color: #cccccc;
}

.load-more-container {
    text-align: center;
    margin-top: 30px;
}

.load-more-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #e20a0b;
    color: #ffffff;
    text-decoration: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
}

.load-more-button:hover {
    background-color: #c3090a;
}

@media (max-width: 768px) {
    .section-title {
        font-size: 20px;
    }

    .section-title img {
        width: 20px;
        height: 20px;
    }

    .latest-post {
        flex-direction: row;
        gap: 10px;
        justify-content: space-between;
    }

    .post-details-container {
        flex: 0 0 65%;
        justify-content: center;
        gap: 8px;
    }

    .post-image-container {
        flex: 1;
        display: flex;
        justify-content: flex-end;
    }

    .post-image-container .post-image {
        width: 120px;
        height: 120px;
        border-radius: 8px;
    }

    .post-category a {
        font-size: 12px;
    }

    .post-title {
        font-size: 16px;
        -webkit-line-clamp: 2;
    }

    .post-excerpt-last {
        display: none; /* مخفی کردن چکیده در موبایل */
    }

    .post-meta {
        gap: 10px;
    }

    .post-author {
        display: none !important;
    }

    .post-stats {
        font-size: 11px;
    }

    .post-stats img {
        width: 14px;
        height: 14px;
    }
}

/* تنظیم استایل صفحه‌بندی */
.gamiato-posts-pagination {
    text-align: center;
    margin: 30px 0;
}

.gamiato-posts-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.gamiato-posts-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #f5f5f5;
    border-radius: 12px;
    font-size: 14px;
    font-family: 'IRANSansX', sans-serif;
    color: #333333;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode .gamiato-posts-pagination .page-numbers {
    background-color: #333333;
    color: #ffffff;
}

.gamiato-posts-pagination .page-numbers.current {
    background-color: #e20a0b;
    color: #ffffff;
}

body.dark-mode .gamiato-posts-pagination .page-numbers.current {
    background-color: #e20a0b;
    color: #ffffff;
}

.gamiato-posts-pagination .page-numbers:hover:not(.current) {
    background-color: #e20a0b;
    color: #ffffff;
}

@media (max-width: 768px) {
    .gamiato-posts-pagination .page-numbers {
        width: 35px;
        height: 35px;
        font-size: 13px;
    }
}

/* Skeleton Loading Styles */
.latest-post.skeleton {
    opacity: 0.7;
}

.latest-post.skeleton a,
.latest-post.skeleton p,
.latest-post.skeleton img:not(.skeleton-circle),
.latest-post.skeleton span:not(.skeleton-text) {
    display: none;
}

.latest-post.skeleton .skeleton-text,
.latest-post.skeleton .skeleton-circle,
.latest-post.skeleton .skeleton-image {
    display: inline-block;
}

.skeleton-text {
    background: #e0e0e0;
    border-radius: 4px;
    animation: shimmer 1.5s infinite;
}

body.dark-mode .skeleton-text {
    background: #444;
}

.skeleton-short {
    width: 60px;
    height: 14px;
}

.skeleton-medium {
    width: 150px;
    height: 18px;
}

.skeleton-long {
    width: 200px;
    height: 13px;
}

.skeleton-circle {
    background: #e0e0e0;
    border-radius: 50%;
    animation: shimmer 1.5s infinite;
}

body.dark-mode .skeleton-circle {
    background: #444;
}

.skeleton-circle.skeleton-small {
    width: 16px;
    height: 16px;
}

.author-image.skeleton-circle {
    width: 24px;
    height: 24px;
}

.skeleton-image {
    width: 100%;
    height: 200px;
    background: #e0e0e0;
    border-radius: 16px;
    animation: shimmer 1.5s infinite;
}

body.dark-mode .skeleton-image {
    background: #444;
}

@media (max-width: 768px) {
    .skeleton-image {
        width: 120px;
        height: 120px;
        border-radius: 8px;
    }

    .skeleton-long {
        display: none; /* مخفی کردن اسکلت چکیده در موبایل */
    }
}

@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

.skeleton-text, .skeleton-circle, .skeleton-image {
    background: linear-gradient(to right, #e0e0e0 8%, #d0d0d0 18%, #e0e0e0 33%);
    background-size: 800px 104px;
}

body.dark-mode .skeleton-text,
body.dark-mode .skeleton-circle,
body.dark-mode .skeleton-image {
    background: linear-gradient(to right, #444 8%, #555 18%, #444 33%);
    background-size: 800px 104px;
}