Bottom-up modeling of damage in heterogeneous quasi-brittle solids