=== Leaf – Clean Lightbox ===
Contributors: wpsecurityjp
Tags: lightbox, image, gallery, modal, responsive
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A lightweight, vanilla-JS image lightbox. Works automatically for single images and galleries. No jQuery, no external services.

== Description ==

Leaf – Clean Lightbox is a clean and fast image lightbox for WordPress.  
It works **automatically** for both **individual images and galleries** — no setup required, no shortcodes, no initialization scripts.

**How it works**
- The plugin detects links to image files (`.jpg`, `.jpeg`, `.png`, `.webp`) in your content and opens them in a modal lightbox.
- Images in the same context (e.g., gallery block) are navigable with **Next/Prev**.
- You can explicitly group images by adding the same `data-gallery="your-group"` attribute to their `<a>` tags.

**Features**
- Works for single images and galleries
- Left/right side click on the image to go Next/Prev
- Keyboard navigation (Esc / ← / →)
- Swipe/drag navigation on mobile and desktop
- Captions from `<figure><figcaption>`
- Smooth fade transitions
- Background scroll lock while open
- No jQuery, no external services or CDNs

== Installation ==

1. Upload the plugin to `/wp-content/plugins/leaf-clean-lightbox/` (folder name must match the slug), or install via the Plugins screen.
2. Activate the plugin in **Plugins**.
3. Done! Any link to an image file in your posts/pages will open in the lightbox.

== Usage ==

= Individual photos =
Insert an image and link it to its media file. Clicking it will open the lightbox.

= Galleries =
Insert multiple linked images (e.g., Gallery block). They will be navigable with Next/Prev automatically.

= Explicit grouping across blocks/pages =
Add `data-gallery="myset"` to each image link:
`<a href="full.jpg" data-gallery="myset"><img …></a>`

= Excluding an image =
Remove the `lightbox` class from that link, or do not link it to an image file.

== Frequently Asked Questions ==

= Do I need jQuery or any external library? =
No. Leaf – Clean Lightbox is built in vanilla JavaScript and is fully self-contained.

= Does it send any data to external services? =
No. The plugin does not connect to any third-party services or CDNs.

= How are captions displayed? =
If your image is inside `<figure>` with a `<figcaption>`, the caption is shown below the image in the lightbox.

== Screenshots ==

1. Lightbox on desktop with navigation  
2. Mobile swipe/drag navigation  
3. Caption displayed under the image  

== Changelog ==

= 1.1.2 =
* Stable release for WordPress.org
* Readme clarified: works for single images and galleries
* Improved caption handling and swipe navigation

= 1.1.0 =
* Initial release as vanilla JS lightbox
* Smooth transitions, drag/swipe navigation
* No external dependencies

== Upgrade Notice ==

= 1.1.2 =
Clarified usage in readme, stable release.  

== External Services ==

None. This plugin does not use any external services.
