# Feature: Tooltip Runtime

## Intent

Problem: tooltip styling does not provide accessible show/hide timing, trigger relationships, hover/focus handling, Escape dismissal, or cleanup.
Users or stakeholders: application teams, QA, keyboard users, screen reader users, and framework package maintainers.
Desired outcome: implement Tooltip as progressive runtime behavior for existing Seventh UI markup.
Non-goals: implement rich interactive popovers, validation messages, or a positioning engine.

## Scope

In scope: trigger association, delayed show/hide, hover and focus handling, Escape dismissal, ARIA description, reduced-motion timing, events, and cleanup.
Out of scope: visual placement calculations, arrow drawing, CSS transitions, and interactive tooltip content.

## Markup Hooks

- Trigger: `[data-sui-tooltip]` or `[data-sui-trigger="tooltip"]`.
- Tooltip content: `[role="tooltip"]` or `[data-sui-tooltip-content]`.
- Target: `data-sui-target`, `aria-describedby`, or generated relationship when safe.

## Behavior

1. Tooltip show dispatches `sui:tooltip:before-show`; cancellation blocks display.
2. Tooltip hide dispatches `sui:tooltip:before-hide`; cancellation blocks hiding.
3. Successful state changes dispatch `sui:tooltip:show` and `sui:tooltip:hide`.
4. Hover and focus show the tooltip after configured delay.
5. Pointer leave, blur, Escape, or trigger removal hides the tooltip.
6. Timing respects `prefers-reduced-motion` for delay-sensitive behavior.
7. Cleanup clears timers and removes trigger/content listeners.

## Accessibility

Use `role="tooltip"` and `aria-describedby` relationships. Tooltip content must not contain interactive controls; those belong to Popover/Menu/Dialog patterns.

## Acceptance Examples

Scenario: focus trigger
Given a trigger references tooltip content
When the trigger receives focus
Then the tooltip is shown and the trigger describes itself through the tooltip id.

Scenario: cleanup clears timers
Given a tooltip has a pending show delay
When the component is destroyed
Then the tooltip does not show later.
