Intermediate states approach for adsorption studies in flexible metal-organic frameworks.