Community structure or function: effects of environmental stress on benthic macroinvertebrates at different spatial scales