Foundations of continuum thermodynamics