Església, territori i sociabilitat als segles XVII-XIX