/**
 * easy-photo-publisher — Gallery & Lightbox Styles
 *
 * Styles used by the [wpdet_gallery] shortcode templates and the optional lightbox.
 * Variables:
 *   --img-min-width : minimum column width in the responsive grid (e.g., 200px)
 *   --img-gap       : grid gap between images (e.g., 1.5rem)
 *
 * Important:
 * - Class names such as .wpdet-gallery-grid, .wpdet-caption, .wpdet-lb-* are referenced by
 *   the plugin’s HTML templates and JavaScript. Don’t rename them without updating the code.
 *
 * @package     Easy_WP_Publisher
 * @subpackage  Templates/CSS
 * @file        templates/css/wpdet-gallery.css
 * @author      Detlef Beyer
 * @link        https://medienkonzepte.de
 * @version     1.0.1
 * @since       1.0.0
 * @textdomain  easy-photo-publisher
 */

.wpdet-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--img-min-width, 250px), 1fr));
  gap: var(--img-gap, 1rem);
}

.wpdet-gallery-grid img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: .25rem;
  display: block;
}

.wpdet-item,
.wpdet-gallery-item {
  display: flex;
  flex-direction: column;
}

.wpdet-caption {
  text-align: center;
  margin-top: .5rem;
  font-size: .95rem;
}

.wpdet-caption:empty {
  display: none;
}

/* --- Lightbox overlay --- */
.wpdet-lb-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.85);
  z-index: 9999;
  padding: 2rem;
}

.wpdet-lb-overlay.is-open {
  display: flex;
}

.wpdet-lb-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  display: block;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}

.wpdet-lb-caption {
  color: #fff;
  margin-top: .75rem;
  text-align: center;
  font-size: .95rem;
}

.wpdet-lb-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.wpdet-lb-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Prevent background scroll when lightbox is open */
body.wpdet-lb-no-scroll { overflow: hidden; }