/* Stacked Cards Module - Revert to Partnership Approach Style with Visible Tags */

.stacked-cards-section {
    padding: 70px 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #1a1a1a;
    overflow: visible !important;
}

/* HubSpot DND Fixes */
.stacked-cards-section .row-fluid, 
.stacked-cards-section .span12 {
    overflow: visible !important;
}

.stacked-cards-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    overflow: visible !important;
}

.stacked-cards-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    overflow: visible !important;
}

/* Left Column: Static Content */
.stacked-cards-column-text {
    flex: 0 0 42%;
    max-width: 42%;
}

.section-content-wrapper {
    position: sticky;
    top: 100px;
}

.section-heading {
    font-size: 40px;
    font-weight: 800;
    margin: 0 0 25px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.section-description {
    font-size: 18px;
    line-height: 1.6;
    color: #4a4a4a;
}

/* Right Column: Stacked Cards */
.stacked-cards-column-cards {
    flex: 0 0 54%;
    max-width: 54%;
    overflow: visible !important;
    padding-left: 50px; /* Room for the -60px tab */
}

.stacked-cards-list {
    position: relative;
    padding-bottom: 0; /* Space for the last card's scroll */
    overflow: visible !important;
}

/* Card Stacking Logic */
.stacked-card {
    position: sticky;
    /* Incremental top offset to keep tags visible (Screenshot 3 logic) */
    top: calc(80px + (var(--card-index) * 80px)); 
    margin-bottom: 60px; /* Space between cards in normal flow */
    transform-origin: center top;
    z-index: calc(10 + var(--card-index));
    overflow: visible !important; /* Ensure the offset tab is visible */
}

.stacked-card-inner {
    position: relative;
    background: #ffffff;
    border: 10px solid #F5F5F5;
    border-radius: 0.75rem;
    padding: 1.5rem 2rem;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
    min-height: 250px;
    display: flex;
    flex-direction: column;
}

/* Left Tab (The Gray Badge Area - Screenshot 1 / User Design) */
.stacked-card-tab {
    position: absolute;
    top: 1px; /* Offset to align with the thick 10px border */
    left: -70px; /* Room for the 10px border + tab width */
    width: 60px;
    height: 60px;
    background: #F5F5F5;
    border-radius: 0.5rem 0 0 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fd7e14;
    font-size: 1.5rem;
    margin-bottom: 0;
    z-index: 2;
}

/* Red Checkmark Icon Circle */
.stacked-card-icon-wrap {
    width: 32px;
    height: 32px;
    background: #fd7e14;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(253, 126, 20, 0.2);
}

.stacked-card-icon-wrap svg {
    width: 18px;
    height: 18px;
    color: white;
}

/* Content Area */
.stacked-card-details {
    flex: 1;
    padding: 0px 40px 35px 0;
}

.stacked-card-tag {
    font-size: 16px;
    font-weight: 800;
    color: #fd7e14;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 15px;
}

.stacked-card-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 15px;
    line-height: 1.25;
}

.stacked-card-content {
    font-size: 16px;
    line-height: 1.6;
    color: #4a4a4a;
}

/* Scroll-Driven Animation (Optional refinement) */
@supports (animation-timeline: view()) {
    .stacked-card-inner {
        animation: scaleScroll linear forwards;
        animation-timeline: view();
        animation-range: exit 0% exit 100%;
    }

    @keyframes scaleScroll {
        to {
            /* Subtle scaling as items scroll away */
            transform: scale(0.97) translateY(-5px);
            filter: brightness(0.97);
        }
    }
}

/* Responsiveness */
@media (max-width: 1024px) {
    .stacked-cards-column-text, 
    .stacked-cards-column-cards {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .stacked-cards-column-text {
        margin-bottom: 60px;
    }
    .section-content-wrapper {
        position: static;
    }
    .stacked-card {
        position: relative; /* Remove sticky on mobile for simpler flow */
        top: 0 !important;
        margin-bottom: 30px;
    }
}

@media (max-width: 767px) {
    .stacked-card-tab {
        flex: 0 0 60px;
    }
    .stacked-card-details {
        padding: 30px 20px;
    }
}
