/* ─── Wrapper: keep widget inside Elementor container ─── */
.rsc-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    min-width: 0;
    min-height: 400px;
}

/* ─── Story Section Container ─── */
.rsc-story-section {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    min-width: 0;
}

/* ─── Grid Layout ─── */
.rsc-story-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(0, auto);
    align-items: start;
    gap: 54px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* ─── Card: aspect-ratio 9:16 (portrait) ─── */
.rsc-story-card {
    position: relative;
    width: 100%;
    min-width: 0;
    aspect-ratio: 9 / 16;
    background-color: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    display: block;
    text-decoration: none;
}

/* ─── Video Layer (z-index 1) ─── */
.rsc-story-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* ─── Image Layer (z-index 2) ─── */
.rsc-story-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    border-radius: 12px;
    transition: transform 650ms cubic-bezier(0.68, 0.34, 0, 1);
}

/* ─── Hover: slide image left to reveal video ─── */
.rsc-story-card:hover .rsc-story-image {
    transform: translateX(-100%);
}

/* ─── Mobile: video aktif (IntersectionObserver) — sama seperti hover desktop ─── */
@media (max-width: 767px) {
    .rsc-story-card.rsc-video-active .rsc-story-image {
        transform: translateX(-100%);
    }

    .rsc-story-card.rsc-video-active .rsc-story-info {
        opacity: 0;
        visibility: hidden;
    }
}

/* ─── Info Overlay (z-index 3) ─── */
.rsc-story-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 24px 16px 16px 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 3;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    transition: opacity 650ms cubic-bezier(0.68, 0.34, 0, 1);
}

/* ─── Hover: hide info ─── */
.rsc-story-card:hover .rsc-story-info {
    opacity: 0;
    visibility: hidden;
}

/* ─── Typography ─── */
.rsc-project-name {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    line-height: normal;
    letter-spacing: -0.32px;
}

.rsc-client-name {
    color: #aaaaaa;
    font-size: 16px;
    font-weight: 500;
    line-height: normal;
    letter-spacing: -0.32px;
}

/* ─── Mobile: contain overflow for both grid and carousel ─── */
@media (max-width: 767px) {
    .rsc-story-section {
        width: 100%;
        max-width: 100%;
    }

    .rsc-story-grid {
        max-width: 100%;
    }

    .rsc-story-grid .rsc-story-card {
        min-width: 0;
    }

    /* Carousel mode: scroll only inside grid, section clips */
    .rsc-story-grid.rsc-mobile-carousel {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 16px;
        padding: 0 16px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        max-width: 100%;
    }

    .rsc-story-grid.rsc-mobile-carousel::-webkit-scrollbar {
        display: none;
    }

    .rsc-story-grid.rsc-mobile-carousel .rsc-story-card {
        flex: 0 0 85%;
        min-width: 85%;
        scroll-snap-align: center;
        scroll-snap-stop: always;
    }
}

@media (max-width: 767px){
.rsc-story-card {
height: clamp(520px, 140vw, 707px);
}
	
	.rsc-story-grid.rsc-mobile-carousel .rsc-story-card{
		height: clamp(469px, 120vw, 553px);
	}
	
	.rsc-story-grid.rsc-mobile-carousel{
		padding:0;
	}
}