Thermodynamic and structural aspects of the dehydration of smectites in sedimentary rocks