Factional politics in a medieval society: a case study from fourteenth-century Foix