/* ==============================================
   Blog Section – ksport theme harmonization
   ============================================== */

#blog-main,
#blog-detail {
    margin-top: 0;
}

/* ------ Page Breadcrumb ------ */
#blog-main .page-breadcrumb,
#blog-detail .page-breadcrumb {
    padding: 1.5rem 0 1rem;
}

/* ------ Sort/Title Bar ------ */
.blog-sortbar-items {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
}

.blog-sortbar-items li {
    display: inline-block;
}

.blog-sortbar-items li a {
    display: inline-block;
    padding: 0.5rem 1.4rem;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    font-size: 1.3rem;
    color: #555;
    text-decoration: none;
    transition: all .2s;
    line-height: 1.8;
}

.blog-sortbar-items li a:hover,
.blog-sortbar-items li.active a {
    background-color: var(--accent-600);
    color: #fff !important;
    border-color: var(--accent-600);
}

/* ------ Blog Card Grid ------ */
.page-bloglist {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
}

.page-bloglist .article-item {
    width: calc(33.33% - 1rem);
    height: auto;
    min-height: 30rem;
    border: 1px solid #f0f0f0;
    border-radius: 15px !important;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
    transition: box-shadow .25s, transform .25s;
    background: #fff;
}

.page-bloglist .article-item:hover {
    box-shadow: 0 8px 28px rgba(83, 125, 118, .14);
    transform: translateY(-4px);
}

.page-bloglist .article-item .image-box {
    width: 100%;
    height: 18rem;
    overflow: hidden;
    position: relative;
}

.page-bloglist .article-item .image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
    display: block;
}

.page-bloglist .article-item:hover .image-box img {
    transform: scale(1.06);
}

.page-bloglist .article-item .image-box .no-image {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 3rem;
}

/* Content box inside card */
.article-item .content-box {
    padding: 1.2rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-item .content-box .title-blog {
    font-size: 1.45rem;
    line-height: 1.8;
    color: #1e1e1e;
    text-align: justify;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: auto;
    margin-bottom: .8rem;
}

/* Suppress the ::before dot injected by theme */
.article-item .content-box .title-blog::before {
    display: none !important;
}

.article-item .content-box .blog-category-badge {
    display: inline-block;
    background: #fff0f2;
    color: var(--accent-600);
    font-size: 1.1rem;
    padding: .2rem .9rem;
    border-radius: 20px;
    margin-bottom: .8rem;
    text-decoration: none;
    border: 1px solid var(--accent-200);
    line-height: 1.8;
    transition: all .2s;
}

.article-item .content-box .blog-category-badge:hover {
    background: var(--accent-600);
    color: #fff;
}

.article-item .content-box .blog-excerpt {
    font-size: 1.2rem;
    color: #777;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: .8rem;
    flex: 1;
}

.article-item .content-box .blog-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .8rem;
    font-size: 1.15rem;
    color: #999;
    margin-top: auto;
    padding-top: .8rem;
    border-top: 1px solid #f5f5f5;
    font-family: "iransans-fa";
}

.article-item .content-box .blog-meta span {
    display: flex;
    align-items: center;
    gap: .3rem;
}

.article-item .content-box .blog-meta i {
    color: var(--accent-600);
    font-size: 1.2rem;
}

/* ------ Pagination ------ */
.blog-paging {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.blog-paging .pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .4rem;
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
}

.blog-paging .pagination .page-item {
    width: 3.8rem;
    height: 3.8rem;
    background: #f8f8f8;
    border: 1px solid #e5e5e5;
    text-align: center;
    line-height: 3.6rem;
    border-radius: 8px !important;
    font-family: "iransans-fa" !important;
    margin: 0 !important;
    transition: all .2s;
}

.blog-paging .pagination .page-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #555;
    font-size: 1.3rem;
    text-decoration: none !important;
}

.blog-paging .pagination .page-item:hover {
    background-color: var(--accent-600) !important;
    border-color: var(--accent-600) !important;
}

.blog-paging .pagination .page-item:hover a {
    color: #fff !important;
}

.blog-paging .pagination .page-item.active {
    background-color: var(--accent-600) !important;
    border-color: var(--accent-600) !important;
}

