Calculate positions for nested blocks