/* ------------------------------------------------------------- 28/05/2024 - * .b-cardgrid * -------------------------------------------------------------------------- * HTML ----
Big Ben

Headline
Subline

Eiffel Tower

Headline
Subline

Colosseum
Pisa Tower

Headline
Subline

Headline
Subline

* -------------------------------------------------------------------------- */ @mixin mQ($px) { @media screen and (max-width: $px) { @content; } } .b-cardgrid { display: grid; grid-gap: 1em; grid-template-columns: 25% 30% 15% 25%; //grid-template-rows: 50% 50%; //height: 80vh; min-height: 460px; @include mQ(690px) { height: 65vh; } @include mQ(470px) { grid-template-columns: repeat(2,1fr); grid-template-rows: repeat(3, 35%); } .card { @include mQ(470px) { grid-column: span 1; } @include mQ(690px) { &:nth-child(6) { grid-column: 2/4; grid-row: 2/3; } } @include mQ(470px) { &:nth-child(5) { grid-column: span 2; } } &:nth-child(2) { grid-column: 2/3; grid-row: span 2; @include mQ(690px) { grid-column: span 1; grid-row: span 1; } } &:nth-child(3) { grid-column: span 2; @include mQ(690px) { grid-column: 2/4; grid-row: 1/2; } } .card__img { position: relative; height: 100%; img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 1em; } } .card__titel { font-size: clamp(1rem, 0.8750rem + 0.6250vw, 1.5rem); line-height: 1; margin: 0; color: White; } .card__overlay { box-sizing: border-box; display: flex; justify-content: flex-end; flex-direction: column; position: absolute; bottom: 0; left: 0; width: 100%; height: 100%; padding: clamp(0.938rem,5vw,1.563rem); background: linear-gradient(0deg, rgb(0 0 0 / 57%) 0%, rgb(255 255 255 / 0%) 100%); border-radius: 1em; } /* .card__overlay */ } }