calculate available width/height excluding margins, borders and padding of the container