Text this: Scalar-tensor theories of gravity from a thermodynamic viewpoint