.blog-posts { display: grid; grid-auto-flow: dense; grid-gap: 10px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); padding: 1vw; figure > img { width: 100%; height: 100%; margin: 0; } figure { position: relative; width: 100%; height: 100%; margin: 0; &:hover > .blog-post-caption { min-height: 100%; & > div { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } } } .blog-post-caption { box-sizing: border-box; position: absolute; bottom: 0; left: 0; background-color: #000000aa; color: white; width: 100%; min-height: 1rem; font-size: 1.4rem; text-align: center; transition: min-height 0.25s ease; padding: 10px; div { .blog-post-caption-date { font-size: 1.3rem; color: #e0e0e0; } } } @media (min-width: 650px) { a:first-child { grid-column: span 2; grid-row: span 2; } a:nth-child(4n) { grid-column: span 2; grid-row: span 2; } } } .blog-post-featured-image { position: relative; height: 50vh; overflow: hidden; background-position-y: 50%; background-repeat: no-repeat; background-size: cover; .cover { width: 100%; height: 100%; background-color: #00000088 } .post-info { position: absolute; bottom: 0; left: 0; width: 100%; background-color: #00000088; color: white; padding: 15px; .post-title { margin-top: 0; } .author, .date, .reading-time { margin-right: 10px; } } }