.expanding-cards-container {
    display: flex;
    gap: 50px; /* Space between cards */
    width: 100%;
    overflow: hidden;
    height: 600px; /* Set height for all cards */
    border-radius: 30px;
    align-items: stretch;
}

.expanding-card {
    position: relative;
    flex: 0.3; /* Default shrunk state */
    height: 100%;
    background-color: #f3f3f3;
    cursor: pointer;
    /* transition: 500ms cubic-bezier(0.05, 0.61, 0.41, 0.95); */
    transition: all 0.6s ease-in-out;
    overflow: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 30px;
    min-height: 600px;
    overflow: hidden;
    will-change: transform, opacity;
}

.expanding-card.fully-open {
    transition: all 0.4s ease-in-out;
}

.expanding-card:not(.fully-open) {
    transition: all 0.4s ease-in-out;
}

/* First card starts as active */
.expanding-card.active {
    flex: 0 0 450px;
}

/* Remove overlay for active card */
.expanding-card.active .card-content {
    opacity: 1;
    background: none;
}

/* Background image covers the card */
.expanding-card .card-image {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease-in-out;
}

/* Default: Title in inactive cards - fully vertical */
.expanding-card .vertical-title {
    writing-mode: vertical-rl; /* Make text vertical */
    text-orientation: mixed;
    font-size: 32px;
    font-weight: bold;
    color: #fff;
    position: absolute;
    left: 10px; /* Move to left side */
    top: 70%;
    transform: translateY(-50%) rotate(181deg); /* No rotation, just vertical */
    transition: opacity 0.5s ease-in-out;
    white-space: nowrap;
    font-family: "EudoxusSans", Sans-serif;
    font-weight: 700;
}

.card-details h3{
    font-family: "EudoxusSans", Sans-serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 46px;
    color: #ffffff;
    margin-bottom: 5px;
}

.card-details p {
    font-family: "EudoxusSans", Sans-serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 36px;
    color: #ffffff;
    margin-top: 0;
}

.expanding-card.show-content .card-details {
    opacity: 1;
    transform: translateY(-50);
}

/* Shrink other cards by default */
.expanding-card:not(.active) {
    flex: 0.3;
}

/* Hide vertical title when card is active */
.expanding-card.active .vertical-title {
    opacity: 0;
}

/* Show title & content normally when active */
.expanding-card .card-details {
    display: none;
    text-align: left;
    color: #fff;
    position: absolute;
    bottom: 20px;
    left: 42%;
    transform: translateX(-50%);
    width: 80%;
    padding: 10px;
    border-radius: 8px;
}

.expanding-card.active .card-details {
    display: block;
    animation-name: sub-content-fade;
    animation-duration: 500ms;
}

@keyframes sub-content-fade{
    0% {
        opacity: 0;
    }
    
    80% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}


/* TABLET RESPONSIVE */

@media (min-width:768px) and (max-width:1024px){
    .expanding-cards-container{
        gap: 10px;
    }

    .expanding-card.active {
        flex: 0 0 300px;
    }

    h3.vertical-title {
        margin: 0;
    }

    .card-details h3{
        font-size: 24px;
        line-height: 32px;
    }

    .card-details p{
        font-size: 15px;
        margin: 0;
    }

    h3.vertical-title {
        font-size: 24px !important;
    }

    .expanding-card .vertical-title{
        top: 75%;
    }
}


/* MOBILE RESPONSIVE */

@media (max-width:767px){
    .expanding-cards-container {
        display: grid;
        gap: 10px;
    }

    .expanding-cards-container {
        height: 3100px !important;
    }

    .card-details {
        display: block !important;
        opacity: 1 !important;
    }

    h3.vertical-title {
        opacity: 0;
    }

    .card-details h3{
        font-size: 25px;
        line-height: 35px;
    }

    .card-details p{
        font-size: 16px;
        line-height: 26px;
        margin: 0px !important;
    }
}
