﻿/* =========================================================
   HOME PAGE
   KHERADA.COM
   ========================================================= */
/* =========================================================
   Page Header — انجمن خرد
   ---------------------------------------------------------
   طراحی مینیمال و علمی/فرهنگی
   بدون کارت، بدون Hero سنگین، بدون پس‌زمینه
   ========================================================= */

.page-header {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.15rem 1rem 1rem;
    text-align: center;
    box-sizing: border-box;
}

    /* ---------------------------------------------------------
   H1
   --------------------------------------------------------- */

    .page-header .page-title {
        margin: 0;
        font-size: clamp(1.75rem, 2.5vw, 2rem);
        font-weight: 700;
        line-height: 1.5;
        color: var(--text-primary, #222);
        letter-spacing: -0.02em;
    }

    /* ---------------------------------------------------------
   توضیح زیر عنوان
   --------------------------------------------------------- */

    .page-header .page-subtitle {
        max-width: 850px;
        margin: .35rem auto 0;
        font-size: clamp(.85rem, 1.3vw, .98rem);
        font-weight: 400;
        line-height: 1.8;
        color: var(--text-secondary, #777);
    }

    /* ---------------------------------------------------------
   خط بسیار ظریف زیر معرفی
   برای ایجاد تفکیک بصری بدون ایجاد کارت
   --------------------------------------------------------- */

    .page-header::after {
        content: "";
        display: block;
        width: 54px;
        height: 2px;
        margin: .8rem auto 0;
        background: currentColor;
        opacity: .18;
        border-radius: 2px;
    }


/* =========================================================
   Desktop
   ========================================================= */

@media (min-width: 1025px) {

    .page-header {
        padding-top: 1.2rem;
        padding-bottom: 1rem;
    }

        .page-header .page-title {
            font-size: 2rem;
        }

        .page-header .page-subtitle {
            font-size: .95rem;
        }
         .page-subtitle {
            text-align:center;
        }
}


/* =========================================================
   Tablet
   ========================================================= */

@media (min-width: 769px) and (max-width: 1024px) {

    .page-header {
        padding: 1rem .9rem .85rem;
    }

        .page-header .page-title {
            font-size: 1.75rem;
        }

        .page-header .page-subtitle {
            font-size: .9rem;
        }
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 768px) {

    .page-header {
        padding: .85rem .8rem .75rem;
    }

        .page-header .page-title {
            font-size: 1.45rem;
            line-height: 1.55;
        }

        .page-header .page-subtitle {
            margin-top: .3rem;
            font-size: .82rem;
            line-height: 1.75;
        }

        .page-header::after {
            width: 42px;
            height: 2px;
            margin-top: .65rem;
        }
}


/* =========================================================
   Small Mobile
   ========================================================= */

@media (max-width: 480px) {

    .page-header {
        padding: .7rem .65rem .65rem;
    }

        .page-header .page-title {
            font-size: 1.3rem;
        }

        .page-header .page-subtitle {
            font-size: .78rem;
            line-height: 1.7;
        }
}

/* =========================================================
   1. SINGLE ITEM CAROUSELS
   =========================================================

   اسلایدرهای تک‌آیتمی با JavaScript از translateX(-index*100%)
   استفاده می‌کنند؛ بنابراین نباید بین آیتم‌ها gap وجود داشته باشد.
   ========================================================= */

.carousel-container {
    gap: 0 !important;
}


/* =========================================================
   2. آخرین مطالب — چیدمان مجله‌ای «شاخص + فهرست»
   ========================================================= */

.latest-section {
    margin: 2.5rem 0;
}

.latest-header {
    margin-bottom: 1.2rem;
}

.latest-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

.latest-featured {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e7eaf0;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .25s ease, transform .25s ease;
}

    .latest-featured:hover {
        box-shadow: 0 14px 28px rgba(33, 48, 116, .14);
        transform: translateY(-4px);
    }

.latest-featured-image {
    aspect-ratio: 16 / 8;
    overflow: hidden;
}

    .latest-featured-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform .5s ease;
    }

.latest-featured:hover .latest-featured-image img {
    transform: scale(1.04);
}

.latest-featured-body {
    padding: 1.2rem 1.4rem 1.5rem;
    direction: rtl;
    text-align: right;
}

.latest-date,
.latest-item-date {
    display: inline-block;
    font-size: .78rem;
    color: #213074;
    background: #eef1fb;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700;
    margin-bottom: .6rem;
}

.latest-featured-body h3 {
    font-size: 1.3rem;
    margin: 0 0 .6rem;
    color: #1b1b1b;
    line-height: 1.5;
}

.latest-featured-body p {
    color: #555;
    font-size: .95rem;
    line-height: 1.8;
    margin: 0;
}

.latest-list {
    display: flex;
    flex-direction: column;
    gap: .9rem;
    direction: rtl;
}

.latest-item {
    display: flex;
    gap: .9rem;
    background: #fff;
    border: 1px solid #e7eaf0;
    border-radius: 12px;
    padding: .6rem;
    text-decoration: none;
    color: inherit;
    text-align: right;
    transition: border-color .2s ease, box-shadow .2s ease;
}

    .latest-item:hover {
        border-color: #213074;
        box-shadow: 0 6px 16px rgba(33, 48, 116, .1);
    }

.latest-item-image {
    flex: 0 0 90px;
    width: 90px;
    height: 90px;
    border-radius: 10px;
    overflow: hidden;
}

    .latest-item-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.latest-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

    .latest-item-body h4 {
        font-size: .95rem;
        margin: 0 0 .4rem;
        line-height: 1.5;
        color: #1b1b1b;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

.latest-item-date {
    margin-bottom: 0;
    width: fit-content;
}

@media (max-width: 900px) {

    .latest-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   3. SHELF
   ========================================================= */

.shelf-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.carousel-title--inline {
    margin-bottom: 0;
}

.shelf-nav {
    display: flex;
    gap: .5rem;
    flex-shrink: 0;
}

.shelf-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #dde1ec;
    background: #fff;
    color: #213074;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, color .2s ease, transform .15s ease;
}

    .shelf-btn:hover:not(:disabled) {
        background: #213074;
        color: #fff;
    }

    .shelf-btn:active:not(:disabled) {
        transform: scale(.92);
    }

    .shelf-btn:disabled {
        opacity: .35;
        cursor: default;
        pointer-events: none;
    }

.shelf {
    display: flex;
    direction: rtl;
    gap: 1.1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;
    padding: .2rem .2rem .8rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

    .shelf::-webkit-scrollbar {
        display: none;
    }


/* =========================================================
   4. VIDEO CARDS
   ========================================================= */

.video-carousel-section {
    margin: 2.5rem 0;
}

.video-card {
    flex: 0 0 calc((100% - 2.2rem) / 3);
    width: calc((100% - 2.2rem) / 3);
    box-sizing: border-box;
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid #e7eaf0;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    direction: rtl;
    text-align: right;
    transition: box-shadow .25s ease, transform .25s ease;
}

    .video-card:hover {
        box-shadow: 0 12px 24px rgba(33, 48, 116, .14);
        transform: translateY(-4px);
    }

.video-card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}

    .video-card-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: .88;
    }

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(33, 48, 116, .85);
    color: #fff;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
    transition: background .2s ease, transform .2s ease;
}

