/* Container for hover effect */
.card-hover {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none; /* Remove underline from link */
}
/* Ensure image covers entire card and add zoom on hover */
.card-hover .card-img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    transition: transform 0.5s ease;
}
.card-hover:hover .card-img {
    transform: scale(1.1);
}
/* Semi-transparent mask overlay */
.card-hover .mask {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 2;
}
/* Gradient at bottom */
.card-hover .bottom-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    z-index: 3;
}
/* Text centered on mask */
.card-hover .mask-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    color: #fff;
    text-align: center;
    padding: 0 1rem;
}

.card-hover .additional-text {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    /* remove the old background */
    background: none;
    padding: 0;          /* we’ll handle padding on the text wrapper */
    z-index: 5;
    overflow: hidden;    /* ensure pseudo‐element doesn’t overflow */
}

/* create a masked background behind the text */
.card-hover .additional-text::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    /* fade mask from opaque at bottom to transparent at top */
    mask-image: linear-gradient(to top, black 0%, transparent 100%);
    -webkit-mask-image: -webkit-linear-gradient(to top, black 0%, transparent 100%);
    transition: opacity 0.3s ease-in-out;
}

/* wrap your actual text in an inner span so it sits above the pseudo‐element */
.card-hover .additional-text span {
    position: relative;
    display: block;
    padding: 12px;
    color: #fff;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* hide icon by default */
.card-hover .additional-text i {
    position: relative;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* on hover, fade the pseudo‐background in AND show the text at full opacity */
.card-hover:hover .additional-text::before {
    opacity: 1;
}

.card-hover:hover .additional-text span {
    opacity: 1;
}

/* show icon on hover */
.card-hover:hover .additional-text i {
    opacity: 1;
}