To adapt this recipe for a gluten-free diet, replace the 3 cups of all-purpose flour with a gluten-free 1:1 baking flour blend. Ensure the blend includes xanthan gum or a similar binder for structure. Note that gluten-free flour may slightly alter the texture of the cake, potentially making it more delicate. Additionally, verify that your baking spray and any toppings you add are certified gluten-free to avoid cross-contamination.