.video-card:hover .video-play-btn {
    background: #213074;
    transform: translate(-50%, -50%) scale(1.08);
}

.video-card-body {
    padding: .85rem 1rem 1.05rem;
}

    .video-card-body h3 {
        font-size: .96rem;
        line-height: 1.6;
        margin: 0;
        color: #1b1b1b;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

@media (max-width: 900px) {

    .video-card {
        flex-basis: calc((100% - 1.1rem) / 2);
        width: calc((100% - 1.1rem) / 2);
    }
}


/* =========================================================
   5. TOPICS
   ========================================================= */

.topics-section {
    margin: 2.5rem 0;
}

.topic-block {
    margin-bottom: 2.6rem;
}


/* =========================================================
   6. HERO SLIDER — CORE
   ========================================================= */

.hero-slider {
    display: flex;
    direction: rtl;
    gap: 1.2rem;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.hero-main {
    position: relative;
    flex: 0 0 50%;
    min-width: 0;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #111;
}

.hero-track {
    display: flex;
    width: 100%;
    height: 100%;
    direction: ltr;
    transition: transform .8s cubic-bezier(.25, .8, .25, 1);
    will-change: transform;
}

.hero-slide {
    position: relative;
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: block;
    text-decoration: none;
}

    .hero-slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.hero-slide-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.4rem 1.6rem 1.6rem;
    direction: rtl;
    text-align: right;
    background: linear-gradient( to top, rgba(10, 14, 35, .92) 0%, rgba(10, 14, 35, .5) 45%, rgba(10, 14, 35, 0) 85% );
}

.hero-badge {
    display: inline-block;
    width: fit-content;
    background: #ffb400;
    color: #1d2456;
    font-size: .78rem;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: 20px;
    margin-bottom: .7rem;
}

.hero-slide-overlay h3 {
    color: #fff;
    font-size: 1.2rem;
    line-height: 1.6;
    margin: 0 0 .5rem;
}

.hero-slide-overlay p {
    color: #dfe2f2;
    font-size: .88rem;
    line-height: 1.75;
    margin: 0 0 .5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-slide-views {
    font-size: .78rem;
    color: #ffce5c;
    font-weight: 700;
}

.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .4);
    background: rgba(10, 14, 35, .45);
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: background .2s ease, color .2s ease;
}

    .hero-arrow:hover {
        background: rgba(255, 180, 0, .85);
        color: #1d2456;
    }

