/*
 * Elementor V3 compatibility. Only affects legacy widgets, sections and
 * containers; V4 atomic elements are untouched. Disable in
 * Customizer > Theme Options > Advanced once a site is V4-only.
 *
 * Updated from the old theme's rules: .elementor-section-wrap and
 * .elementor-column-wrap no longer exist, so selectors now target current
 * V3 markup (sections and flexbox containers). !important is kept because
 * these deliberately override Elementor's own (unlayered) styles.
 */
@layer wpcustom.compat {
	/* Top-level boxed sections/containers at 90% on desktop (team convention). */
	.elementor > .elementor-section.elementor-section-boxed > .elementor-container,
	.elementor > .e-con-boxed > .e-con-inner {
		width: 90% !important;
	}
	@media (max-width: 1024px) {
		.elementor > .elementor-section.elementor-section-boxed > .elementor-container,
		.elementor > .e-con-boxed > .e-con-inner {
			width: 100% !important;
		}
	}

	/* Linked images fill their widget. */
	.elementor-widget-image a,
	a.elementor-clickable { display: block !important; width: 100%; }

	/* Buttons: consistent minimum width. */
	.elementor-widget-button .elementor-button { min-width: 200px; }

	/* Legacy section/container alignment helpers. */
	.alignLeft > .elementor-container,
	.alignLeft > .e-con-inner { margin-left: 0 !important; }
	.alignRight > .elementor-container,
	.alignRight > .e-con-inner { margin-right: 0 !important; }
	.flexCenter .elementor-widget-wrap,
	.flexCenter > .e-con-inner { justify-content: center !important; }
	.marginSideBig > .elementor-widget-wrap { width: calc(100% - 30px) !important; }

	@media (max-width: 1024px) {
		.alignLeft > .elementor-container,
		.alignRight > .elementor-container,
		.alignLeft > .e-con-inner,
		.alignRight > .e-con-inner { margin-inline: auto !important; }
	}

	/* .iconSide on the V3 Icon Box widget (mobile). */
	@media (max-width: 767px) {
		.iconSide .elementor-icon-box-wrapper { display: flex !important; align-items: center !important; justify-content: center !important; text-align: start !important; }
		.iconSide .elementor-icon-box-content { flex-grow: 0 !important; }
		.iconSide .elementor-icon-box-icon { margin: 0 5px 0 0 !important; }
	}

	/* Share icon spacing (was i.eicon-share-arrow). */
	i.eicon-share-arrow { margin-right: 3.75em !important; }

	/* Keep sticky headers static while editing. */
	.elementor-editor-active #masthead,
	.elementor-editor-active .elementor-location-header { position: static !important; }
}
