/**
 * Craft Blocks — shared button + typography helpers.
 * Font families are applied via .cb-font--* rules registered from PHP (BlockAppearanceService).
 */

/* ------------------------------------------------------------------------- */
/* Overflow containment                                                       */
/* Blocks with absolutely-positioned children (orbs, cards, panels) can      */
/* accidentally widen the document. Clipping each block root stops that from */
/* creating a horizontal scroll that makes coloured sections look non-full-  */
/* bleed on the right. `overflow-x: clip` does NOT create a scroll container */
/* so `position: sticky` inside blocks (side-scroll, etc.) still works.     */
/* ------------------------------------------------------------------------- */

[data-cb-block] {
  overflow-x: clip;
}

/* ------------------------------------------------------------------------- */
/* Buttons                                                                    */
/* ------------------------------------------------------------------------- */

.cb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cb-btn:hover {
  opacity: 0.92;
}

.cb-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Reference: solid fill + chamfered bottom-right */
.cb-btn--chamfer-br {
  color: #fff;
  background-color: var(--cb-btn-bg, #c1272d);
  padding: 0.85rem 1.85rem;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}

.cb-btn--solid-pill {
  color: #fff;
  background-color: var(--cb-btn-bg, #c1272d);
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
}

.cb-btn--solid-rounded {
  color: #fff;
  background-color: var(--cb-btn-bg, #c1272d);
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
}

.cb-btn--outline-rounded {
  color: var(--cb-btn-bg, #c1272d);
  background-color: transparent;
  border-color: var(--cb-btn-bg, #c1272d);
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
}

.cb-btn--outline-rounded:hover {
  background-color: color-mix(in srgb, var(--cb-btn-bg, #c1272d) 12%, transparent);
}

.cb-btn--ghost {
  color: var(--cb-btn-bg, #c1272d);
  background: none;
  padding: 0.5rem 0.25rem;
  border: none;
  font-weight: 600;
}

.cb-btn--underline {
  color: var(--cb-btn-bg, #c1272d);
  background: none;
  border: none;
  padding: 0.25rem 0;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ------------------------------------------------------------------------- */
/* Optional: testimonial / inline CTAs that inherit block accent             */
/* ------------------------------------------------------------------------- */

.cb-btn--ghost:hover,
.cb-btn--underline:hover {
  opacity: 0.85;
}

@media (max-width: 40rem) {
  .cb-btn--chamfer-br,
  .cb-btn--solid-pill,
  .cb-btn--solid-rounded,
  .cb-btn--outline-rounded {
    padding: 0.7rem 1.35rem;
    font-size: 0.9375rem;
    max-width: 100%;
    text-align: center;
  }
}
