Foraging in a variable world: species interactions across ecological gradients