Ancient subaerial exposure and freshwater leaching in sandstones