/* Cascading Stacking Cards for Project Details */

/* CRITICAL FIX: Override any upstream overflow:hidden to allow sticky positioning */
html,
body,
.body-wrapper,
#__nuxt,
main {
    overflow-y: visible !important;
    overflow-x: hidden !important;
}

.cascading-cards-section {
    padding: 100px 0;
    background-color: #f8f9fa;
    position: relative;
    z-index: 10;
}

.cascading-cards-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px;
}

.cascading-card {
    position: sticky;
    top: 120px;
    /* Distance from top when stuck */
    margin-bottom: 100px;
    /* Space between cards in flow, but they overlap due to sticky */
    background: #fff;
    border-radius: 30px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.08);
    /* Stronger shadow for depth */
    display: flex;
    overflow: hidden;
    transform-origin: center top;
    transition: transform 0.1s linear, opacity 0.1s linear;
    /* Smooth JS updates */
    border: 1px solid rgba(0, 0, 0, 0.03);
}

/* Ensure the last card doesn't have huge margin */
.cascading-card:last-child {
    margin-bottom: 0;
}

/* Colors from inspiration */
.cascading-card.theme-blue {
    background-color: #eef4ff;
}

.cascading-card.theme-green {
    background-color: #f0fdf4;
}

.cascading-card.theme-purple {
    background-color: #f7f5ff;
}

.cascading-card.theme-pink {
    background-color: #fff1f8;
}

.cascading-card.theme-yellow {
    background-color: #fffbeb;
}

/* Alternating Order */
.cascading-card:nth-child(even) .card-inner {
    flex-direction: row-reverse;
}

.card-inner {
    display: flex;
    width: 100%;
    align-items: center;
}

.card-text {
    flex: 1;
    padding: 30px 60px;
}

.card-image {
    flex: 1.2;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.card-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.card-text .label-icon {
    width: 60px;
    margin-bottom: 25px;
}

.card-text h2 {
    font-size: 42px;
    font-weight: 600;
    margin-bottom: 25px;
    color: #1a1a1a;
    font-family: var(--font_recoleta);
    line-height: 1.2;
}

.card-text p,
.card-text .rich-text {
    font-size: 18px;
    line-height: 1.7;
    color: #555;
    margin-bottom: 35px;
}

/* Beautiful Lists with Icons */
.card-text .rich-text ul {
    list-style: none;
    padding: 0;
    margin: 25px 0 0;
}

.card-text .rich-text li {
    position: relative;
    padding-left: 36px;
    margin-bottom: 15px;
    font-size: 17px;
    color: #444;
    line-height: 1.5;
    font-weight: 400;
}

/* SVG Icon Bullet */
.card-text .rich-text li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e33a7d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'%3E%3C/path%3E%3Cpolyline points='22 4 12 14.01 9 11.01'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* Theme based icon colors */
.theme-purple .rich-text li::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23504680' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'%3E%3C/path%3E%3Cpolyline points='22 4 12 14.01 9 11.01'%3E%3C/polyline%3E%3C/svg%3E");
}

.theme-blue .rich-text li::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'%3E%3C/path%3E%3Cpolyline points='22 4 12 14.01 9 11.01'%3E%3C/polyline%3E%3C/svg%3E");
}

.theme-green .rich-text li::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'%3E%3C/path%3E%3Cpolyline points='22 4 12 14.01 9 11.01'%3E%3C/polyline%3E%3C/svg%3E");
}

.card-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    background-color: #111;
    color: #fff;
    border-radius: 50px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.card-btn:hover {
    background-color: #333;
    transform: translateY(-2px);
}

/* Responsive */
@media only screen and (max-width: 991px) {

    .card-inner,
    .cascading-card:nth-child(even) .card-inner {
        flex-direction: column-reverse;
        /* Text on bottom, image on top for mobile? Or stack normally */
    }

    /* Make sure visual order is Image Top, Text Bottom for all on mobile */
    .card-inner {
        flex-direction: column-reverse;
    }

    .cascading-card:nth-child(even) .card-inner {
        flex-direction: column-reverse;
    }

    /* Actually, usually image top is better */
    .card-text {
        padding: 40px 30px;
        text-align: left;
    }

    .card-image {
        padding: 20px 20px 0 20px;
    }

    .card-text h2 {
        font-size: 32px;
    }

    .cascading-card {
        min-height: auto;
        margin-bottom: 50px;
    }
}

@media only screen and (max-width: 767px) {
    .cascading-cards-section {
        padding: 60px 0;
    }

    .cascading-card {
        top: 80px;
        margin-bottom: 40px;
        border-radius: 20px;
        min-height: auto;
    }

    .card-text {
        padding: 25px 20px;
    }

    .card-text .label-icon {
        width: 45px;
        margin-bottom: 15px;
    }

    .card-text h2 {
        font-size: 26px;
        margin-bottom: 15px;
    }

    .card-text p,
    .card-text .rich-text {
        font-size: 16px;
        line-height: 1.6;
        margin-bottom: 25px;
    }

    .card-text .rich-text li {
        font-size: 15px;
        padding-left: 32px;
    }

    .card-text .rich-text li::before {
        width: 20px;
        height: 20px;
    }

    .card-image {
        padding: 15px 15px 0 15px;
    }

    .card-image img {
        border-radius: 12px;
    }
}