.blog-paging .pagination .page-item.active a {
    color: #fff !important;
}

.blog-paging .pagination .page-item.disabled {
    opacity: .45;
    pointer-events: none;
}

/* ------ Sidebar ------ */
.blog-sidebar .widget {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
    margin-bottom: 2rem;
    padding: 1.5rem;
}

.blog-sidebar .widget-title {
    font-size: 1.5rem;
    color: #1a1a1a;
    display: block;
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--accent-600);
}

.blog-sidebar .widget-search-btn {
    position: relative;
}

.blog-sidebar .widget-search-btn input {
    width: 100%;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: .8rem 4rem .8rem 1.2rem;
    font-size: 1.3rem;
    font-family: "IRANYekanMedium";
    color: #444;
}

.blog-sidebar .widget-search-btn input:focus {
    border-color: var(--accent-600);
    outline: none;
}

.blog-sidebar .widget-search-btn button {
    position: absolute;
    left: .6rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent-600);
    border: none;
    border-radius: 6px;
    width: 2.8rem;
    height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
}

.blog-sidebar .widget-category-list {
    border-top: none !important;
}

.blog-sidebar .widget-category-list ul {
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
}

.blog-sidebar .widget-category-list ul li {
    display: block;
    border-bottom: 1px solid #f5f5f5;
    margin-bottom: 0 !important;
}

.blog-sidebar .widget-category-list ul li:last-child {
    border-bottom: none;
}

.blog-sidebar .widget-category-list ul li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .7rem 0;
    color: #444;
    font-size: 1.3rem;
    text-decoration: none;
    transition: color .2s;
}

.blog-sidebar .widget-category-list ul li a:hover,
.blog-sidebar .widget-category-list ul li.active-cat a {
    color: var(--accent-600) !important;
}

.blog-sidebar .widget-category-list ul li.active-cat a {
    font-weight: bold !important;
}

.blog-sidebar .widget-category-list ul li a::before {
    display: none;
}

/* ------ Empty State ------ */
.blog-empty-state {
    text-align: center;
    padding: 5rem 2rem;
    color: #bbb;
    width: 100%;
}

.blog-empty-state i {
    font-size: 5rem;
    display: block;
    margin-bottom: 1.5rem;
}

.blog-empty-state h2 {
    font-size: 1.6rem;
    color: #999;
    margin-bottom: 1rem;
}

.blog-empty-state a {
    display: inline-block;
    margin-top: 1rem;
    background: var(--accent-600);
    color: #fff !important;
    border-radius: 8px;
    padding: .8rem 2.5rem;
    font-size: 1.3rem;
    text-decoration: none;
    transition: background .2s;
}

.blog-empty-state a:hover {
    background: var(--accent-800);
}

/* ==============================================
   Blog Detail Page
   ============================================== */

.blog-detail-wrap {
    background: #fff;
    border-radius: 15px;
    padding: 2.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
}

.blog-detail-category {
    display: inline-block;
    background: #fff0f2;
    color: var(--accent-600);
    font-size: 1.2rem;
    padding: .3rem 1.2rem;
    border-radius: 20px;
    margin-bottom: 1rem;
    text-decoration: none;
    border: 1px solid var(--accent-200);
}

.blog-detail-title {
    font-size: 2.2rem;
    line-height: 1.8;
    color: #1a1a1a;
    margin-bottom: 1.2rem;
}

.blog-detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-family: "iransans-fa";
    font-size: 1.2rem;
    color: #888;
    padding: 1rem 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 1.5rem;
}

.blog-detail-meta span,
.blog-detail-meta a {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: #888;
    text-decoration: none;
    transition: color .2s;
}

.blog-detail-meta a:hover {
    color: var(--accent-600);
}

.blog-detail-meta i {
    color: var(--accent-600);
    font-size: 1.3rem;
}

