main { display: grid; grid-template-columns: repeat(1, 1fr); @media (min-width:1200px) { grid-template-columns: repeat(2, 1fr); } @media (min-width:1650px) { grid-template-columns: repeat(3, 1fr); } @media (min-width:2200px) { grid-template-columns: repeat(4, 1fr); } grid-auto-flow: row dense; grid-gap: 1rem; justify-content: center; text-align: center; background-color: #fafafa; width: 80%; justify-self: center; & .container { border-color: grey; border-radius: 20px; border: 1px solid grey; padding: 1em; cursor: pointer; background-color: white; & span { display: block; } & .title { font-size: medium; } & .subtitle { font-size: smaller; color: lightgrey; } } } .item { display: flex; flex-direction: row; flex-wrap: wrap; & article:first-child { flex: 1; } }