/* Continue Watching is a standalone component. Keep its layout self-contained
   instead of depending on the scoped styles of HomeRailSection. */
.continue-watching-section {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 18px 0 24px;
    overflow: hidden;
    box-sizing: border-box;
    background: #000;
}

.continue-watching-section .shahid-section-heading {
    min-height: 58px;
    padding: 0 clamp(16px, 3vw, 28px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    direction: rtl;
}

.continue-watching-section .shahid-section-heading h2 {
    position: relative;
    min-width: 0;
    margin: 0;
    padding-inline-start: 13px;
    color: #fff;
    font-size: clamp(.98rem, 2vw, 1.16rem);
    line-height: 1.2;
    font-weight: 950;
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.continue-watching-section .shahid-section-heading h2::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    width: 5px;
    height: 28px;
    border-radius: 999px;
    background: linear-gradient(180deg, #14d7ff 0%, #9b4dff 56%, #f04ad8 100%);
    transform: translateY(-50%);
}

.continue-watching-section .shahid-section-heading > small {
    flex: 0 0 auto;
    margin-inline-start: auto;
    color: #8e99aa;
    font-size: .72rem;
    line-height: 1.35;
    font-weight: 700;
    white-space: nowrap;
}

.continue-watching-section .horizontal-scroll-shell,
.continue-watching-section .desktop-rail-controls {
    position: relative;
    width: 100%;
    isolation: isolate;
}

.continue-watching-rail {
    width: 100%;
    margin: 0;
    padding: 0 clamp(16px, 3vw, 28px) 8px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    direction: rtl;
    scroll-snap-type: x proximity;
    scroll-padding-inline: clamp(16px, 3vw, 28px);
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.continue-watching-rail::-webkit-scrollbar {
    display: none;
}

.continue-watching-card {
    flex: 0 0 clamp(210px, 42vw, 310px);
    min-width: 0;
    max-width: 310px;
    display: grid;
    grid-template-rows: auto auto auto;
    align-content: start;
    gap: 7px;
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: 12px;
    scroll-snap-align: start;
    cursor: pointer;
    outline: none;
    content-visibility: visible;
    contain: none;
    box-sizing: border-box;
}

.continue-watching-card:focus-visible .continue-watching-image {
    box-shadow: 0 0 0 3px rgba(130, 91, 255, .85);
}

.continue-watching-image {
    position: relative;
    width: 100%;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    background: #11141c;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}

.continue-watching-image > img,
.continue-watching-image .shahid-card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.continue-watching-image .shahid-card-shade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 48%, rgba(0, 0, 0, .12) 67%, rgba(0, 0, 0, .58) 100%);
}

.continue-watching-play {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 50%;
    color: #fff;
    background: rgba(10, 12, 18, .74);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .32);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.continue-watching-progress {
    position: absolute;
    z-index: 3;
    inset-inline: 9px;
    bottom: 8px;
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .28);
    pointer-events: none;
}

.continue-watching-progress > i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7c4dff, #e742ff);
}

.continue-watching-card > strong,
.continue-watching-card > small {
    min-width: 0;
    padding-inline: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.continue-watching-card > strong {
    color: #f6f7fb;
    font-size: .88rem;
    line-height: 1.35;
    font-weight: 850;
}

.continue-watching-card > small {
    color: #8d98a9;
    font-size: .7rem;
    line-height: 1.35;
    direction: rtl;
}

.continue-watching-section .scroll-arrow {
    position: absolute;
    z-index: 6;
    top: 50%;
    width: 44px;
    height: 44px;
    display: none;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 0, 0, .58);
    box-shadow: 0 10px 25px rgba(0, 0, 0, .34);
    transform: translateY(-50%);
    cursor: pointer;
}

.continue-watching-section .scroll-arrow-right {
    right: 12px;
}

.continue-watching-section .scroll-arrow-left {
    left: 12px;
}

@media (hover: hover) and (pointer: fine) and (min-width: 760px) {
    .continue-watching-section .scroll-arrow {
        display: grid;
    }
}

@media (max-width: 600px) {
    .continue-watching-section {
        padding-block: 14px 20px;
    }

    .continue-watching-section .shahid-section-heading {
        min-height: 50px;
        padding-inline: 14px;
    }

    .continue-watching-section .shahid-section-heading > small {
        font-size: .66rem;
    }

    .continue-watching-rail {
        padding-inline: 14px;
        scroll-padding-inline: 14px;
        gap: 11px;
    }

    .continue-watching-card {
        flex-basis: min(76vw, 270px);
    }

    .continue-watching-play {
        width: 40px;
        height: 40px;
    }
}
