Shell-model study of boron, carbon, nitrogen, and oxygen isotopes with a monopole-based universal interaction