Make the frame narrower. When the main side would get less than half the width, it wraps below and both sides fill the row.
.sidebar
, 20rem when there is room
.main
, the rest, and never less than half