You can use this code to Website Tools > Custom CSS.
/* Gallery hover 07 */
.gallery-grid-item {
position: relative;
overflow: hidden;
}
.gallery-grid-item-wrapper::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #f6004c;
background-image: linear-gradient(#f6004c 10%, #000);
opacity: 0; /* Initially hide the gradient */
transition: opacity 0.3s ease; /* Smooth transition for the gradient appearance */
z-index: 9999;
}
.gallery-grid-item-wrapper:hover::before {
opacity: 0.75; /* Show the gradient overlay on hover */
}

Result
