WordPress conditional tags are an obvious candidate here. I’m typing from my phone, but the gist would be to put a conditional tag to check if you’re on a blog or archive page directly in the <main class="classes and conditional statements go here"> tag.
Another option would be to fire Masonry using a different selector that’s already in place on the site. I haven’t implemented Masonry in a while but from their wrbsite it looks like you could fire it from any selector.