Tune direction, wrap, alignment and gap visually, then copy the layout CSS
display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: flex-start; align-items: stretch; gap: 12px;
The boxes have different heights so align-items is visible; grid mode uses repeat(N, 1fr) for equal columns.