Struggling to find the right words to ask this question has made it difficult for me to locate relevant search results. However, I believe a picture is worth a thousand words so...https://i.stack.imgur.com/LfPMO.png
I am looking to create multiple columns of divs with varying heights that adjust their vertical alignment based on the div above them within the same column, rather than in relation to neighboring divs.
Edit:
In addition, I need the number of columns to automatically adapt based on screen size. This means there could be anywhere from one to four columns at any given time, while maintaining the same total number of divs.