/* ----------------------------------------------
   Editor: constrain width to 1440px for fullwidth template
   Requires PHP helper that adds .has-template-page-fullwidth to editor body
   ---------------------------------------------- */

/* Base guard: only act when our editor body class is present */
.has-template-page-fullwidth .editor-styles-wrapper {
	/* Optional: custom property if you want to reuse this value */
	--editor-content-max: 1440px;
}

/* Constrain the main content container inside the editor iframe */
.has-template-page-fullwidth .editor-styles-wrapper .is-root-container {
	max-width: var(--editor-content-max, 1440px);
	margin-left: auto;
	margin-right: auto;
}

/* Constrain regular blocks (Gutenberg uses this to limit content width) */
.has-template-page-fullwidth .editor-styles-wrapper .wp-block {
	max-width: var(--editor-content-max, 1440px);
}

/* Keep "wide" and "full" aligned blocks visually centered & capped in editor */
.has-template-page-fullwidth .editor-styles-wrapper .wp-block[data-align="wide"],
.has-template-page-fullwidth .editor-styles-wrapper .wp-block[data-align="full"] {
	max-width: var(--editor-content-max, 1440px) !important; /* ensure cap in editor */
	margin-left: auto;
	margin-right: auto;
}

/* Optional: images/galleries behave nicely within the cap */
.has-template-page-fullwidth .editor-styles-wrapper .wp-block-image img,
.has-template-page-fullwidth .editor-styles-wrapper .wp-block-gallery {
	max-width: 100%;
	height: auto;
}
