Washing wedges: capillary instability in a gradient of confinement