Climate variability, local adaptation, and fitness consequences for ectotherms along latitudinal environmental gradients