A host as an ecosystem: Wolbachia coping with environmental constraints