Direct and indirect effects of climate and habitat factors on butterfly diversity