Preheat your oven to 350°F (175°C).
Heat a skillet over medium heat. Add a drizzle of olive oil and sauté the chopped onion until translucent, about 5 minutes. Add the minced garlic and sauté for another minute. Remove from heat and let it cool slightly.
In a large mixing bowl, combine the drained spinach, feta, ricotta, sautéed onion and garlic, dill, and the beaten egg. Season with salt and pepper. Mix well until fully incorporated.
Lay out the phyllo dough on a clean, dry surface. Keep the unused phyllo covered with a damp kitchen towel to prevent drying out.
Brush the bottom of your baking dish with melted butter. Take one sheet of phyllo dough and lay it in the dish, letting the edges hang over the sides. Brush the sheet lightly with melted butter.
Repeat this process with 6-8 more sheets, brushing each layer with butter. Ensure the layers are overlapping and lightly buttered.
Spread the spinach filling evenly over the phyllo layers.
Fold the overhanging edges of the phyllo over the filling. Carefully layer additional sheets of phyllo on top of the filling (around 5 sheets), buttering each one as you go.
Using a sharp knife, cut the top layers of phyllo into squares or diamonds (this will make it easier to serve after baking).
Brush the top layer generously with more melted butter and sprinkle with a bit of salt.
Bake in the preheated oven for 35-45 minutes or until the top is golden brown and crisp.
Once done, allow it to cool slightly before slicing and serving.