
/* === INCOVISA: spacing fixes v3 (agresivo) === */

/* 0) Normaliza top spacing global en wrappers principales */
body, main, .site, .site-content, .site-main, .content-area, .container, .wrap, .entry-content, .page-content, .post-content {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* 1) Header sin huecos extra */
header, .site-header, #masthead, .page-header, .custom-header, .hero, .wp-block-cover:first-child, .elementor-location-header {
  margin-bottom: 8px !important;
  padding-bottom: 0 !important;
}

/* 2) El primer bloque del contenido no debe generar hueco */
.entry-content > *:first-child,
.page-content > *:first-child,
.post-content > *:first-child,
.site-main > article > *:first-child,
main > *:first-child,
.container > *:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* 3) Reduce márgenes de títulos iniciales (a veces provocan huecos grandes) */
.entry-title, .page-title, h1, h1.entry-title {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* 4) Imágenes del contenido con aire controlado */
.entry-content img,
.page-content img,
.post-content img,
.site-main img,
.wp-block-image img,
figure.wp-block-image img {
  display: block;
  margin: 8px auto 28px auto !important; /* arriba 8 / abajo 28 */
  max-width: 100%;
  height: auto;
}

/* 5) Figura/contenedor de imagen: sin margen superior excesivo */
figure, .wp-block-image, .wp-block-gallery, .gallery, .elementor-image, .elementor-widget-image {
  margin-top: 8px !important;
}

/* 6) Quita separadores generadores de hueco (WordPress/Elementor) */
.wp-block-spacer { height: 0 !important; min-height: 0 !important; margin: 0 !important; }
.elementor-spacer, .elementor-divider { margin-top: 4px !important; margin-bottom: 12px !important; }
.elementor-section:first-child, .elementor-container:first-child, .elementor-widget-wrap:first-child {
  margin-top: 0 !important; padding-top: 0 !important;
}

/* 7) Colchón inferior del contenido para no pegarse al footer */
.site-main, .content-area, .site-content, main, .container, .wrap, .entry-content, .page-content, .post-content {
  padding-bottom: 56px !important;
}

/* 8) Footer separado levemente del contenido */
footer, .site-footer {
  margin-top: 24px !important;
  padding-top: 12px !important;
}

/* 9) Evita que el último bloque quede pegado */
.entry-content > *:last-child,
.page-content > *:last-child,
.post-content > *:last-child {
  margin-bottom: 28px !important;
}

/* 10) Seguridad: evita margin colapsado con clearfix en main */
main::before, main::after, .site-content::before, .site-content::after {
  content: ""; display: table;
}
main::after, .site-content::after { clear: both; }
