  It has been shown that contact geometry is the proper framework underlying
classical thermodynamics and that thermodynamic fluctuations are captured by an
additional metric structure related to Fisher's Information Matrix. In this
work we analyze several unaddressed aspects about the application of contact
and metric geometry to thermodynamics. We consider here the Thermodynamic Phase
Space and start by investigating the role of gauge transformations and Legendre
symmetries for metric contact manifolds and their significance in
thermodynamics. Then we present a novel mathematical characterization of first
order phase transitions as equilibrium processes on the Thermodynamic Phase
Space for which the Legendre symmetry is broken. Moreover, we use contact
Hamiltonian dynamics to represent thermodynamic processes in a way that
resembles the classical Hamiltonian formulation of conservative mechanics and
we show that the relevant Hamiltonian coincides with the irreversible entropy
production along thermodynamic processes. Therefore, we use such property to
give a geometric definition of thermodynamically admissible fluctuations
according to the Second Law of thermodynamics. Finally, we show that the length
of a curve describing a thermodynamic process measures its entropy production.
