/* ==========================================================================
   ScrollStack – Custom GSAP Reveal Effect
   ========================================================================== */

@media (max-width: 768px) {
    .orbit-section.scroll-stack-active {
        /* Ensure there's enough space to pin, GSAP will handle the pin-spacer */
        min-height: auto;
        overflow: hidden;
    }

    .orbit-section.scroll-stack-active .orbit-container {
        position: relative;
        width: 100%;
        /* Make container tall enough to hold the fully fanned out deck 
           (130px card height + 3 * 140px slide gaps = 550px) */
        height: 620px;
        min-height: 620px;
        margin-top: 0 !important; /* Pull closer to the title */
        border: none;
    }

    .orbit-section.scroll-stack-active .orbit-track {
        position: relative;
        width: 100%;
        height: 100%;
        padding: 0 1rem;
    }

    /* Hide desktop elements and the bottom fade gradient */
    .orbit-section.scroll-stack-active .orbit-center,
    .orbit-section.scroll-stack-active > div[style*="align-items: center"],
    .orbit-section.scroll-stack-active::after {
        display: none !important;
    }

    /* Stack cards heavily */
    .scroll-stack-card {
        position: absolute !important;
        top: 0 !important;
        left: 1rem !important; /* compensate for track padding */
        right: 1rem !important;
        width: calc(100% - 2rem) !important;
        height: 130px !important; /* Reverted to 130px */
        min-height: 130px !important;
        margin: 0 !important;
        padding: 1.2rem 1.5rem !important;
        border-radius: 20px;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.5); /* Shadow on top to separate stack */
        transform-origin: top center;
        will-change: transform;
        /* Reset old positioning */
        bottom: auto !important;
        display: flex !important;
        align-items: center; /* Center content vertically in smaller card */
    }

    .scroll-stack-card .box-content {
        pointer-events: auto;
    }

    .scroll-stack-card h3 {
        font-size: 1.2rem;
        margin-bottom: 0.2rem;
    }

    .scroll-stack-card p {
        font-size: 0.8rem;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* Truncate if too long for small card */
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .scroll-stack-card::after {
        content: 'Antippen →';
        position: absolute;
        bottom: 1rem;
        right: 1.5rem;
        font-size: 0.6rem;
        color: rgba(255,255,255,0.3);
        text-transform: uppercase;
    }
}
