Margins and centers in the shaping of the Pyrenean slopes. Medieval dynamics within the long-term perspective