Preheat the oven to 350°F (175°C).
Grease and line two 8-inch round cake pans with parchment paper.
Whisk together the flour, baking powder, baking soda, and salt.
Beat the butter and sugar until light and fluffy.
Add the eggs one at a time, beating well after each addition.
Mix in the vanilla extract, lemon zest, and lemon juice.
Alternately add the dry ingredients and buttermilk, beginning and ending with the flour mixture.
Toss the raspberries with 1 tablespoon flour.
Gently fold the raspberries into the batter.
Divide the batter evenly between the prepared pans.
Bake for 30–35 minutes or until a toothpick inserted in the center comes out clean.
Cool the cakes in the pans for 10 minutes.
Transfer to a wire rack and cool completely.
Beat the cream cheese and butter until smooth.
Add the powdered sugar gradually and beat until fluffy.
Mix in the lemon juice, lemon zest, and vanilla extract.
Frost the cooled cake layers.
Decorate with fresh raspberries, lemon slices, and lemon zest before serving.