/**
 * Blog Pages Styles
 * استایل صفحات وبلاگ
 */

/* ==================== Blog List Page ==================== */
.blogs-list-section {
    padding: 30px 0 50px;
}

.blog-list-section {
    padding: 40px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.section-description {
    font-size: 16px;
    color: #666;
}

.blogs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.blog-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.blog-image-link {
    display: block;
    overflow: hidden;
}

.blog-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s;
}

.blog-card:hover .blog-image {
    transform: scale(1.05);
}

.blog-content {
    padding: 20px;
}

.blog-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.blog-title a {
    color: #333;
    text-decoration: none;
}

.blog-title a:hover {
    color: #007bff;
}

.blog-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
}

.blog-meta i {
    margin-left: 5px;
}

.blog-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-read-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #007bff;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.blog-read-more:hover {
    text-decoration: underline;
}

/* Skeleton */
.blog-card.skeleton {
    pointer-events: none;
}

.blog-card.skeleton .blog-image {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-text {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-text.short {
    width: 60%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.pagination {
    display: flex;
    list-style: none;
    gap: 5px;
    padding: 0;
    margin: 0;
}

.page-item {
    display: inline-block;
}

.page-link {
    display: block;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
}

.page-link:hover {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.page-item.active .page-link {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.page-item.disabled .page-link {
    color: #999;
    pointer-events: none;
}

/* Empty & Error States */
.empty-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state i,
.error-state i {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state h3,
.error-state h3 {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.empty-state p,
.error-state p {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

/* ==================== Blog Detail Page ==================== */
.blog-detail-section {
    padding: 40px 0;
}

.blog-detail-skeleton {
    max-width: 900px;
    margin: 0 auto;
}

.skeleton-title {
    height: 40px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
    margin-bottom: 20px;
}

.skeleton-meta {
    height: 20px;
    width: 300px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 30px;
}

.skeleton-image {
    height: 400px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 12px;
    margin-bottom: 30px;
}

.skeleton-content {
    margin-bottom: 20px;
}

.blog-detail {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.blog-header {
    margin-bottom: 30px;
}

.blog-detail .blog-title {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.4;
}

.blog-detail .blog-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #999;
}

.blog-image-container {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
}

.blog-detail .blog-image {
    width: 100%;
    height: auto;
    display: block;
}

.blog-body {
    font-size: 16px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 30px;
}

.blog-body h2,
.blog-body h3,
.blog-body h4 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: #333;
}

.blog-body p {
    margin-bottom: 15px;
}

.blog-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.blog-tags {
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.tag {
    display: inline-block;
    padding: 6px 14px;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
}

/* Comments Section */
.comments-section {
    max-width: 900px;
    margin: 40px auto 0;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.comment-form-container {
    margin-bottom: 30px;
}

.comment-form-container h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

#comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 15px;
}

#comment-form button {
    padding: 10px 24px;
}

.login-prompt {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 30px;
}

.login-prompt a {
    color: #007bff;
    font-weight: 500;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-card {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.comment-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #333;
}

.comment-date {
    font-size: 13px;
    color: #999;
}

.comment-body p {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

.no-comments {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .blogs-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .blog-detail {
        padding: 20px;
    }

    .blog-detail .blog-title {
        font-size: 24px;
    }

    .blog-detail .blog-meta {
        flex-direction: column;
        gap: 8px;
    }

    .comments-section {
        padding: 20px;
    }
}
