why is Mercury’s temperature range form extreme high to extreme lowif it is so close to sun?

why is Mercury’s temperature range form extreme high to extreme lowif it is so close to sun?