=== Tidy Table of Contents ===
Contributors: pierreferrolliet
Tags: table of contents, toc, navigation, headings, seo
Requires at least: 6.0
Tested up to: 7.0
Stable tag: 1.0.8
Requires PHP: 8.2
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatic, accessible and performant table of contents for WordPress. Zero configuration needed.

== Description ==

Tidy Table of Contents automatically generates a clean, accessible table of contents from your headings. It works out of the box with no configuration, and offers deep customization when you need it.

**Key features:**

* 🤖 **Automatic** — parses H2–H6 headings and generates the TOC instantly
* ♿ **Accessible** — proper ARIA roles, keyboard navigation
* ⚡ **Performant** — output cached per post, no render-blocking JS
* 🎨 **Customizable** — configure depth, position, title, open/collapsed state
* 📌 **Per-post control** — override global settings via meta box
* 🔗 **Smooth scroll** — animated anchor navigation
* 📱 **Responsive** — collapsible on mobile
* 🧩 **Shortcode** — `[tidy_toc]` for manual placement

== Installation ==

1. Upload the `tidy-table-of-contents` folder to `/wp-content/plugins/`
2. Activate the plugin through the **Plugins** menu in WordPress
3. The TOC will appear automatically above the first H2 heading in your posts
4. Configure global defaults under **Settings → Tidy TOC**

== Frequently Asked Questions ==

= Which heading levels are included? =

By default H2 and H3. You can configure the minimum and maximum heading depth in the settings.

= Can I disable the TOC for a specific post? =

Yes. Each post has a meta box where you can disable the TOC or override global settings.

= Does it work with the block editor? =

Yes. The TOC is generated server-side from the rendered post content, so it works regardless of how the post was written.

= Does it slow down my site? =

No. The TOC output is cached per post and invalidated automatically when the post is updated.

= Can I place the TOC manually? =

Yes. Use the `[tidy_toc]` shortcode anywhere in your content, or disable auto-insertion in the settings.

== Screenshots ==

1. TOC displayed in a post
2. Settings page
3. Per-post meta box

== Changelog ==

= 1.0.8 =
* Declared compatibility with WordPress 7.0.

= 1.0.7 =
* Replaced the grid-template-rows collapse trick with a max-height transition. The grid trick would refuse to fully collapse in some themes, leaving a residual strip with the first row of items partially visible. max-height: 0 hides the body cleanly.

= 1.0.6 =
* Fixed the collapsed state leaving a visible padding strip under the header. The body wrapper is now `box-sizing: border-box` so its padding is included in the collapsed height (full collapse, no leftover band).

= 1.0.5 =
* TOC item sizes inherit from the active theme again (reverts the explicit `rem` fallback added in 1.0.4).
* Title bumped to 1.25rem so the SOMMAIRE label stays clearly readable as a header above inherited link sizes.

= 1.0.4 =
* Fixed the toggle button picking up theme button styles (coloured background, padding, hover gradient) — the "Table of Contents" header now reliably renders as a plain text label across themes.
* Hardened TOC item font sizes against context shrinkers (sidebar, nav, .entry-content ul). Sizes are now expressed in `rem` so they track the theme's root font size while staying isolated from nested overrides.

= 1.0.3 =
* Default insertion position is now "After first paragraph" (was "Before content") — better reading flow on a fresh install.
* Removed hardcoded font sizes from the front-end stylesheet (base, title, H2/H3/H4 link sizes). The TOC now inherits typography from the active theme.

= 1.0.2 =
* Removed all rendering code for premium-only features (sticky positioning, "custom" theme with color/radius/border options, reading-time badge). The free plugin now exposes only the three documented free themes (Minimal, Card, Outline) — no hidden capabilities behind add-on hooks.

= 1.0.1 =
* Removed all licence checks and premium-feature gating from the free plugin code (premium features are now distributed via a separate companion plugin).
* Hardened JSON-LD output with JSON_HEX_* flags to prevent script-tag breakouts.
* Removed the now-unnecessary `load_plugin_textdomain()` call (handled by WordPress.org translation system since WP 4.6).
* Added extension hooks for add-on plugins (settings defaults/sanitisation, render options, shortcode atts/headings, settings page, admin/front localized data, plugin row links).

= 1.0.0 =
* Initial release — automatic TOC generation, caching, accessibility, per-post control.

== Upgrade Notice ==

= 1.0.7 =
Collapse now closes fully on every theme — replaced grid trick with max-height.

= 1.0.6 =
Collapse animation now closes fully — no more residual padding strip under the header.

= 1.0.5 =
TOC items now follow the theme's typography. The SOMMAIRE title is slightly larger for better hierarchy.

= 1.0.4 =
Fix: the toggle no longer adopts theme button styling, and TOC items keep a sensible size in sidebars and nav contexts.

= 1.0.3 =
New installs get "After first paragraph" as default insertion position. Font sizes now inherit from the active theme.

= 1.0.2 =
The free plugin no longer ships any code for premium-only features (sticky, custom theme, reading time). No user-facing change unless you were using the companion Pro add-on.

= 1.0.1 =
Code cleanup and security hardening. No user-facing changes.
