For some special nerd bonus, have a look at the Cosplay/Comic Conference: https://www.sanmarinocomics.com/
This fair is held in the San Marino castle and this is one of the most intriguing atmospheres I have every experienced, whether you like Cosplay or not. I accidentally ran into the event a couple of years ago.
Another bonus tip: San Marino is near Rimini as well as Venice. Party and culture meet again.