﻿/* ===== ساختار کلی صفحه (نپ / پوسته‌های مشابه) ===== */
html, body {
    height: 100%;
}

.master-wrapper-page {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.master-wrapper-content {
    flex: 1 0 auto;
}

.footer, .footer-block {
    flex: 0 0 auto;
    position: static !important;
}

/* ===== بلاگ صفحه اصلی (دسکتاپ) ===== */
@media (min-width: 992px) {

    /* فاصله از فوتر + راست‌به‌چپ */
    .home-blog {
        direction: rtl;
        padding: 24px 0;
        margin: 32px 0 56px;
    }

        /* هدر بلاگ: عنوان راست، لینک «مشاهده همه» چپ */
        .home-blog .hb-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 16px;
        }

        .home-blog .hb-title {
            margin: 0;
            font-weight: 700;
            font-size: 18px;
            line-height: 28px;
            color: #292D32;
        }

        .home-blog .hb-link {
            margin-inline-start: auto;
            font-size: 14px;
            line-height: 22px;
            color: #2563eb;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

            .home-blog .hb-link:hover {
                text-decoration: underline;
            }

        /* ریل افقی کارت‌ها (جایگزین گرید) */
        .home-blog .hb-grid {
            display: flex;
            gap: 24px;
            overflow-x: auto;
            overflow-y: hidden;
            overscroll-behavior-x: contain;
            scroll-snap-type: x mandatory;
            padding-bottom: 8px; /* کمی فاصله برای سایه‌ی اسکرول */
        }
            /* اختیاری: باریک‌کردن اسکرول‌بار */
            .home-blog .hb-grid::-webkit-scrollbar {
                height: 8px;
            }

            .home-blog .hb-grid::-webkit-scrollbar-thumb {
                background: #ddd;
                border-radius: 8px;
            }

        /* هر کارت: پهنای ثابت و اسنپ */
        .home-blog .hb-card {
            flex: 0 0 346px; /* دقیقا یک کارت با عرض ثابت */
            scroll-snap-align: start;
            text-decoration: none;
            color: inherit;
            display: flex;
            flex-direction: column;
        }

        /* تصویر کارت: 346×375 با گوشه گرد 16px و کاور */
        .home-blog .hb-img {
            width: 346px;
            height: 375px;
            border-radius: 16px;
            overflow: hidden;
            background: #f5f5f7;
        }

            .home-blog .hb-img img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                display: block;
            }

        /* عنوان: بولد، دوخطی، فاصله‌ها مطابق فیگما */
        .home-blog .hb-post-title {
            margin-top: 12px;
            font-weight: 700;
            font-size: 16px;
            line-height: 24px;
            letter-spacing: -0.36px;
            color: #292D32;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            min-height: 48px; /* برای هم‌تراز شدن کارت‌ها وقتی یک خطی شد */
        }

            .home-blog .hb-post-title:hover {
                color: #111827;
            }

        /* تاریخ */
        .home-blog .hb-date {
            margin-top: 8px;
            font-size: 12px;
            line-height: 18px;
            color: #6B7280;
        }
}


/* === Blog rail: force horizontal layout === */
.home-blog .hb-grid {
    display: flex !important;
    flex-wrap: nowrap !important; /* پشت‌سرهم */
    gap: 24px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.home-blog .hb-card {
    flex: 0 0 346px !important; /* عرض ثابت هر کارت */
    max-width: 346px !important;
    scroll-snap-align: start;
}

.home-blog .hb-img {
    width: 346px !important;
    height: 375px !important;
    border-radius: 16px;
    overflow: hidden;
    background: #f5f5f7;
}

    .home-blog .hb-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

/* تیتر و تاریخ (همون قبلی‌ها) */
.home-blog .hb-post-title {
    margin-top: 12px;
    font-weight: 700;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: -0.36px;
    color: #292D32;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 48px;
}

.home-blog .hb-date {
    margin-top: 8px;
    font-size: 12px;
    line-height: 18px;
    color: #6B7280;
}

/* فاصله‌ی سکشن از فوتر که نچسبد */
.home-blog {
    margin: 32px 0 56px;
}


/* ===== Home Blog (RTL + Swiper) ===== */
.home-blog {
    padding: 32px 0;
    margin: 32px 0 56px;
}

.hb-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.hb-title {
    margin: 0;
    font-weight: 700;
    font-size: 18px;
    line-height: 28px;
    color: #292D32;
}

.hb-link {
    margin-inline-start: auto;
    font-size: 14px;
    line-height: 22px;
    color: #2563eb;
    text-decoration: none;
}

    .hb-link:hover {
        text-decoration: underline
    }

/* Swiper base */
.hb-swiper {
    overflow: hidden;
    position: relative;
}
    /* عرض کارت دقیقاً مثل طرح */
    .hb-swiper .swiper-slide {
        width: 346px;
    }
/* slidesPerView:auto → عرض ثابت کارت */
.hb-card {
    display: block;
    color: inherit;
    text-decoration: none;
}

.hb-img {
    width: 346px;
    height: 375px;
    border-radius: 16px;
    overflow: hidden;
    background: #f5f5f7;
}

    .hb-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.hb-post-title {
    margin-top: 12px;
    font-weight: 700;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: -0.36px;
    color: #292D32;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 48px;
}

.hb-date {
    margin-top: 8px;
    font-size: 12px;
    line-height: 18px;
    color: #6B7280
}

/* فاصله بین اسلایدها */
.hb-swiper .swiper-wrapper {
    gap: 24px
}

/* ناوبری اختیاری */
.hb-nav {
    position: absolute;
    inset-inline: 0;
    top: -48px;
    display: flex;
    gap: 8px;
    justify-content: flex-start
}

.hb-prev, .hb-next {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
}

    .hb-prev::before {
        content: '‹';
        display: block;
        text-align: center;
        line-height: 26px
    }

    .hb-next::before {
        content: '›';
        display: block;
        text-align: center;
        line-height: 26px
    }

/* ریسپانسیو: روی موبایل اسلاید باریک‌تر + فاصله کمتر */
@media (max-width: 767.98px) {
    .hb-swiper .swiper-slide {
        width: 280px
    }

    .hb-img {
        width: 280px;
        height: 304px
    }

    .hb-swiper .swiper-wrapper {
        gap: 12px
    }
}
