Maternal costs in offspring production affect investment rules in joint rearing