/**
 * PFOA Gallery Lightbox - close-phase click-through (0.1.11).
 *
 * Allows real-pointer clicks to reach underlying gallery anchors during
 * Photobox close (pbHide ~400-500ms).
 */
#pbOverlay.pbHide, #pbOverlay.pbHide * { pointer-events: none !important; }

/* PFOA Gallery Lightbox: owns `.pfoa-cat-gallery` public gallery presentation (ordinary+profile). Transferred from PFOA Cat Profiles; single authoritative copy lives here. */

/* 0.1.20: the PHP rendition adapter now selects uncropped sources before
   WordPress builds width/height and responsive candidates. Keep the
   0.1.19 lazy-loading correction below: no aspect-ratio reset.

   0.1.19: enforce aspect-preserving thumbnails in `.pfoa-cat-gallery`
    (width:100% + height:auto) so theme fixed-height gallery rules
    cannot squash/stretch Bowman-style portraits. Deliberately NO
    `aspect-ratio` override here: the width/height attributes emitted
    by WordPress carry the selected thumbnail's natural ratio, and that
    ratio must survive so unloaded `loading="lazy" sizes="auto"` images
    reserve ratio-sized placeholder space. 0.1.18 set
    `aspect-ratio: auto !important`, which discarded the attribute ratio;
    height then fell back to WordPress core's lazy-placeholder
    `contain-intrinsic-size: 3000px 1500px` (wp-img-auto-sizes), producing
    ~1500px-tall empty boxes (TEST Bowman/Sable/Picasso). Likewise no
    `object-fit`: with the ratio intact the content box already matches
    the thumbnail, so there is nothing to letterbox. Page still owns
    columns/widths; no cropping, no dimension choices here. */

/* Native WordPress gallery markup; Photobox binds to the descendant links. */
.pfoa-cat-gallery {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 12px 0;
}

/* Legacy WP gallery emits <br style="clear:both"> inside the container;
   as a flex item it would consume a row slot — neutralize it. */
.pfoa-cat-gallery > br {
  display: none;
}

.pfoa-cat-gallery .gallery-item {
  width: 20%;
  margin: 0;
  padding: 0.25rem;
  box-sizing: border-box;
}

.pfoa-cat-gallery .gallery-icon {
  margin: 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 3px;
  box-sizing: border-box;
  height: auto !important;
}

.pfoa-cat-gallery .gallery-icon a {
  display: block;
  height: auto !important;
}

.pfoa-cat-gallery .gallery-icon img {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  margin: 0;
}

.pfoa-cat-gallery .gallery-caption {
  margin: 0;
  width: 100%;
  color: #000080;
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
}

/* PFOA Cat Profiles 0.1.113: responsive classic-gallery columns.
   Desktop keeps five columns (width:20% above). At narrow widths five
   20% thumbnails become tiny with severely wrapped captions, so collapse
   gallery-columns-5 to three columns (<=600px) then two columns
   (<=480px). Scoped strictly to the plugin-owned .pfoa-cat-gallery
   classic markup so Adoptable cards, Adopted2026 event cards, WordPress
   core galleries and theme gallery styles are untouched. Selector
   (0,3,0) outranks the base .pfoa-cat-gallery .gallery-item (0,2,0)
   rule. Applies identically on direct Cat Profile pages and inside
   Popup Maker dialogs (same markup, no page-container scoping). Image
   aspect ratios, captions, links, Photobox binding and markup unchanged. */
@media (max-width: 600px) {
  .pfoa-cat-gallery.gallery-columns-5 .gallery-item {
    width: 33.3333%;
  }
}

@media (max-width: 480px) {
  .pfoa-cat-gallery.gallery-columns-5 .gallery-item {
    width: 50%;
  }
}

/* PFOA Gallery Lightbox 0.1.17: nullify Photobox 1.9.9 false whitespace
   compensation (.pbWrapper:after margin-right:-.25em). Vendor assumes an
   HTML whitespace text node that does not exist (DOM built via JS append
   with zero text nodes), so -.25em shrinks the centered line and the
   leftover +0.25em splits equally -> +0.125em (~2px at 16px) right-edge
   clip under #pbOverlay{overflow:hidden}. Setting margin-right:0 removes
   the strut regardless of font-size; specificity (1,1,1) beats vendor
   (0,1,1) and this stylesheet enqueues after vendor. Animations,
   captions, nav, close, and thumbs untouched. */
#pbOverlay .pbWrapper:after { margin-right: 0; }
