/* ------------------------------------------------------------------ *
 * Tame Kadence's `.alignwide` breakout.
 *
 * Kadence's global rule on `.alignfull, .alignwide, .entry-content
 * .alignwide, .entry-content .alignfull` sets `width: var(--global-vw,
 * 100vw)` plus negative left/right margins so the block visually breaks
 * out to viewport-width regardless of its parent's constrained width.
 * That's the *intent* of alignfull (full-bleed section bg), but it
 * over-applies to alignwide blocks too — at viewports between the
 * content-width (1290px) and the alignwide-breakout media query
 * (1520px+), the alignwide grid is forced to ~100vw wide and its right
 * edge pokes past the viewport. The functions.php filter we added
 * (kadence_align_wide_array → 0) caps alignwide's max-width to
 * content-width but doesn't undo `width: 100vw`, so the breakout still
 * fires at intermediate viewports (~1029px was the reported case).
 *
 * Override: alignwide stays inside its parent. alignfull keeps the
 * 100vw breakout so section background colors still bleed edge-to-edge.
 * ------------------------------------------------------------------ */
body .alignwide,
body .entry-content .alignwide {
	width: auto;
	max-width: 100%;
	margin-left: auto;
	margin-right: auto;
}

/* Mobile overflow fix: Kadence applies negative horizontal margins to
   `.alignwide` so it breaks out of the content column on desktop. On phones
   the parent inner-container is only ~366px, so the negative-margin
   breakout shoves the block 48px past the right viewport edge — every
   descendant (h1, p, buttons, image) overflows with it. Constrain alignwide
   to its container on small screens. Alignfull is left alone so full-width
   section backgrounds keep working. */
@media (max-width: 1023px) {
	.entry-content .alignwide {
		margin-left: 0 !important;
		margin-right: 0 !important;
		max-width: 100% !important;
	}
	.entry-content img,
	.entry-content figure {
		max-width: 100%;
		height: auto;
	}
}

/* ------------------------------------------------------------------ *
 * Drop Kadence's forced solid image border.
 *
 * Kadence's content.min.css (v1.5.0) hard-codes
 *   .wp-block-image.has-custom-border img { border-style: solid }
 * on any image block that carries a custom border, so images render
 * with an unwanted solid outline. We don't want a border at all here,
 * so neutralise the style. !important is required to beat the parent
 * theme rule's equal specificity + load order.
 * ------------------------------------------------------------------ */
.wp-block-image.has-custom-border img {
	border-style: none !important;
}