.blog-cover-img {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.blog-cover-img img {
    width: 100%;
    height: auto;
    max-height: 45rem;
    object-fit: cover;
    display: block;
}

.blog-audio-box {
    background: #f8f8f8;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-right: 3px solid var(--accent-600);
    display: flex;
    flex-direction: column;
    gap: .8rem;
}

.blog-audio-box label {
    font-size: 1.3rem;
    color: #555;
}

.blog-audio-box audio {
    width: 100%;
}

/* Tags */
.blog-tags {
    padding: 1.2rem 0;
    border-top: 1px solid #f0f0f0;
    margin-top: 2rem;
}

.blog-tag {
    display: inline-block;
    background: #f8f8f8;
    color: #555;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: .3rem 1.2rem;
    font-size: 1.2rem;
    margin: .3rem;
    text-decoration: none;
    transition: all .2s;
}

.blog-tag:hover {
    background: var(--accent-600);
    color: #fff !important;
    border-color: var(--accent-600);
}

/* Share */
.blog-share {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .8rem;
    padding: 1.2rem 0;
    border-top: 1px solid #f0f0f0;
    margin-top: .5rem;
}

.blog-share > span {
    font-size: 1.3rem;
    color: #666;
}

.blog-share a,
.blog-share button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.8rem;
    height: 3.8rem;
    border-radius: 50%;
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
    color: #555;
    font-size: 1.6rem;
    text-decoration: none;
    cursor: pointer;
    transition: all .2s;

}

