Step 1Whisk the hazelnut flour, baking powder and cardamom with 2 cups all-purpose flour, ¾ cup granulated sugar and ¾ teaspoon salt in a large bowl. Add the butter, toss to coat and press into the dry ingredients using a pastry cutter or your fingers until coarse crumbs form. Drizzle the egg over, and mix with a fork or your fingers until incorporated and the mixture forms large clumps. Or, use a food processor and pulse the dry ingredients until mixed, then pulse in the butter until coarse crumbs form. Add the egg and pulse until large clumps form.
Step 2Line the bottom and sides of a 13- by 9-inch cake pan with foil, leaving overhang on all sides, and lightly coat the foil with nonstick cooking spray. Scatter two-thirds of the dough clumps evenly across the bottom of the pan, then press into the bottom in an even layer. Gather the remaining dough, press into a 1-inch-thick disk, and wrap in plastic wrap. Refrigerate both until the dough is firm, at least 30 minutes.
Step 3Meanwhile, arrange the oven racks in the top and bottom thirds of the oven and heat to 375 degrees.
Step 4Prepare the blueberry filling by mixing the remaining 2 tablespoons all-purpose flour, ½ cup granulated sugar and ¼ teaspoon salt in a large bowl. Add the blueberries and lemon juice and fold until evenly mixed. Spread the blueberry mixture over the chilled dough in the pan. Bake on the lower rack until the blueberry mixture is jammy and bubbling around the edges, 50 to 55 minutes.
Step 5While that bakes, unwrap the disk of dough, reserving the plastic wrap, and put on a lightly floured surface. Cover the dough disk with the plastic wrap and roll to ¼ thickness. Uncover and use a 1 ½-inch cookie cutter (whatever shape you like) to cut out 24 shapes. Gather scraps, reroll and cut again if needed.
Step 6Line a large cookie sheet with parchment paper. Put the shapes on the sheet, spacing 1 inch apart. Bake on the upper rack (while the blueberry base is baking on the bottom rack) until golden brown, 12 to 15 minutes. Cool completely on the sheet on a rack. Dust with powdered sugar.
Step 7Place the pan with the blueberry mixture on a rack and let cool just until the bubbling subsides, then arrange the cookies on top in a 6-by-4 grid and gently and carefully press into the hot blueberry mixture. Cool completely on the rack.
Step 8Using the overhanging foil, lift and slide the bars onto a cutting board and cut into 24 bars.
Blueberry Almond Bars
Substitute almond flour for the hazelnut flour.
Mixed Berry Bars
Substitute a mixture of blueberries, raspberries and blackberries for the blueberries. Do not use strawberries as their water content is much higher.
Blueberry Crumb Bars
Instead of pressing the remaining one-third of dough for the top into a disk and cutting into shapes, refrigerate it in clumps. After spreading the blueberry mixture over the chilled bottom dough, break the large clumps reserved for the top into smaller clumps and scatter evenly over the blueberry mixture. Omit the powdered sugar. Bake in the center of the oven until the filling is bubbling and the topping is golden brown, 50 to 55 minutes.