The adaptive role of parental care to environmental changes