.hero-arrow-prev {
    right: 14px;
}

.hero-arrow-next {
    left: 14px;
}


/* =========================================================
   7. GENERIC HERO PREVIEW
   ========================================================= */

.hero-preview {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

.hero-preview-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .5rem;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
    transition: background .2s ease, border-color .2s ease;
}

    .hero-preview-item:hover {
        background: rgba(255, 255, 255, .06);
    }

    .hero-preview-item.is-active {
        background: rgba(255, 180, 0, .12);
        border-color: rgba(255, 180, 0, .4);
    }

.hero-preview-rank {
    flex: 0 0 24px;
    text-align: center;
    font-weight: 800;
    font-size: .95rem;
    color: #ffb400;
}

.hero-preview-thumb {
    flex: 0 0 62px;
    width: 62px;
    height: 62px;
    border-radius: 10px;
    overflow: hidden;
}

    .hero-preview-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.hero-preview-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.hero-preview-title {
    font-size: .86rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-preview-views {
    font-size: .74rem;
    opacity: .75;
}


/* =========================================================
   8. TRENDING / MOST VIEWED
   ========================================================= */

.topic-block--trending {
    background: linear-gradient( 160deg, #151b3d 0%, #1d2456 100% );
    border-radius: 20px;
    padding: 1.6rem 1.4rem 1.8rem;
}

    .topic-block--trending .carousel-title {
        color: #fff;
    }

    .topic-block--trending .hero-preview-info {
        color: #fff;
    }

    .topic-block--trending .hero-preview-views {
        color: #cfd4ea;
    }


/* =========================================================
   9. NATURE / GALLERY HERO
   ========================================================= */

.hero-slider--gallery .hero-main {
    aspect-ratio: 16 / 10;
}

.hero-slide-overlay--gallery {
    background: linear-gradient( to top, rgba(9, 38, 22, .92) 0%, rgba(9, 38, 22, .4) 50%, rgba(9, 38, 22, 0) 85% );
}

.hero-badge--nature {
    background: #2f6f4f;
    color: #eafff2;
}


/* =========================================================
   10. NATURE PREVIEW — BASE MOBILE/TABLET GRID
   ========================================================= */

.hero-preview--grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
    align-content: start;
    min-width: 0;
}

.hero-preview-tile {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    border: 2px solid transparent;
    box-sizing: border-box;
}

    .hero-preview-tile img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .hero-preview-tile.is-active {
        border-color: #2f6f4f;
    }

.hero-preview-tile-title {
    position: absolute;
    inset: auto 0 0 0;
    padding: .4rem .5rem;
    font-size: .74rem;
    color: #fff;
    line-height: 1.4;
    text-align: right;
    direction: rtl;
    background: linear-gradient( to top, rgba(9, 38, 22, .9), rgba(9, 38, 22, 0) 90% );
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 3.2em;
    z-index: 2;
}


/* =========================================================
   11. DESKTOP GALLERY
   =========================================================

   مهم‌ترین بخش اصلاح‌شده.

   از 1024px به بالا:

       [ Preview List 320px ] [ Main Image ]

   چون direction صفحه RTL است، preview در سمت راست
   و تصویر اصلی در سمت چپ قرار می‌گیرد.

   این بخش عمداً بعد از Grid پایه قرار گرفته تا
   در Desktop، Grid قبلی را Override کند.
   ========================================================= */

@media (min-width: 1024px) {

    /*
     * Hero اصلی
     */

    .hero-slider--gallery {
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch !important;
        gap: 1.2rem !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }


        /*
     * تصویر اصلی
     */

        .hero-slider--gallery .hero-main {
            order: 2 !important;
            flex: 1 1 auto !important;
            width: auto !important;
            min-width: 0 !important;
            height: clamp(260px, 40vh, 420px) !important;
            max-height: clamp(260px, 40vh, 420px) !important;
            aspect-ratio: auto !important;
            overflow: hidden !important;
            box-sizing: border-box !important;
        }


        /*
     * Track تصویر اصلی
     */

        .hero-slider--gallery .hero-track {
            width: 100% !important;
            height: 100% !important;
            min-width: 0 !important;
        }


        /*
     * Preview:
     *
     * دیگر Grid نیست.
     * به یک لیست عمودی تبدیل می‌شود.
     */

        .hero-slider--gallery .hero-preview--grid {
            order: 1 !important;
            display: flex !important;
            flex: 0 0 320px !important;
            flex-direction: column !important;
            width: 320px !important;
            min-width: 320px !important;
            max-width: 320px !important;
            height: clamp(260px, 40vh, 420px) !important;
            max-height: clamp(260px, 40vh, 420px) !important;
            min-height: 0 !important;
            gap: .8rem !important;
            overflow-x: hidden !important;
            overflow-y: auto !important;
            padding: .4rem !important;
            box-sizing: border-box !important;
            align-content: flex-start !important;
            justify-content: flex-start !important;
            /*
         * بسیار مهم:
         * Gridهای قبلی نباید روی این عنصر اثر بگذارند.
         */

            grid-template-columns: none !important;
            grid-auto-rows: auto !important;
        }


        /*
     * هر آیتم Preview
     */

        .hero-slider--gallery .hero-preview-tile {
            position: relative !important;
            display: flex !important;
            flex: 0 0 72px !important;
            width: 100% !important;
            min-width: 0 !important;
            max-width: 100% !important;
            height: 72px !important;
            min-height: 72px !important;
            max-height: 72px !important;
            aspect-ratio: auto !important;
            flex-direction: row !important;
            align-items: center !important;
            gap: .8rem !important;
            padding: .35rem .5rem !important;
            border-radius: 12px !important;
            overflow: hidden !important;
            box-sizing: border-box !important;
            text-decoration: none !important;
            border: 1px solid transparent !important;
            background: transparent !important;
            /*
         * برای اینکه در RTL، thumbnail واقعاً سمت چپ
         * و اطلاعات سمت راست قرار بگیرد.
         */

            direction: ltr !important;
            transition: background .18s ease, border-color .18s ease, transform .12s ease !important;
        }


            /*
     * Hover
     */

            .hero-slider--gallery .hero-preview-tile:hover {
                background: rgba(255, 255, 255, .04) !important;
                border-color: rgba(255, 255, 255, .06) !important;
                transform: translateY(-2px) !important;
            }


            /*
     * Active
     */

            .hero-slider--gallery
            .hero-preview-tile.is-active {
                background: rgba(47, 111, 79, .08) !important;
                border-color: rgba(47, 111, 79, .28) !important;
            }


        /*
     * Thumbnail
     */

        .hero-slider--gallery .hero-preview-thumb {
            flex: 0 0 120px !important;
            width: 120px !important;
            min-width: 120px !important;
            max-width: 120px !important;
            height: 72px !important;
            min-height: 72px !important;
            max-height: 72px !important;
            border-radius: 8px !important;
            overflow: hidden !important;
            background: #ddd !important;
            box-sizing: border-box !important;
        }


            /*
     * تصویر Thumbnail
     */

            .hero-slider--gallery .hero-preview-thumb img {
                position: static !important;
                display: block !important;
                width: 100% !important;
                height: 100% !important;
                max-width: none !important;
                object-fit: cover !important;
            }


        /*
     * اطلاعات کنار Thumbnail
     */

        .hero-slider--gallery .hero-preview-info {
            flex: 1 1 auto !important;
            min-width: 0 !important;
            max-width: none !important;
            display: flex !important;
            flex-direction: column !important;
            justify-content: center !important;
            align-items: stretch !important;
            gap: 0 !important;
            direction: rtl !important;
            text-align: right !important;
            overflow: hidden !important;
        }


        /*
     * عنوان
     */

        .hero-slider--gallery .hero-preview-title {
            display: -webkit-box !important;
            -webkit-line-clamp: 2 !important;
            -webkit-box-orient: vertical !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
            font-size: .95rem !important;
            line-height: 1.35 !important;
            color: #1b1b1b !important;
            margin: 0 !important;
            padding: 0 !important;
            min-width: 0 !important;
        }


        /*
     * Views
     */

        .hero-slider--gallery .hero-preview-views {
            font-size: .78rem !important;
            line-height: 1.4 !important;
            color: #6b7280 !important;
            opacity: .9 !important;
            margin-top: .2rem !important;
        }


        /*
     * اگر HTML نسخه Nature فقط title overlay داشته باشد
     * و hero-preview-info نداشته باشد، عنوان همچنان درست
     * داخل کارت باقی می‌ماند.
     */

        .hero-slider--gallery
        .hero-preview-tile
        .hero-preview-tile-title {
            position: absolute !important;
            inset: auto 0 0 0 !important;
            z-index: 2 !important;
            padding: .4rem .5rem !important;
            margin: 0 !important;
            pointer-events: none !important;
        }
}


/* =========================================================
   12. TABLET GALLERY
   =========================================================

   در Tablet دوباره Grid فعال می‌شود.
   ========================================================= */

@media (min-width: 561px) and (max-width: 1023px) {

    .hero-slider {
        flex-direction: column;
    }

    .hero-main {
        flex: 0 0 auto;
        width: 100%;
        aspect-ratio: 16 / 11;
        order: 1;
    }

    .hero-preview {
        order: 2;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: visible;
        gap: .8rem;
        padding-bottom: .4rem;
    }

    .hero-preview-item {
        flex: 0 0 220px;
    }


    /*
     * Nature Gallery
     */

    .hero-slider--gallery .hero-main {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        aspect-ratio: 16 / 10 !important;
        order: 1 !important;
    }

    .hero-slider--gallery .hero-preview--grid {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        grid-auto-rows: auto !important;
        gap: .7rem !important;
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
        order: 2 !important;
    }

    .hero-slider--gallery .hero-preview-tile {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        aspect-ratio: 16 / 9 !important;
        flex: none !important;
        direction: rtl !important;
    }
}


/* =========================================================
   13. MOBILE HERO
   ========================================================= */

@media (max-width: 560px) {

    .hero-slider {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-main {
        width: 100%;
        flex: 0 0 auto;
        aspect-ratio: 16 / 11;
        order: 1;
    }

    .hero-preview {
        order: 2;
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        gap: .7rem;
        padding-bottom: .4rem;
    }

    .hero-preview-item {
        flex: 0 0 220px;
        min-width: 220px;
    }


    /*
     * Nature Gallery Mobile
     */

    .hero-slider--gallery {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

        .hero-slider--gallery .hero-main {
            order: 1 !important;
            width: 100% !important;
            height: auto !important;
            max-height: none !important;
            aspect-ratio: 16 / 10 !important;
            flex: 0 0 auto !important;
        }

        .hero-slider--gallery .hero-preview--grid {
            order: 2 !important;
            display: grid !important;
            grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
            grid-auto-rows: auto !important;
            gap: .55rem !important;
            width: 100% !important;
            height: auto !important;
            max-height: none !important;
            overflow: visible !important;
            padding: 0 !important;
        }

        .hero-slider--gallery .hero-preview-tile {
            display: block !important;
            width: 100% !important;
            height: auto !important;
            min-height: 0 !important;
            max-height: none !important;
            aspect-ratio: 16 / 9 !important;
            flex: none !important;
            direction: rtl !important;
        }

        .hero-slider--gallery
        .hero-preview-tile-title {
            font-size: .72rem !important;
            line-height: 1.35 !important;
            padding: .35rem .4rem !important;
        }
}


/* =========================================================
   14. SHELF MOBILE
   =========================================================

   مهم:
   قبلاً 78%، 82% یا 84% باعث می‌شد بخشی از کارت بعدی دیده شود.

   اکنون:
       width = 100%
       flex-basis = 100%

   بنابراین روی موبایل هر کارت کامل دیده می‌شود.
   ========================================================= */

@media (max-width: 560px) {

    .shelf {
        gap: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        scroll-padding-inline: 0 !important;
        box-sizing: border-box !important;
    }

        .shelf > .video-card,
        .shelf > .learn-card {
            flex: 0 0 100% !important;
            width: 100% !important;
            max-width: 100% !important;
            box-sizing: border-box !important;
            scroll-snap-align: start !important;
        }
}

@media (max-width: 380px) {

    .shelf > .video-card,
    .shelf > .learn-card {
        flex-basis: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}


/* =========================================================
   15. LEARNING CARDS
   ========================================================= */

.learn-card {
    position: relative;
    flex: 0 0 260px;
    width: 260px;
    box-sizing: border-box;
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid #e2f2ec;
    border-top: 4px solid #0f9d78;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    direction: rtl;
    text-align: right;
    transition: transform .25s ease, box-shadow .25s ease;
}

    .learn-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 22px rgba(15, 157, 120, .16);
    }

.learn-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    background: #0f9d78;
    color: #fff;
    font-size: .74rem;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 20px;
}

.learn-card-image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

    .learn-card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform .5s ease;
    }

.learn-card:hover .learn-card-image img {
    transform: scale(1.05);
}

.learn-card-body {
    padding: .85rem 1rem 1.1rem;
}

    .learn-card-body h3 {
        font-size: .96rem;
        line-height: 1.6;
        margin: 0 0 .4rem;
        color: #1b1b1b;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .learn-card-body p {
        font-size: .84rem;
        line-height: 1.7;
        color: #555;
        margin: 0;
    }


/* =========================================================
   16. MASHHAHIR
   ========================================================= */

.card--mashahir {
    flex-direction: row;
    align-items: center;
    gap: 1.4rem;
    padding: 1.2rem;
}

.mashahir-portrait-wrap {
    flex: 0 0 160px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #c9a227;
    box-shadow: 0 8px 20px rgba(201, 162, 39, .3);
}

    .mashahir-portrait-wrap img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.mashahir-slide-name {
    color: #213074;
    font-size: 1.15rem;
    margin: 0 0 .5rem;
}

@media (max-width: 700px) {

    .card--mashahir {
        flex-direction: column;
        text-align: center;
    }

    .mashahir-portrait-wrap {
        margin: 0 auto;
    }
}


/* =========================================================
   17. FINAL SAFETY RULES
   =========================================================

   این بخش فقط قواعدی دارد که نباید باعث تغییر رفتار
   Desktop Gallery شوند.

   توجه:
   دیگر در این قسمت برای Gallery از display:grid استفاده
   نمی‌کنیم؛ چون Desktop باید همان flex-list باشد.
   ========================================================= */

.hero-slider--gallery .hero-preview-tile-title {
    max-height: 3.2em;
    overflow: hidden;
}


/* =========================================================
   18. ACCESSIBILITY / FOCUS
   ========================================================= */

.hero-arrow:focus-visible,
.shelf-btn:focus-visible,
.hero-preview-item:focus-visible,
.hero-preview-tile:focus-visible,
.video-card:focus-visible,
.learn-card:focus-visible {
    outline: 3px solid rgba(47, 111, 79, .35);
    outline-offset: 3px;
}


/* =========================================================
   19. VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 380px) {

    .hero-slide-overlay {
        padding: 1rem 1rem 1.1rem;
    }

        .hero-slide-overlay h3 {
            font-size: 1rem;
            line-height: 1.5;
        }

        .hero-slide-overlay p {
            font-size: .78rem;
            line-height: 1.6;
        }

    .hero-arrow {
        width: 34px;
        height: 34px;
        font-size: 1.1rem;
    }

    .hero-arrow-prev {
        right: 8px;
    }

    .hero-arrow-next {
        left: 8px;
    }
}
/* =========================================================
   پربازدیدترین مطالب — اصلاح اختصاصی دسکتاپ
   ---------------------------------------------------------
   این override فقط برای .topic-block--trending است.
   هیچ‌یک از بلوک‌های دیگر صفحه در این بخش تغییر نمی‌کنند.

   • اسکرول عمودی فهرست سمت راست حفظ می‌شود.
   • تصویر اصلی سمت چپ و فهرست سمت راست دقیقاً هم‌ارتفاع هستند.
   • ارتفاع دسکتاپ از clamp(260px, 40vh, 420px)
     به clamp(130px, 20vh, 210px) کاهش می‌یابد.
   • ساختار و رفتار اسلایدر حفظ می‌شود.
   ========================================================= */
@media (min-width: 1025px) {
    .topic-block--trending .hero-slider {
        display: flex;
        flex-direction: row;
        direction: rtl;
        align-items: stretch;
        gap: 1.2rem;
        height: clamp(260px, 40vh, 420px);
        min-height: 0;
    }

        /* تصویر اصلی — سمت چپ */
        .topic-block--trending .hero-slider > .hero-main {
            flex: 0 0 50%;
            width: 50%;
            height: 100%;
            min-height: 0;
            aspect-ratio: auto !important;
            box-sizing: border-box;
        }

        /* فهرست — سمت راست، با اسکرول عمودی */
        .topic-block--trending .hero-slider > .hero-preview {
            flex: 1 1 50%;
            width: 50%;
            height: 100%;
            min-height: 0;
            max-height: none;
            display: flex;
            flex-direction: column;
            gap: .45rem;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 0 .2rem 0 0;
            box-sizing: border-box;
            scrollbar-width: thin;
        }

    /* آیتم‌های فهرست */
    .topic-block--trending .hero-preview-item {
        flex: 0 0 auto;
        min-height: 58px;
        padding: .35rem .45rem;
        box-sizing: border-box;
    }

    /* تصویر کوچک هر آیتم */
    .topic-block--trending .hero-preview-thumb {
        flex: 0 0 58px;
        width: 58px;
        height: 58px;
    }
}