$width-feature-link: 320px; .feature-links { display: grid; grid-gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(320px,1fr)); list-style-type: none; padding-top: 0.5rem; margin-bottom: 2rem; } .feature-link { width: $width-feature-link; min-height: 135px; background-color: $white; border: 1px solid rgba($black, 0.1); border-radius: 3px; cursor: pointer; display: inline-block; position: relative; transition: box-shadow 0.2s; vertical-align: top; &:not(:hover) { .feature-link__background { filter: brightness(0.5); } } &:hover { box-shadow: 0 0 15px rgba($black, 0.15); .feature-link__title { color: $teal; } } } .feature-link__title { position: relative; top: 85px; font-weight: normal; text-align: center; z-index: 1; font-size: 1rem; transition: color 0.2s; } .feature-link__title-inner { display: inline-block; padding: .25rem .5rem; background-color: $white; border: 1px solid rgba(gray, 0.1); box-shadow: 0 2px 5px rgba($black, 0.025); border-radius: 3px; box-decoration-break: clone; } .feature-link__background { width: calc(100% + 2px); height: 100px; top: -1px; left: -1px; background-color: $teal; border-top-right-radius: 3px; border-top-left-radius: 3px; transition: filter 0.2s; overflow: hidden; position: absolute; z-index: 0; img { width: 100%; height: 100%; object-fit: cover; object-position: center; } }