Find the Closest Ancestor DOM Element Matching a Selector
Efficiently navigate the DOM tree to find the nearest parent or ancestor element that matches a given CSS selector using JavaScript's `closest()` method. Ideal for event delegation and context-aware interactions.