I’m so glad that you will have time for side trips in Estonia. It is a lovely country. I second everything Badger said.
I loved Narva. It is such a cool site with fortresses on both sides of the river/border. The museum in the fortress is very nice. The Estonian side has a nice Riverwalk. We stayed in Narva Joesuu, which has a beautiful beach. This part of Estonia is struggling economically. It depended upon trade with Russia and Narva Joesuu depended on Russian tourists. It’s a super interesting place to visit.
We stopped briefly in Sillamae. I wish we had had more time. It’s pure Soviet architecture. It was a closed Soviet city. There is uranium in the surrounding area. They now process rare earths there.
I also highly recommend Lahemaa National Park. We loved the bog walk, seeing the coastal villages and the Palmse Manor.
Tartu is a really nice university town with an awesome museum, the Estonian National museum. Don’t miss this.
On the west side, you could visit Haapsalu and Parnu. I liked Haapsalu better. We were there in September which was off season. I’m sure both will be busier in summer.
We also spent 2 nights on Saaremaa island. We stayed in Kuressaare which has another nice fortress.
If you go to Riga, you will probably want to go by bus. I think they have revived the train, I’m thinking it went once a week (!) when we were there. The bus is nice. It’s express. There are several companies. Don’t stress about which one. They all seem about the same.