/**
 * V2 - Correccion de ancho en movil
 * Usa body.iagofer-v2-page (PHP) para portada estatica, / y slugs V2 (ej. simulacion-visual-galicia).
 */

@media (max-width: 781px) {
	/* --- Base: ancho util real del viewport --- */
	body.iagofer-v2-page #page.site,
	body.home.iagofer-v2-page #page.site,
	body.front-page.iagofer-v2-page #page.site {
		display: block !important;
		width: 100% !important;
		max-width: 100% !important;
		overflow-x: hidden;
	}

	body.iagofer-v2-page #primary.site-main,
	body.home.iagofer-v2-page #primary.site-main,
	body.front-page.iagofer-v2-page #primary.site-main,
	body.iagofer-v2-page #secondary.widget-area,
	body.home.iagofer-v2-page #secondary.widget-area {
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		flex: none !important;
		float: none !important;
		clear: both !important;
		margin-left: auto !important;
		margin-right: auto !important;
	}

	body.iagofer-v2-page article.post,
	body.iagofer-v2-page article.page,
	body.home.iagofer-v2-page article.post,
	body.home.iagofer-v2-page article.page {
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
	}

	/* Contenido del editor: anular layout "constrained" de bloques WP */
	body.iagofer-v2-page .entry-content,
	body.home.iagofer-v2-page .entry-content,
	body.front-page.iagofer-v2-page .entry-content,
	body.iagofer-v2-page .entry-content.is-layout-constrained,
	body.iagofer-v2-page .wp-block-post-content,
	body.iagofer-v2-page .wp-block-html,
	body.home.iagofer-v2-page .wp-block-html {
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
		padding-left: 16px !important;
		padding-right: 16px !important;
		box-sizing: border-box !important;
	}

	body.iagofer-v2-page .entry-content .wp-block-group__inner-container,
	body.home.iagofer-v2-page .entry-content .wp-block-group__inner-container {
		max-width: 100% !important;
		width: 100% !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
		padding-left: 0 !important;
		padding-right: 0 !important;
	}

	/* Hijos directos: quitar limite heredado (tema + Gutenberg) */
	body.iagofer-v2-page .entry-content > *,
	body.home.iagofer-v2-page .entry-content > * {
		max-width: 100% !important;
	}

	/* Refuerzo: secciones V2 propias (Custom HTML) */
	body.iagofer-v2-page .entry-content [class^="v2-"],
	body.iagofer-v2-page .entry-content [class*=" v2-"] {
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		box-sizing: border-box !important;
	}

	/* Portada estatica: front-page.php deja un h1 screen-reader antes del loop; no afecta layout */
}
