/* ===== لیست هایلایت‌ها ===== */
.view-highlights {
    width: 100%;
}

.view-highlights__list {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 34px;
    justify-content: center;
}

.view-highlight {
    position: relative;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.view-highlight__img {
    width: 72px;
    max-width: 72px !important;
    height: 72px;
    border-radius: 100% !important;
    object-fit: cover;
    border-radius: 999px;
    display: block;
    position: relative;
}


.view-highlight__ring {
    position: relative;
    display: flex;
    width: 0;
    height: 0;
    border: 4px solid #EFF3FE;
    border-radius: 50%;
    width: 77px;
    height: 77px;
    max-width: 77px;
    align-items: center;
    justify-content: center;
    padding: 38px;
}

.view-highlight:not(.is-viewed) .view-highlight__ring {
    border: 4px solid var(--view-secondary);
}

.view-highlight__title {
    display: block;
    color: #1E2244;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.25;
    white-space: nowrap;
}


/* ===== مودال تمام‌صفحه با بلور ===== */
.view-highlight-modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity .2s ease, visibility .2s ease;
    z-index: 9999;
}

.view-highlight-modal[aria-hidden="false"] {
    visibility: visible;
    opacity: 1;
}

.view-highlight-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 14, 28, .50);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

/* ===== قاب موبایلی 480×800 ===== */
.view-highlight-modal__dialog {
    position: relative;
    background: transparent; /* بدون پس‌زمینه سفید */
    width: auto;
    height: auto;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}

/* خود قاب */
.view-hl__frame {
    position: relative;
    border-radius: 32px;
    width: 400px;
    height: 700px; /* اندازه هدف */
    max-width: 96vw;
    max-height: 96vh; /* هرگز از این بزرگ‌تر نشه؛ در کوچک‌ها مقیاس میشه */
    background: #000; /* پس‌زمینه مشکی برای لِترباکس */
    box-shadow: 0 30px 90px rgba(0, 0, 0, .40);
}

/* ===== HUD بالا (progress + controls) داخل قاب ===== */
.view-hl__hud {
    position: absolute;
    inset-inline: 0;
    top: 0;
    z-index: 3;
    padding: 12px;
    pointer-events: none;
}

.view-hl__progress {
    display: grid;
    grid-auto-flow: column;
    gap: 6px;
}

.hl-progress__seg {
    height: 3px;
    background: rgba(255, 255, 255, .35);
    border-radius: 999px;
    overflow: hidden;
}

.hl-progress__seg > span {
    display: block;
    width: 100%;
    height: 100%;
    transform: scaleX(0);
    transform-origin: left center;
    background: #FFF;
    transition: transform .08s linear;
}

.view-hl__controls {
    position: absolute;
    top: 8px;
    inset-inline: 8px 44px;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    pointer-events: auto;
}

.hl-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 0;
    cursor: pointer;
    background: rgba(0, 0, 0, .55);
    color: #FFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hl-btn:hover {
    background: rgba(0, 0, 0, .75);
}

.view-highlight-modal__close {
    position: absolute;
    top: 8px;
    inset-inline-end: 8px;
    z-index: 4;
    border: 0;
    background: #000;
    color: #FFF;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    cursor: pointer;
}

/* آیکن‌ها (اگر SVG داری جایگزین کن) */
.hl-prev::before {
    content: "\2039";
    font-size: 18px;
}

.hl-next::before {
    content: "\203A";
    font-size: 18px;
}

.hl-play[data-state="pause"]::before {
    content: "\23F8";
    font-size: 14px;
}

/* pause */
.hl-play[data-state="play"]::before {
    content: "\25B6";
    font-size: 14px;
}


.view-highlight-modal .swiper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.view-highlight-modal .swiper-wrapper,
.view-highlight-modal .swiper-slide {
    width: 100%;
    height: 100%;
}


.view-hl-slide__img,
.view-hl-slide__video {
    width: 100%;
    height: 100% !important;
    display: block;
    object-fit: cover;
    border-radius: 32px !important;
}

.view-hl-slide__video {
    background: #000;
    object-fit: fill;
}

.view-hl-slide__caption {
    position: absolute;
    bottom: 100px;
    inset-inline: 24px;
    background: rgba(18, 13, 9, 0.6);
    color: #FFF;
    border-radius: 12px;
    padding: 14px 16px;
}

.view-hl-slide__title {
    margin: 0 !important;
}

.view-hl-slide__title a {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 700;
    line-height: 35px;
    color: #fff;
}

.view-hl-slide__excerpt {
    font-size: 15px;
    line-height: 25px;
    text-align: justify;
}

.view-hl-slide__link {
    color: #FFF;
    text-decoration: none;
    font-weight: 600;
}

.view-highlight-modal .swiper-button-prev,
.view-highlight-modal .swiper-button-next {
    color: #FFF;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .6);
    width: 38px;
    height: 38px;
    border-radius: 999px;
    backdrop-filter: blur(2px);
    background: rgba(122, 99, 255, .95);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .22);
}

.view-highlight-modal .swiper-button-prev::after,
.view-highlight-modal .swiper-button-next::after {
    font-size: 16px;
    font-weight: 700;
}


