01 - Preheat oven to 375°F. Lightly grease a 9x13-inch baking dish with olive oil or nonstick spray and set aside.
02 - Heat olive oil in a large skillet over medium heat. Add the diced onion and cook until softened and translucent, about 3 minutes. Add the minced garlic and sauté for 1 additional minute until fragrant.
03 - Add the chopped spinach to the skillet and cook, stirring occasionally, until fully wilted, about 2 minutes. Remove the skillet from heat and set aside to cool slightly.
04 - In a large mixing bowl, combine the softened cream cheese and sour cream. Stir vigorously until smooth and well blended.
05 - Fold the shredded chicken, chopped artichoke hearts, spinach and onion mixture, half of the mozzarella, Parmesan cheese, dried oregano, dried basil, salt, black pepper, and red pepper flakes into the creamy base. Mix until all ingredients are evenly distributed.
06 - Transfer the mixture to the prepared baking dish and spread into an even layer. Sprinkle the remaining mozzarella cheese uniformly over the top.
07 - Bake uncovered for 30 minutes, or until the edges are bubbling and the cheese topping is golden brown and melted.
08 - Remove from the oven and let rest for 5 minutes to allow the casserole to set before slicing and serving.