=== Decision Tree Navigator ===
Contributors: pawcassowithlove
Tags: decision tree, flow chart, resource navigator, guidance, interactive
Requires at least: 6.0
Tested up to: 6.9
Stable tag: 2.6.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Build beautiful, interactive decision trees to guide your users to the right resources. Perfect for IT support, HR benefits, or complex guidance.

== Description ==

Decision Tree Navigator is a powerful, lightweight plugin that allows you to create interactive, step-by-step guidance for your website visitors. Whether you are helping employees find the right HR form or guiding customers through technical troubleshooting, this plugin provides a premium, responsive interface that feels like a modern application.

= Features =
*   **Intuitive Editor**: Build complex trees with a drag-and-drop interface.
*   **"Other Options" Shortcut**: Ensure users find help even if they are on the wrong path with smart cross-links.
*   **Mobile Friendly**: Fully responsive design that works beautifully on all devices.
*   **Developer Friendly**: Clean CSS architecture and PHP filters for deep customization.
*   **Flexible Layouts**: Toggle Breadcrumbs, Sidebar, or "Other Options" shelf per tree from the dashboard.
*   **Lightweight**: Zero external dependencies; uses native WordPress patterns.

== Installation ==

1. Upload the `decision-tree` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Go to the **Decision Tree** menu to create your first tree.
4. Use the shortcode `[dtnav_decision_tree id="your-tree-id"]` to embed it in any page.

== Frequently Asked Questions ==

= Can I customize the colors? =
Yes! You can use the built-in Design editor or disable the default styles and use your theme's CSS.

= How many trees can I create? =
There is no limit. You can create as many independent trees as you need.

== Screenshots ==

1. The interactive frontend interface.
2. The powerful Decision Tree Editor.
3. Admin settings and tree management.

== Changelog ==

= 2.6.1 =
*   **Bug fix**: Fixed Back button always returning to Start instead of the previous step. Navigation history was not being recorded due to `activeId` being set before `render()` was called.

= 2.6.0 =
*   **Theme-Native Typography**: All font sizes now use `em` instead of `rem`, so the tree scales correctly with any theme's body font size — no more fixed-size mismatch.
*   **Simplified Editor**: Removed badges entirely (label + color fields) to reduce clutter and keep the editor focused on content that matters.
*   **Accessibility**: Added `aria-labelledby` to all landmark regions (`section`, `article`), fixed duplicate HTML `id` when multiple shortcodes appear on the same page, and corrected screen reader double-announcement caused by `aria-live` on the container.
*   **Navigation Fix**: Back button now uses a proper history stack instead of inferring path from tree structure, fixing incorrect back behavior after "Also available" jumps.
*   **Security**: Added missing capability check to the slug-generation AJAX handler; replaced `sanitize_textarea_field` with `wp_strip_all_tags` for CSS fields to preserve valid CSS attribute selectors.
*   **Bug Fixes**: Fixed empty custom CSS incorrectly bypassing the factory stylesheet; fixed missing `<aside>` closing tag in settings; corrected `esc_html__()/printf()` misuse to `wp_kses_post(sprintf())` for translatable strings containing HTML.

= 2.5.0 =
*   **Resource Card Linking**: Added a "Link URL" field to resource cards, allowing Organization names to become clickable.
*   **Smart Contact Details**: The details field now automatically detects and linkifies email addresses and URLs.
*   **UX Polish**: Improved URL detection to automatically repair missing protocols (e.g. www.cornell.edu -> https://www.cornell.edu).
*   **Accessibility**: Ensured all resource links are underlined for full WCAG compliance.

= 2.4.0 =
*   **Dashboard Controls**: Added per-tree toggles for Breadcrumbs, Sidebar, and "Other Options" shelf.
*   **Simplified UI**: Replaced clunky toggles with clean, professional checkboxes in the management table.
*   **Performance**: Improved logic for conditional assets loading.

= 2.3.0 =
*   Prefix Compliance: Renamed all internal PHP functions, hooks, options, and CSS handles from `cdt_` to `dtnav_` (5-character prefix) per WordPress.org guidelines.
*   Security: Applied `wp_strip_all_tags()` when outputting custom CSS via `wp_add_inline_style()` to prevent injection.
*   Readme: Added plugin owner to Contributors list.

= 2.2.0 =
*   Theme-First Architecture: Lowered CSS specificity for better theme integration.
*   WCAG Gold Standard: Improved focus management — focus now shifts specifically to the main heading (`h2`) upon navigation.
*   Robust Focus Indicators: Forceful focus rings and 100ms timing ensure visibility across all WordPress themes.
*   Enhanced Grid Layout: Unified grid-based alignment for all row-based UI components (Choices, "Other options").
*   Result Polish: Badges are now optional (tag-based); added "Purple" badge color option.
*   ARIA Cleanup: Removed redundant labels and ensured all icons are `aria-hidden="true"`.

= 2.1.0 =
*   Multi-tree support finalized.
*   CSS Variable support for primary and hover colors.
*   Improved database persistence.

= 2.0.0 =
*   Official public release.
*   New multi-tree support.
*   New "Other Options" visual shelf.
*   Improved security and database persistence.
