(idiomatic) To imagine visionary projects or schemes; to daydream; to have an idle fancy, a pipe dream or any plan, desire, or idea that is unlikely to be realized.
Origin
The first term dates from the late 1500s. The variant, castles in Spain (châteaux en Espagne), was recorded in the Roman de la Rose in the 13th century and translated into English around 1365.