.subpages-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 0 20px;
}
.subpage-item {
    border: 1px solid #ddd;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    flex: 1 1 20%;
    position:relative;
    overflow: hidden;
}

.subpage-item a {
    -webkit-transition: 1s;
    transition: 1s;
    width: 100%;
}

.subpage-item a figure {
    position: relative;
}

.subpage-item a figure img {
    max-width: 100%;
    height: auto;    
}

.subpage-item a figure:after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, .3);
    display: block;
    content: "";
}

.subpage-item a h2 {
    position: absolute;
    z-index: 2;
    top: 50%;
    font-size: 1.4rem;
    padding: 0 20px;
    transform: translateY(-50%);
    width: 100%;
    text-align: center;
}

.subpage-item .bg-color {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-transition: 1s;
    transition: 1s;
    border: 6px solid rgb(217, 208, 195);
    background: #3ab3f1;/* linear-gradient(0deg, rgba(58, 179, 241, 1) 0%, rgba(25, 154, 221, 1) 35%, rgba(22, 156, 225, 1) 100%);*/
}


.subpage-item:hover .bg-color {
    height: 0;
}

@media only screen and (max-width: 1240px) {
    .subpage-item a h2 {
        font-size: 18px;
        line-height: 25px;
        padding: 0 10px;
    }
}
@media only screen and (max-width: 959px) {
    .subpage-item {
        flex-basis: 33%;
    }
}
@media only screen and (max-width: 767px) {
    .subpage-item {
        flex-basis: 50%;
    }
}