/* Styles heading H1-H6 issus du theme.json */

h1 {
  margin-top: var(--wp--custom--semantic--spacing--200, 16px) !important;
  margin-bottom: var(--wp--custom--semantic--spacing--200, 16px) !important;
}

h2 {
  margin-top: var(--wp--custom--semantic--spacing--200, 16px) !important;
  margin-bottom: var(--wp--custom--semantic--spacing--200, 16px) !important;
}

h3 {
  margin-top: var(--wp--custom--semantic--spacing--base, 8px) !important;
  margin-bottom: var(--wp--custom--semantic--spacing--base, 8px) !important;
}

h4 {
  margin-top: var(--wp--custom--semantic--spacing--base, 8px) !important;
  margin-bottom: var(--wp--custom--semantic--spacing--base, 8px) !important;
}

h5 {
  margin-top: var(--wp--custom--semantic--spacing--none, 0px) !important;
  margin-bottom: var(--wp--custom--semantic--spacing--none, 0px) !important;
}

h6 {
  margin-top: var(--wp--custom--semantic--spacing--none, 0px) !important;
  margin-bottom: var(--wp--custom--semantic--spacing--none, 0px) !important;
}

/* Marges nulles pour les headings imbriqués dans un bloc (pas les core/heading autonomes) */
[class*='wp-block-']:not(.wp-block-heading):not(.wp-block-post-content)
  :is(h1, h2, h3, h4, h5, h6) {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Ciblage spécifique des blocs custom qui resetent les marges des headings */
.accordion .accordion-heading,
.wp-block-create-block-cover-light :is(h1, h2, h3, h4, h5, h6),
.wp-block-create-block-button :is(h1, h2, h3, h4, h5, h6),
.wp-block-create-block-button-call :is(h1, h2, h3, h4, h5, h6),
.wp-block-quote :is(h1, h2, h3, h4, h5, h6),
.wp-block-table :is(h1, h2, h3, h4, h5, h6),
.wp-block-cover :is(h1, h2, h3, h4, h5, h6) {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
