Width calculation for block layout