A continuum theory of thermoelastic solids with diatomic structure