Adapting foraging to habitat heterogeneity and climate change: an individual-based model for wading birds