/* Publicator AI — front-end content styles.
 * Loaded only on posts published by Publicator AI.
 * Critical layout properties use !important so the host theme's link rules
 * cannot break the CTA; colour / font are intentionally left to inherit so the
 * button looks native to the site. */

.publicator-cta {
  text-align: center !important;
  margin: 2em 0 !important;
  clear: both;
}

.publicator-cta-button,
.entry-content .publicator-cta-button,
.publicator-cta a.cta-button,
.cta-section a.cta-button,
.entry-content .cta-section a.cta-button {  /* legacy cta-section markup — retroactive fix */
  display: inline-block !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 14px 28px !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  line-height: 1.4 !important;
  text-align: center !important;
  font-family: inherit !important;       /* neutralise legacy inline font-family so the button looks native */
  transition: opacity .2s ease, transform .2s ease;
}

/* Legacy cta-section wrapper: centre the block like the modern .publicator-cta. */
.cta-section,
.entry-content .cta-section {
  text-align: center !important;
  margin: 2em 0 !important;
  clear: both;
}

.publicator-cta-button:hover {
  opacity: .88;
  transform: translateY(-1px);
}

.publicator-cta-button:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

/* Table-of-contents spacing without forcing theme typography. */
.publicator-toc { margin: 1.5em 0; }
.publicator-toc ul { margin: .25em 0; }

/* Anchor offset for in-page TOC links (replaces inline scroll-margin-top). */
.entry-content h2[id],
.entry-content h3[id],
.entry-content h4[id] {
  scroll-margin-top: 80px;
}

/* Allow the button label to wrap only when the viewport is truly narrow,
 * rather than overflowing the screen. */
@media (max-width: 480px) {
  .publicator-cta-button,
  .entry-content .publicator-cta-button,
  .publicator-cta a.cta-button,
  .cta-section a.cta-button,
  .entry-content .cta-section a.cta-button {
    white-space: normal !important;
    word-break: keep-all;
    font-size: .95em;
    padding: 12px 20px !important;
  }
}

/* RTL safety for future markets. */
[dir="rtl"] .publicator-cta { text-align: center !important; }
