Two-stage capillary condensation in pores with structured walls: A nonlocal density functional study