/* Trade-off Cards Section */
.trade-off-cards-section {
    width: 100%;
    background-color: var(--color-white);
    padding: 155px 0;
    position: relative;
    overflow: hidden;
    background-image: url('/wp-content/uploads/static/blue-balloon-bg.png');
    background-size: 100% 100%;
    background-position: -130px 130px;
    background-repeat: no-repeat;
    border-bottom-left-radius: 300% 150px;
    border-bottom-right-radius: 300% 150px;
    clip-path: inset(0 0 -150px 0); /* Ensures the curved edge is visible */
    z-index: 3; /* Ensure this is lower than header z-index */

    .trade-off-cards-container {
        margin: 0 auto;
        padding: 250px 20px 0;
    }

    /* Section Title */
    .section-title {
        color: var(--color-red);
        font-size: var(--font-size-h2-bow);
        line-height: var(--font-lh-h2-bow);
        margin-bottom: 0px;
        text-align: center;
        font-weight: 600;
    }

    /* Card Wrapper */
    .trade-off-card-wrapper {
        margin: 60px 0 0;

        &:last-child {
            margin-bottom: 0;
        }
    }

    /* Shadow Wrapper */
    .trade-off-card-shadow-wrapper {
        position: relative;
        max-width: 1194px;
        margin: 0 auto;
        padding-bottom: 20px;
        filter: drop-shadow(0px 6px 12px rgba(0, 0, 0, 0.2));
    }

    /* Trade-off Card */
    .trade-off-card {
        width: 100%;
        margin: 0 auto;
        padding: 0;
        background-color: var(--color-white);
        position: relative;
        display: flex;
        flex-direction: column;
        clip-path: var(--clip-path-smooth-bowl);
    }

    /* Remove old background containers */
    .card-top-bg,
    .card-bottom-bg {
        display: none;
    }

    /* Card Header */
    .card-header {
        padding: 70px 60px 20px;
        position: relative;
        z-index: 2;
    }

    .card-title {
        color: var(--color-red);
        font-size: var(--font-size-trade-off-card-title);
        line-height: var(--font-lh-trade-off-card-title);
        font-weight: 600;
        text-transform: uppercase;
        margin: 0;
        position: relative;
        padding-right: 30px;
        display: inline-block;

        &::after {
            content: '';
            position: absolute;
            right: -590px; /* This will be adjusted to extend to the end of card */
            bottom: 0;
            height: 1px;
            background-color: var(--color-red);
            width: 590px; /* This will be adjusted based on card width */
        }
    }

    /* Card Content */
    .card-content {
        background-color: var(--color-white);
        padding: 10px 40px 40px;
        position: relative;
        z-index: 2; /* Above the background images */
        flex: 1; /* Allow this section to expand */
    }

    .content-columns {
        display: flex;
        flex-wrap: wrap;
        gap: 30px;
    }

    .image-column {
        flex: 0 0 277px;
    }

    .column-image {
        width: 100%;
        height: auto;
        margin: 0;

        img {
            width: 100%;
            height: auto;
            display: block;
        }
    }

    .text-column-1,
    .text-column-2 {
        flex: 1;
    }

    .text-group {
        margin-bottom: 30px;

        &:last-child {
            margin-bottom: 0;
        }
    }

    .text-title {
        font-size: var(--font-size-body);
        line-height: var(--font-lh-body);
        color: var(--color-red);
        margin: 0 0 10px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .text-description {
        font-size: var(--font-size-body);
        line-height: var(--font-lh-body);
        margin: 0;
        padding-right: 30px;
    }

    /* Card Footer */
    .card-footer {
        background-color: var(--color-nav-gray);
        padding: 30px 50px 0 90px;
        max-height: 178px;
        min-height: 178px;
        position: relative;
        z-index: 2; /* Above the background images */
        margin-top: 0px;
        margin-bottom: 60px; /* Increased to make room for bottom background */
    }

    .footer-columns {
        display: flex;
        align-items: flex-end;
        gap: 30px;
    }

    .footer-text-column {
        flex: 3;
    }

    .footer-image-column {
        flex: 1;
        display: flex;
        justify-content: center;
    }

    .footer-quote {
        font-size: var(--font-size-trade-off-card-quote);
        line-height: var(--font-lh-trade-off-card-quote);
        color: var(--color-yellow);
        font-weight: 600;
        margin: 0 0 10px;
        position: relative;

        &::before {
            content: '';
            position: absolute;
            width: 16px;
            height: 14px;
            background-size: contain;
            background-repeat: no-repeat;
            background-image: url('/wp-content/uploads/static/opening-quotes-white.svg');
            left: -25px;
            top: 3px;
        }
    }

    /* Remove the ::after pseudo-element */
    .footer-quote::after {
        content: none;
    }

    /* Add a class for the closing quote span */
    .closing-quote {
        display: inline-block;
        width: 16px;
        height: 14px;
        background-image: url('/wp-content/uploads/static/closing-quotes-white.svg');
        background-size: contain;
        background-repeat: no-repeat;
        position: relative;
        top: -2px;
        margin-left: 6px;
    }

    .footer-citation {
        font-size: var(--font-size-trade-off-card-quote-attribution);
        line-height: var(--font-lh-trade-off-card-quote-attribution);
        color: var(--color-white);
        margin: 0;
    }

    .footer-image {
        margin: 0;
        position: absolute;
        bottom: 0;
        max-width: 227px;
        z-index: 3; /* Ensure it appears above the bottom background */

        img {
            display: block;
            width: 100%;
            height: auto;
        }
    }

    /* Reverse layout for second card footer */
    .card-footer.reverse .footer-columns {
        flex-direction: row-reverse;
    }

    @media screen and (max-width: 1024px) {

        .trade-off-cards-container {
            margin: 0 auto;
            padding: 30px 20px 0;
        }

        .card-title::after {
            right: -350px;
            width: 350px;
        }
    }

    @media screen and (max-width: 768px) {
        .trade-off-card-shadow-wrapper {
            filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.2));
        }
        .trade-off-card {
            clip-path: var(--clip-path-mobile-bowl);
        }

        .card-header {
            text-align: center;
        }

        .card-title {
            margin: 0 auto;
            padding-right: 0;

            &::after {
                display: none;
            }
        }
        
        .column-image {
            max-width: 190px;
            margin: 0 auto;
        }

        /* Center content elements */
        .content-columns {
            flex-direction: column;
            align-items: center;
            text-align: center;
        }

        .image-column {
            flex: none;
            width: 100%;
            padding-bottom: 20px;
            border-bottom: 1px solid var(--color-red);
            margin-bottom: 20px;
        }

        .column-image {
            max-width: 190px;
        }

        .text-column-1,
        .text-column-2 {
            flex: none;
            width: 100%;
        }

        .text-title {
            font-size: 1.6rem;
            line-height: 2.2rem;
        }

        .text-description {
            font-size: 1.6rem;
            line-height: 2.2rem;
            padding-right: 0;
        }

        /* Card footer adjustments */
        .card-footer {
            padding: 30px 20px 0;
            max-height: none;
            margin-bottom: 80px;
        }

        .footer-columns {
            flex-direction: column !important;
            gap: 20px;
        }

        .footer-text-column {
            flex: none;
            width: 100%;
            order: 1;
        }

        .footer-image-column {
            flex: none;
            width: 100%;
            order: 2;
        }

        .footer-image {
            position: relative;
            max-width: 270px;
            margin: 0 auto;
            bottom: 0;
        }

        /* Footer quote adjustments */
        .footer-quote {
            padding: 30px 0;
            border-top: 1px solid var(--color-white);
            border-bottom: 1px solid var(--color-white);
            margin-top: 20px;
            font-size: 1.8rem;
            line-height: 2.4rem;
            font-weight: 700;
            text-align: center;

            &::before {
                left: 50%;
                transform: translateX(-50%);
                top: -10px;
                padding: 0 30px 0 30px;
                background-color: var(--color-nav-gray);
                background-size: 16px 14px;
                background-position: center;
                margin: 0 auto;
            }

            &::after {
                content: '';
                position: absolute;
                width: 16px;
                height: 14px;
                background-size: 16px 14px;
                background-repeat: no-repeat;
                background-image: url('/wp-content/uploads/static/closing-quotes-white.svg');
                background-size: contain;
                background-repeat: no-repeat;
                padding: 0 30px 0 30px;
                background-position: center;
                margin: 0 auto;
                background-color: var(--color-nav-gray);
                left: 50%;
                transform: translateX(-50%);
                bottom: -10px;
            }
        }

        .footer-citation {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 5px;
            text-align: center;
            margin-top: 20px;
            font-size: 1.6rem;
            line-height: 2.6rem;

            span {
                display: block;
            }
        }

        .closing-quote {
            display: none !important;
        }
        
        .footer-columns {
            margin-bottom: 0;
        }

        .card-footer {
            margin-bottom: 40px;
        }

        /* Force reverse layout to follow same order */
        .card-footer.reverse .footer-columns {
            flex-direction: column !important;
        }

        .card-footer.reverse .footer-text-column {
            order: 1;
        }

        .card-footer.reverse .footer-image-column {
            order: 2;
        }
    }

    /* Override WordPress core column stacking */
    @media screen and (min-width: 769px) {
        .content-columns,
        .footer-columns {
            display: flex !important;
            flex-direction: row !important;
            flex-wrap: nowrap !important;
            gap: 30px !important;
        }

        .image-column {
            flex: 0 0 277px !important;
            width: 277px !important;
            max-width: 277px !important;
        }

        .footer-image-column {
            flex: 0 0 150px !important;
            width: 150px !important;
            max-width: 150px !important;
        }

        .text-column-1,
        .text-column-2,
        .footer-text-column {
            flex: 1 1 0% !important;
            width: auto !important;
        }
    }
} 