Classical KMS condition and Tomita--Takesaki theory