/*
 F8 Gallery One-Column Override — front-end rules. v1.0.2

 Must beat three things:
   1. f8 main.css ~2055: item width calc(50% - var(--gallery-gap)) !important
   2. f8 jQuery Masonry inline styles — every property it writes is vetoed
      here (stylesheet !important outranks inline styles), so it can run
      forever with zero visual effect.
   3. v1.0.2: the F8 Image Protection decoy. Its own stylesheet pins the
      decoy absolute ONLY under body.is-image-protected — on stale-cached
      HTML that class is missing and the decoy renders IN FLOW: a full-width
      black 3:2 PNG below every photo (the "gaps"). The decoy is pinned
      unconditionally here, and excluded from the real-image sizing rules.
*/

.wp-block-gallery.f8-one-column-override,
.wp-block-gallery.f8-one-column-override .blocks-gallery-grid {
	display: block !important;
	width: 100% !important;
	height: auto !important;
	margin-right: 0 !important;
	position: static !important;
	transform: none !important;
}

.wp-block-gallery.f8-one-column-override .blocks-gallery-item,
.wp-block-gallery.f8-one-column-override .blocks-gallery-image,
.wp-block-gallery.f8-one-column-override figure.wp-block-image {
	position: relative !important;
	top: auto !important;
	right: auto !important;
	bottom: auto !important;
	left: auto !important;
	transform: none !important;
	float: none !important;
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	flex: none !important;
	margin: 0 0 var(--gallery-gap, 16px) 0 !important;
}

.wp-block-gallery.f8-one-column-override .blocks-gallery-item:last-child,
.wp-block-gallery.f8-one-column-override figure.wp-block-image:last-child {
	margin-bottom: 0 !important;
}

/* Anchors stay positioned so a decoy pinned inside them hugs the photo box. */
.wp-block-gallery.f8-one-column-override .blocks-gallery-item > a,
.wp-block-gallery.f8-one-column-override figure.wp-block-image > a {
	display: block !important;
	width: 100% !important;
	position: relative !important;
}

/* Real images only — never the protection decoy. */
.wp-block-gallery.f8-one-column-override img:not(.f8-image-decoy) {
	display: block;
	width: 100% !important;
	height: auto !important;
}

/* The protection decoy, pinned unconditionally (no body-class dependency):
   overlay, zero layout height, invisible — protection keeps working and the
   gallery never gains phantom rows, cached HTML or not. */
.wp-block-gallery.f8-one-column-override img.f8-image-decoy {
	position: absolute !important;
	top: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	opacity: 0 !important;
	z-index: 2;
}