.blog-share a.share-telegram:hover { background: #0088cc; border-color: #0088cc; color: #fff !important; }
.blog-share a.share-twitter:hover  { background: #1da1f2; border-color: #1da1f2; color: #fff !important; }
.blog-share a.share-whatsapp:hover { background: #25d366; border-color: #25d366; color: #fff !important; }
.blog-share button.share-copy:hover{ background: var(--accent-600); border-color: var(--accent-600); color: #fff !important; }

.comment-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.comment-vote {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
    color: #777;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all .2s;
}

.comment-vote:disabled { opacity: .6; cursor: default; }
.comment-vote:hover:not(:disabled) { border-color: #ccc; color: #333; }
.comment-like.voted { background: #eaf7ef; border-color: #2e9e5b; color: #2e9e5b; }
.comment-dislike.voted { background: var(--accent-50); border-color: var(--accent-600); color: var(--accent-600); }
.comment-vote .vote-count { min-width: 1.2rem; }

/* PDF box */
.blog-pdf-box {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: #fff8f9;
    border: 1px solid var(--accent-200);
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.blog-pdf-icon {
    font-size: 2.8rem;
    color: var(--accent-600);
}

.blog-pdf-box p {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: .3rem !important;
}

.blog-pdf-box a {
    font-size: 1.2rem;
    color: var(--accent-600) !important;
    text-decoration: none;
}

/* ------ Comments ------ */
.blog-comments-wrap {
    background: #fff;
    border-radius: 15px;
    padding: 2.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
    margin-top: 2rem;
}

.blog-comments-wrap h2 {
    font-size: 1.7rem;
    color: #1a1a1a;
    padding-bottom: .8rem;
    border-bottom: 2px solid var(--accent-600);
    margin-bottom: 2rem;
}

.comment-item {
    display: flex;
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.comment-avatar {
    width: 4.4rem;
    height: 4.4rem;
    border-radius: 50%;
    background: var(--accent-600);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.comment-bubble {
    background: #f8f8f8;
    border-radius: 10px;
    padding: 1.2rem 1.5rem;
    flex: 1;
}

.comment-bubble .comment-name {
    font-size: 1.3rem;
    font-weight: bold !important;
    color: #222;
}

.comment-bubble .comment-date {
    font-size: 1.1rem;
    color: #aaa;
}

.comment-bubble .comment-text {
    font-size: 1.3rem;
    line-height: 2;
    color: #555;
    margin-top: .7rem !important;
}

.comment-reply {
    margin-right: 3.5rem;
    margin-top: 1rem;
}

.comment-reply .comment-avatar {
    width: 3.6rem;
    height: 3.6rem;
    background: #667942;
    font-size: 1.4rem;
}

.comment-reply .comment-bubble {
    background: #fff;
    border-right: 3px solid #667942;
}

.blog-comment-form {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #f0f0f0;
}

.blog-comment-form h3 {
    font-size: 1.6rem;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
}

.blog-comment-form label {
    font-size: 1.3rem;
    color: #555;
    display: block;
    margin-bottom: .4rem;
}

.blog-comment-form .cf-input {
    width: 100%;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: .85rem 1.2rem;
    font-size: 1.3rem;
    font-family: "IRANYekanMedium";
    color: #333;
    margin-bottom: 1.2rem;
    display: block;
    transition: border-color .2s;
}

.blog-comment-form .cf-input:focus {
    border-color: var(--accent-600);
    outline: none;
    box-shadow: 0 0 0 3px rgba(83, 125, 118, .1);
}

.blog-comment-form textarea.cf-input {
    min-height: 12rem;
    resize: vertical;
}

.blog-comment-form .btn-submit {
    background: var(--accent-600);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 1rem 3rem;
    font-size: 1.4rem;
    font-family: "IRANYekanMedium";
    cursor: pointer;
    transition: background .2s;
    display: inline-block;
}

.blog-comment-form .btn-submit:hover {
    background: var(--accent-800);
}

.comment-notice {
    font-size: 1.2rem;
    color: #999;
    margin-right: 1.5rem;
}

.no-comments {
    text-align: center;
    padding: 3rem 0;
    color: #bbb;
}

.no-comments i {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

.no-comments p {
    font-size: 1.3rem;
    color: #aaa;
}

/* ------ Sidebar (detail page) ------ */
.blog-related-list {
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
}

.blog-related-list li {
    display: block;
    border-bottom: 1px solid #f5f5f5;
}

.blog-related-list li:last-child {
    border-bottom: none;
}

.blog-related-list a {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    text-decoration: none;
    transition: all .2s;
}

.blog-related-list a img {
    width: 7rem;
    height: 5rem;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.blog-related-list .related-title {
    font-size: 1.3rem;
    color: #333;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-related-list a:hover .related-title {
    color: var(--accent-600);
}

.blog-related-list .related-date {
    font-size: 1.1rem;
    color: #aaa;
    display: block;
    margin-top: .3rem;
    font-family: "iransans-fa";
}

.blog-see-all {
    display: block;
    text-align: center;
    background: transparent;
    border: 1px solid var(--accent-600);
    color: var(--accent-600) !important;
    border-radius: 8px;
    padding: .8rem;
    font-size: 1.3rem;
    margin-top: 1.2rem;
    text-decoration: none;
    transition: all .2s;
}

.blog-see-all:hover {
    background: var(--accent-600);
    color: #fff !important;
}

/* ------ Responsive ------ */
@media (max-width: 1199px) {
    .page-bloglist .article-item {
        width: calc(50% - .75rem);
    }
}

@media (max-width: 767px) {
    .page-bloglist .article-item {
        width: 100%;
    }

    .blog-detail-title {
        font-size: 1.8rem;
    }

    .blog-detail-wrap,
    .blog-comments-wrap {
        padding: 1.5rem;
    }
}

.shop-sort-bar .blog-sort-link {
    display: inline-block;
    padding: 6px 14px;
    margin-inline-start: 6px;
    border-radius: 8px;
    font-size: 1.3rem;
    color: #666;
    text-decoration: none;
    transition: all .2s;
}
.shop-sort-bar .blog-sort-link:hover { background: #f5f5f5; color: var(--accent-600); }
.shop-sort-bar .blog-sort-link.active { background: var(--accent-600); color: #fff; }
/* سه قرصِ مرتب‌سازی کنارِ هم روی موبایل ۳۵ پیکسل از عرضِ صفحه می‌زدند بیرون و
   کلِ سند را پهن‌تر از دستگاه می‌کردند (اندازه‌گیری‌شده: ۴۲۵ به‌جای ۳۹۰) — یعنی
   مرورگر کلِ صفحه را کوچک می‌کرد و متن‌ها ریز می‌شدند. */
.shop-sort-bar .sort-options { flex-wrap: wrap; row-gap: 8px; }
.shop-page .page-bloglist { padding: 0; margin: 0; list-style: none; }
