A categorical account of composition methods in logic (extended version) (Logical Methods in Computer Science, 2025)