Finally I found a way to make borders around my floated divs collapse like on table cells. The key was to use box-shadow instead of border. (So this is actually a trick to simulate borders.)
I couldn’t use display:table-cell because table cells don’t get rearranged vertically the way I want in responsive scenarios.