Local mechanisms for global daytime, nighttime, and compound heatwaves