On Thursday, visitors to the Grand Canyon got to see something striking and fairly unusual — the entire canyon was filled with a dense, white fog. It looked like this:

And like this:

And like this:

Those photos were taken on December 11 by Maci MacPherson and Michael Quinn and posted to the Grand Canyon National Park's Flickr page. The park also released a timelapse video:

So what caused the fog? The short answer is that a temperature inversion basically trapped clouds inside the canyon. Jason Samenow of the Washington Post's Capital Weather Gang has a helpful explanation:

The fog formed due to what's known as a total temperature inversion. This occurs when a cold layer of air is trapped at the base of the canyon and is topped by a warmer layer. On clear, calm nights, the rate of cooling near the surface increases and, if there is low level moisture present, condensation processes kick in and fog forms. And on Thursday at the Grand Canyon, recent rains in the region provided the moisture necessary for the fog to develop.

The diagram below gives some sense of what an inversion looks like. Normally during the day, the air near the ground is warmer than the air higher up (largely because of solar radiation hitting the Earth's surface). But under certain conditions — say, a high-pressure system that brings calm winds — the air near the ground can cool very rapidly during the night and an inversion will form:

If this happens when there's a lot of moist air in the Grand Canyon — because it just rained, say — then this inversion layer of warm air will trap all that moisture near the ground. And when that moist air cools and condenses at night, you get fog. (Eventually the sun will burn it off, but it's neat while it lasts.)

Inversions in the Grand Canyon region can happen fairly often — usually in the winter — but it's a bit rarer for one to fill the entire canyon with clouds. Conditions have to be just right. The AP reports that this only happens a few times per decade, with the last such event occurring in December 2013.