Adaptive thermoregulation in complex landscapes