/**
 * Frontend styles for locked media handling
 *
 * These styles ensure proper layout when locked media is hidden
 * from public pages.
 */

/* Hide empty figure blocks after locked media removal */
figure:empty {
	display: none;
}

/* Hide empty gallery items */
.gallery-item:empty,
.blocks-gallery-item:empty,
.wp-block-gallery li:empty {
	display: none;
}

/* Hide empty paragraphs that may have contained images */
p:empty {
	display: none;
}

/* Optional: Locked media placeholder styles */
.lens-locked-media {
	display: block;
	padding: 40px 20px;
	background-color: #f5f5f5;
	border: 2px dashed #ddd;
	text-align: center;
	color: #999;
	font-style: italic;
	border-radius: 4px;
	margin: 20px 0;
}

.lens-locked-media::before {
	content: "🔒";
	display: block;
	font-size: 32px;
	margin-bottom: 10px;
	opacity: 0.5;
}

/* Fix gallery layout when items are removed */
.gallery {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.gallery-item {
	flex: 0 0 auto;
}

/* WordPress block gallery adjustments */
.wp-block-gallery.has-nested-images figure.wp-block-image:empty {
	display: none !important;
}

/* Ensure galleries don't show broken layouts */
.wp-block-gallery:not(:has(img)) {
	display: none;
}

/* Hide broken image icons */
img[src=""],
img:not([src]) {
	display: none;
}

/* Clean up whitespace in content after image removal */
.entry-content p + p:empty,
.entry-content figure + figure:empty {
	display: none;
	margin: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.lens-locked-media {
		padding: 30px 15px;
		font-size: 14px;
	}

	.lens-locked-media::before {
		font-size: 24px;
	}
}