section .cards {
    height: 400px;
    border-radius: 5px;
    border: 1px solid #494949;
    padding: 20px;
    display: flex;
    justify-content: end;
    flex-direction: column;
    position: relative;
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
}

section .cards::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, rgba(0, 0, 0, 0.90) 100%);
    border-radius: 5px;
    pointer-events: none;
    z-index: 1;
    transition: all 0.4s ease-in-out;
    /* Ensure gradient is below the text */
    -webkit-transition: all 0.4s ease-in-out;
    -moz-transition: all 0.4s ease-in-out;
    -ms-transition: all 0.4s ease-in-out;
    -o-transition: all 0.4s ease-in-out;
}

section .cards:hover::after {
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.50) 0%, rgba(0, 0, 0, 0.50) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, rgba(0, 0, 0, 0.90) 100%);
}

section .cards h3 {
    color: white;
    position: relative;
    z-index: 2;
    /* Ensure text appears above the gradient overlay */
}

section .cards:hover h3 {
    transition: all 0.3s ease-in-out;
    color: #E6333A !important;
}