The lack of formulation of macroscopic equations for irreversible dynamics of viscous heat-conducting media compatible with the causality principle of Einstein's special relativity and the Euler-Lagrange structure of general relativity is a long-lasting problem. In this paper, we propose a possible solution to this problem in the framework of SHTC equations. The approach does not rely on postulates of equilibrium irreversible thermodynamics but treats irreversible processes from the non-equilibrium point of view. Thus, each transfer process is characterized by a characteristic velocity of perturbation propagation in the non-equilibrium state, as well as by an intrinsic time/length scale of the dissipative dynamics. The resulting system of governing equations is formulated as a first-order system of hyperbolic equations with relaxation-type irreversible terms. Via a formal asymptotic analysis, we demonstrate that classical transport coefficients such as viscosity, heat conductivity, etc., are recovered in leading terms of our theory as effective transport coefficients. Some numerical examples are presented in order to demonstrate the viability of the approach. This article is part of the theme issue 'Fundamental aspects of nonequilibrium thermodynamics'.