/* 1) پروگرس از راست به چپ: فقط این خط رو جایگزین کن */
.hl-progress__seg > span {
    display: block;
    width: 100%;
    height: 100%;
    transform: scaleX(0);
    transform-origin: right center; /* قبلاً left بود، حالا right شد */
    background: #FFF;
    transition: transform .08s linear;
}

/* 4) هایلایتِ دیده‌شده: تصویر خاکستری تیره، رینگ بماند */
.view-highlight.is-viewed .view-highlight__img {
    filter: grayscale(100%) brightness(0.55);
}

/* آیکن‌ها برن گوشهٔ چپ بالا روی تصویر */
.view-hl__hud {
    pointer-events: none;
    z-index: 3;
}

.view-hl__controls {
    position: absolute;
    top: 30px;
    left: 15px; /* چپ ثابت، نه inline */
    right: auto;
    display: flex;
    gap: 8px;
    align-items: center;
    pointer-events: auto;
}

/* خود دکمه‌ها شفاف و فقط خود SVG دیده شود */
.hl-btn {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    width: auto;
    height: auto;
    border-radius: 0;
    box-shadow: none;
    cursor: pointer;
}

.hl-btn img, .hl-btn svg {
    display: block;
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); /* خوانایی روی تصویر */
}

/* دکمه بستن سر جای خودش بماند */
.view-highlight-modal__close {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* وقتی اسلاید تصویر است دکمه mute پنهان شود (JS هم این را ست می‌کند) */
.hl-mute {
    display: none;
}

/* پایه: پنهان؛ JS روی ویدیوها نمایش می‌دهد */

/* پروگرس همچنان بالا بماند؛ اگر روی تصویر می‌افتد فاصله بده */
.view-hl__progress {
    margin-top: 4px;
}

/* فقط دو دکمه گوشه چپ بالا */
.view-hl__controls {
    position: absolute;
    top: 30px;
    left: 15px;
    display: flex;
    gap: 10px;
    pointer-events: auto;
}

.hl-btn {
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.hl-btn svg {
    display: block;
    width: 20px;
    height: 20px;
}

/* دکمه بستن همچنان بالا سمت راست */
.view-highlight-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 24px;
    color: #fff;
}


/* ===== مودال تمام‌صفحه ===== */
.view-highlight-modal {
    position: fixed;
    inset: 0;
    display: none; /* ⬅️ پیش‌فرض مخفی */
    place-items: center;
    z-index: 9999;
    /* اگر افکت淡 می‌خواهی، بعداً می‌تونیم با scale/opacity داخلِ دیالوگ بدیم؛
       روی display انیمیشن نداریم و نیازی هم نیست. */
}

/* وقتی باز است */
.view-highlight-modal.is-open {
    display: grid; /* ⬅️ باز شدن = grid */
}

/* بک‌دراپ مثل قبل */
.view-highlight-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 14, 28, .50);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

/* قاب موبایلی و بقیه استایل‌ها همون قبلی‌ها */

/* دکمه‌های دایره‌ای بنفش کناری – وسط قاب */
.hl-side {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    z-index: 4;
}

/* کمی بیرون قاب، مثل طرح */
.hl-side--right {
    right: -12px;
}

.hl-side__inner {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #B7A5FF; /* بنفش روشن مثل طرح */
    box-shadow: 0 8px 20px rgba(0, 0, 0, .20), inset 0 0 0 2px rgba(255, 255, 255, .35);
}

.hl-side__inner svg {
    display: block;
}

.hl-side:hover .hl-side__inner {
    filter: brightness(0.95);
}

/* ===== Side skip buttons (prev/next highlight) ===== */
.hl-side {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 9999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    /* استایل دایره بنفش با هاله */
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);

    color: #fff; /* برای آیکن شبه‌عنصر */
    transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}

.hl-side:focus {
    outline: none;
}

.hl-side:focus-visible {
    box-shadow: 0 0 0 3px rgba(122, 99, 255, .25), 0 10px 24px rgba(0, 0, 0, .22);
}

/* جای‌گذاری دو طرف قاب (کمی لب‌به‌لب مثل طرح) */
.hl-side--left {
    left: -70px;
}

.hl-side--right {
    right: -70px;
}

/* آیکن‌ها (chevron) دقیقا وسط */
.hl-side::after {
    font-family: inherit;
    font-weight: 700;
    font-size: 18px;
    line-height: 1;
}


/* › */

/* Hover/Active ریز انیمیشن */
.hl-side:hover {
    background: rgba(138, 115, 255, 0.98);
    transform: translateY(-50%) scale(1.04);
}

.hl-side:active {
    transform: translateY(-50%) scale(0.98);
}

button.hl-btn.hl-play {
    width: 16px;
    height: 16px;
}


.view-highlights {
    overflow: hidden;
}

.view-highlights__list {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.view-highlight {
    scroll-snap-align: center;
    flex: 0 0 auto;
}

.view-highlights__list::-webkit-scrollbar {
    height: 0;
}

.view-highlights__list {
    scrollbar-width: none;
}


@media screen and (max-height: 768px){
    .view-hl__frame {
        width: 300px;
        height: 550px;
    }

    .view-highlight-modal.is-open {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .hl-side--right {
        right: -35px;
    }

    .hl-side--left{
        left: -35px;
    }


}