=== ReformBox ===
Contributors: tbshiki
Tags: lightbox, modal, gutenberg, blocks, popup
Requires at least: 6.4
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 0.3.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Universal Lightbox for WordPress – lightbox support for Group, Paragraph, Video blocks with poster images, and core Image workflows.

== Description ==

ReformBox extends WordPress Lightbox functionality beyond images. It currently supports Group, Paragraph, and Video blocks with poster images directly, while delegating Image lightbox behavior to WordPress core. For `core/image`, ReformBox only syncs the sidebar toggle with core lightbox settings.

[This plugin is developed on GitHub.](https://github.com/tbshiki/reformbox)

**Supported Blocks:**

* Image Block – Uses WordPress core lightbox behavior (ReformBox panel toggles core `lightbox.enabled`)
* Video Block – Opens in a lightbox when a poster image is set (poster acts as the click trigger)
* Group Block – Supports both `same` mode (same content in page + modal) and `split` mode (separate Preview/Modal direct child Group slots)
* Paragraph Block – Click to open itself in a lightbox

**Features:**

* No-code lightbox creation via block editor controls
* Core-first image lightbox integration (`core/image`)
* Core-aligned overlay markup for custom lightboxes
* Core-aligned zoom animation
* ESC key and overlay click to close
* Accessible (ARIA attributes, focus management, keyboard navigation)
* Group split mode with Preview/Modal slot mapping
* Safe split fallback: if no Modal slot is assigned, Preview content is used
* Lazy-loaded assets (CSS/JS only loaded when needed)
* Self-lightbox videos defer preload/autoplay until opened
* Core image workflow integration without overriding core image rendering
* Global overlay background color and opacity controls in Settings > ReformBox
* Plugin list row includes a Settings action link for quick access
* Lightweight and performant

== Installation ==

1. In your WordPress admin, go to Plugins > Add New Plugin
2. Search for `ReformBox`
3. Click `Install Now`, then click `Activate`
4. Open the block editor and select any supported block
5. Enable ReformBox in the block's settings panel (for Image blocks, use `Enable Core Image Lightbox`)

For Video blocks, add a poster image in the block settings before enabling ReformBox.

== Frequently Asked Questions ==

= Does ReformBox replace the core image lightbox? =

No. `core/image` self-lightbox behavior is delegated to the WordPress core lightbox. ReformBox extends the surrounding workflow so images, videos, and container content can share a common modal workflow.

For images, the ReformBox sidebar toggle only updates the core `lightbox.enabled` setting; the clickable link behavior and overlay rendering are still handled by WordPress core.

= Why does Video lightbox require a poster image? =

Video self-lightbox uses the poster image as the visible in-page trigger and loads the full video inside the overlay. Without a poster image, ReformBox keeps the video lightbox toggle disabled.

= How does Group split mode work? =

Enable ReformBox on a Group block, then switch `Display Mode` to `Split`. Inside that parent Group, set direct child Group blocks to `Preview`, `Modal`, or `Preview + Modal (Both)` in the sidebar.

`Preview` content is rendered in-page, `Modal` content is rendered inside the lightbox overlay, and unassigned child Groups (`none`) are rendered in both. If modal content is still empty, ReformBox automatically falls back to `Preview` content.
`Slot Type` controls are shown only on direct child Group blocks of the split parent.

= Where can I change ReformBox overlay appearance? =

Open `Settings > ReformBox` in WP Admin. You can set the ReformBox overlay background color and opacity there.
The same settings screen is also linked from the plugin row action (`Plugins > ReformBox > Settings`).

== Changelog ==

= 0.3.3 =
* Unified ReformBox overlay controls into a single background color + opacity setting
* Improved consistency of overlay background rendering across ReformBox lightboxes
* Kept WordPress core lightbox appearance override separate from ReformBox overlay controls

= 0.3.2 =
* Improved overlay styling and close behavior to avoid unintended interactions with page content and WordPress core lightbox instances

= 0.3.1 =
* Clarified Image and Video lightbox behavior in the plugin documentation

= 0.3.0 =
* Improved internal code quality and release preparation for the plugin

= 0.2.0 =
* Added Group split mode and refined lightbox behavior for content and media blocks

= 0.1.0 =
* Initial release
* Group block as lightbox container
* Image/Video block self-lightbox
* Paragraph block as self-lightbox
* Core-aligned zoom animation
* Keyboard and accessibility support
