/* ردیف بنرهای بالای صفحه‌ی خانه (home/inc/slider.html و static/js/home-slider.js)، به سبک ردیف «جدیدترین‌ها»ی
   سایت‌های فیلم: کارتی سفید با عنوان، و بنرها کنار هم با عنوان زیر هر کدام. تصویر همان نسبت ۲٫۳۳ اسلایدر اپ را دارد.
   موبایل‌فرست: روی گوشی یک بنر و کمی از بعدی پیداست، از sm دو، از md دو و نیم و از lg حدود سه و نیم. */

/* فاصله‌ی بالا و پایین و جای این ردیف نسبت به ابزارها را بسته‌ی .home-top در site-tools.css می‌دهد */
.home-slider {
    --slide-gap: .75rem;
    --slide-width: 76%;
}

.home-slider-box {
    padding: .75rem .75rem 1rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, .06);
}

.home-slider-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    min-height: 2rem;
    margin-bottom: .75rem;
    padding: 0 .25rem .5rem;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.home-slider-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

/* ===== ردیف ===== */
.home-slider-viewport {
    position: relative;
}

.home-slider-track {
    display: flex;
    gap: var(--slide-gap);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.home-slider-track::-webkit-scrollbar {
    display: none;
}

.home-slide {
    flex: 0 0 var(--slide-width);
    min-width: 0;
    scroll-snap-align: start;
}

.home-slide-card {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: #212529;
    font: inherit;
    text-align: right;
    text-decoration: none;
}

.home-slide-media {
    position: relative;
    display: block;
    aspect-ratio: 2.33;
    overflow: hidden;
    border-radius: 14px;
    background: #e9ecef;
}

.home-slide-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.home-slide-title {
    overflow: hidden;
    padding-inline: .25rem;
    font-size: .85rem;
    font-weight: 500;
    line-height: 1.6;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.home-slide-card:hover .home-slide-media img,
button.home-slide-card:hover .home-slide-media img {
    transform: scale(1.04);
}

a.home-slide-card:hover .home-slide-title,
button.home-slide-card:hover .home-slide-title {
    color: var(--bs-primary);
}

.home-slide-card:focus-visible {
    outline: none;
}

.home-slide-card:focus-visible .home-slide-media {
    outline: 3px solid var(--bs-primary);
    outline-offset: 2px;
}

.home-slide-play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: auto;
    border-radius: 50%;
    background: rgba(33, 37, 41, .7);
    color: #fff;
    font-size: 1.9rem;
}

/* ===== فلش‌ها (از md به بالا) و دکمه‌ی توقف ===== */
.home-slider-arrow {
    position: absolute;
    /* وسط ارتفاع تصویر، نه کل کارت که عنوان هم دارد */
    top: calc((100% - 1.8rem) / 2);
    z-index: 1;
    display: none;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
    color: #212529;
    font-size: 1.05rem;
    transform: translateY(-50%);
}

.home-slider-prev {
    right: -14px;
}

.home-slider-next {
    left: -14px;
}

.home-slider-arrow[hidden] {
    display: none !important;
}

.home-slider-toggle {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: #6c757d;
    font-size: 1rem;
}

.home-slider-arrow:focus-visible,
.home-slider-toggle:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* ===== پخش‌کننده‌ی بنر ویدیویی ===== */
.home-video-modal .modal-content {
    position: relative;
    overflow: hidden;
    border: 0;
    background: #000;
    color: #fff;
}

.home-video-close {
    position: absolute;
    top: .75rem;
    left: .75rem;
    z-index: 2;
}

.home-video {
    display: block;
    width: 100%;
    max-height: 80vh;
    background: #000;
}

.home-video-modal.is-vertical .modal-dialog {
    max-width: 420px;
}

.home-video-foot {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: .75rem 1rem 1rem;
}

.home-video-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.6;
}

.home-video-link {
    align-self: flex-start;
    padding: .45rem 1.25rem;
    border-radius: 999px;
    background: var(--bs-primary);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.home-video-link:hover {
    color: #fff;
    filter: brightness(.92);
}

/* روی گوشی پخش‌کننده تمام‌صفحه است؛ ویدیو جای خالی را می‌گیرد و عنوان پایین می‌ماند، مثل اپ */
@media (max-width: 575.98px) {
    .home-video-modal .modal-content {
        justify-content: center;
    }

    .home-video {
        flex: 1;
        max-height: none;
        min-height: 0;
        object-fit: contain;
    }

    .home-video-foot {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    }
}

@media (min-width: 576px) {
    .home-slider {
        --slide-width: calc((100% - var(--slide-gap)) / 2 - 1.5rem);
    }
}

@media (min-width: 768px) {
    .home-slider {
        --slide-width: calc((100% - 2 * var(--slide-gap)) / 2.5);
    }

    .home-slider-box {
        padding: 1rem 1.25rem 1.25rem;
    }

    .home-slider-arrow {
        display: grid;
    }
}

@media (min-width: 992px) {
    .home-slider {
        --slide-width: calc((100% - 3 * var(--slide-gap)) / 3.4);
    }
}
