.lay-custom-element {
	box-sizing: border-box;
	font-size: initial;
}

.lay-custom-element *,
.lay-custom-element *::before,
.lay-custom-element *::after {
	box-sizing: inherit;
}

/*
 * WordPress treats every h2/h3 inside #poststuff like a metabox heading.
 * Restore the neutral values Custom Elements receive outside wp-admin; the
 * element-specific inline CSS has equal or higher specificity and loads later.
 */
#poststuff .lay-custom-element h2,
#poststuff .lay-custom-element h3 {
	color: inherit;
	padding: 0;
}

.lay-custom-element__image,
.lay-custom-element__gallery-image,
.lay-custom-element__gallery-video {
	display: block;
	max-width: 100%;
	height: auto;
}

.lay-custom-element__gallery-item {
	margin: 0;
}

.lay-custom-element__preview-image {
	display: grid;
	min-height: 220px;
	place-items: center;
	background: linear-gradient(135deg, #e8e8e8, #cfcfcf);
	color: #777;
}

.lay-custom-element__preview-gallery {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
}

.lay-custom-element__preview-gallery i {
	display: block;
	aspect-ratio: 1;
	background: #ddd;
}
