/* === JM - CTA Bar — v1.0 === */

/* ── Layout principal ── */
.jm-cta-bar {
  display: flex;
  flex-direction: row;
  align-items: var(--jm-cta-valign, center);
  justify-content: center;
  gap: var(--jm-cta-gap, 20px);
  padding: var(--jm-cta-py, 15px) 0;
  background: var(--jm-cta-bg, transparent);
  width: 100%;
  box-sizing: border-box;
}

/* Chaque enfant direct prend un poids égal */
.jm-cta-bar > *,
.jm-cta-bar > .block-editor-inner-blocks > .block-editor-block-list__layout {
  display: flex;
  flex-direction: row;
  align-items: var(--jm-cta-valign, center);
  justify-content: center;
  gap: var(--jm-cta-gap, 20px);
  width: 100%;
}

.jm-cta-bar > .block-editor-inner-blocks > .block-editor-block-list__layout > *,
.jm-cta-bar > * > * {
  flex: 1 1 0%;
  min-width: 0;
}

/* ── Breakpoint 480 px ── */
@media (max-width: 480px) {
  .jm-cta-bar.__break-480 {
    flex-direction: column;
    align-items: center;
  }
  .jm-cta-bar.__break-480 > .block-editor-inner-blocks > .block-editor-block-list__layout {
    flex-direction: column;
    align-items: center;
  }
  .jm-cta-bar.__break-480 h1,
  .jm-cta-bar.__break-480 h2,
  .jm-cta-bar.__break-480 h3,
  .jm-cta-bar.__break-480 h4,
  .jm-cta-bar.__break-480 h5,
  .jm-cta-bar.__break-480 h6,
  .jm-cta-bar.__break-480 p {
    text-align: center !important;
    width: 100%;
  }
  .jm-cta-bar.__break-480 .jm-btns {
    --jm-justify: center;
  }
  .jm-cta-bar.__break-480 > * > *,
  .jm-cta-bar.__break-480 > .block-editor-inner-blocks > .block-editor-block-list__layout > * {
    flex: 0 0 auto;
    width: 100%;
  }
}

/* ── Breakpoint 680 px (défaut) ── */
@media (max-width: 680px) {
  .jm-cta-bar.__break-680 {
    flex-direction: column;
    align-items: center;
  }
  .jm-cta-bar.__break-680 > .block-editor-inner-blocks > .block-editor-block-list__layout {
    flex-direction: column;
    align-items: center;
  }
  .jm-cta-bar.__break-680 h1,
  .jm-cta-bar.__break-680 h2,
  .jm-cta-bar.__break-680 h3,
  .jm-cta-bar.__break-680 h4,
  .jm-cta-bar.__break-680 h5,
  .jm-cta-bar.__break-680 h6,
  .jm-cta-bar.__break-680 p {
    text-align: center !important;
    width: 100%;
  }
  .jm-cta-bar.__break-680 .jm-btns {
    --jm-justify: center;
  }
  .jm-cta-bar.__break-680 > * > *,
  .jm-cta-bar.__break-680 > .block-editor-inner-blocks > .block-editor-block-list__layout > * {
    flex: 0 0 auto;
    width: 100%;
  }
}

/* ── Breakpoint 782 px ── */
@media (max-width: 782px) {
  .jm-cta-bar.__break-782 {
    flex-direction: column;
    align-items: center;
  }
  .jm-cta-bar.__break-782 > .block-editor-inner-blocks > .block-editor-block-list__layout {
    flex-direction: column;
    align-items: center;
  }
  .jm-cta-bar.__break-782 h1,
  .jm-cta-bar.__break-782 h2,
  .jm-cta-bar.__break-782 h3,
  .jm-cta-bar.__break-782 h4,
  .jm-cta-bar.__break-782 h5,
  .jm-cta-bar.__break-782 h6,
  .jm-cta-bar.__break-782 p {
    text-align: center !important;
    width: 100%;
  }
  .jm-cta-bar.__break-782 .jm-btns {
    --jm-justify: center;
  }
  .jm-cta-bar.__break-782 > * > *,
  .jm-cta-bar.__break-782 > .block-editor-inner-blocks > .block-editor-block-list__layout > * {
    flex: 0 0 auto;
    width: 100%;
  }
}

/* ── Breakpoint 1024 px ── */
@media (max-width: 1024px) {
  .jm-cta-bar.__break-1024 {
    flex-direction: column;
    align-items: center;
  }
  .jm-cta-bar.__break-1024 > .block-editor-inner-blocks > .block-editor-block-list__layout {
    flex-direction: column;
    align-items: center;
  }
  .jm-cta-bar.__break-1024 h1,
  .jm-cta-bar.__break-1024 h2,
  .jm-cta-bar.__break-1024 h3,
  .jm-cta-bar.__break-1024 h4,
  .jm-cta-bar.__break-1024 h5,
  .jm-cta-bar.__break-1024 h6,
  .jm-cta-bar.__break-1024 p {
    text-align: center !important;
    width: 100%;
  }
  .jm-cta-bar.__break-1024 .jm-btns {
    --jm-justify: center;
  }
  .jm-cta-bar.__break-1024 > * > *,
  .jm-cta-bar.__break-1024 > .block-editor-inner-blocks > .block-editor-block-list__layout > * {
    flex: 0 0 auto;
    width: 100%;
  }
}
