/*
Theme Name: Twenty Twenty‑Five Child
Template: twentytwentyfive
Text Domain: twentytwentyfive-child
Version: 1.0
*/


/* 1) Ocultar SIEMPRE el título de página/entrada (TT5 usa el bloque post-title) */
.wp-block-post-title,
.entry-title {
  display: none;
}

/* 2) Reducir la separación global entre bloques (TT5 usa esta variable) */
.wp-site-blocks {
  --wp--style--block-gap: 8px; /* ajústalo: 0–12px según te guste */
}

/* 3) Acercar el header al contenido sin !important ni propiedades “block-end” */
.wp-site-blocks > .wp-block-template-part:first-child {
  margin-bottom: 8px;
  padding-bottom: 0;
}

/* 4) Evitar margen extra debajo del logo del sitio */
.wp-block-site-logo {
  margin-bottom: 0;
}

/* 5) Quitar margen superior del primer bloque del contenido */
.wp-block-post-content > *:first-child {
  margin-top: 0;
}

/* 1) El contenido de las PÁGINAS sin margen superior */
body.page .wp-block-post-content {
  margin-top: 0;
}

/* 2) Evita que el primer bloque del <main id="contenido"> empuje hacia arriba */
body.page #contenido > :first-child {
  margin-top: 0;
}
/* 2.b) Si ese primer bloque empieza con h1/h2/hgroup, también a 0 */
body.page #contenido > :first-child > h1,
body.page #contenido > :first-child > h2,
body.page #contenido > :first-child > hgroup {
  margin-top: 0;
}

/* 3) Elimina el “gap” entre header y main sólo en Páginas (TT5 usa blockGap) */
body.page .wp-site-blocks {
  --wp--style--root--block-gap: 0;
}
/* 3.b) Por si algún estilo añade margen al main */
body.page .wp-site-blocks > header + main,
body.page .wp-site-blocks > .wp-block-template-part + main {
  margin-top: 0;
}

/* Quitar padding global entre header y contenido en PÁGINAS */
body.page .wp-site-blocks,
body.page .wp-site-blocks .has-global-padding,
body.page main {
  padding-top: 0 !important;
}

/* Asegurar que el primer bloque del main no reintroduce margen/padding */
body.page #contenido > :first-child { margin-top: 0; padding-top: 0; }
body.page #contenido > :first-child > h1,
body.page #contenido > :first-child > h2,
body.page #contenido > :first-child > hgroup { margin-top: 0; }

/* El blockGap raíz puede sumar hueco; ponlo a 0 solo en páginas */
body.page .wp-site-blocks { --wp--style--root--block-gap: 0; }

/* Por si el header es template-part o <header>, fuerza sin separación */
body.page .wp-site-blocks > .wp-block-template-part + main,
body.page .wp-site-blocks > header + main { margin-top: 0; }
