/**
 * JS CTA button.
 *
 * The shared button look used by the CTA Button widget and by the optional
 * CTA inside the Nav. Three variants from the Figma button styles:
 * Primary Button Dark (22954:16895), Primary Button White (22887:2147) and an
 * Outline variant for use on tinted sections.
 *
 * Colours come from the child theme's shared tokens (custom.css) with the
 * Figma values inlined as fallbacks, so the button looks right even if the
 * theme stylesheet has not loaded.
 */

.js-cta {
  --js-cta-bg: var(--js-color-primary, #111827);
  --js-cta-color: var(--js-color-white, #ffffff);
  --js-cta-border: transparent;
  --js-cta-bg-hover: var(--js-color-primary-hover, #1f2b40);
  --js-cta-color-hover: var(--js-color-white, #ffffff);
  --js-cta-border-hover: transparent;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 55px;
  padding: 0 40px;
  border: 1px solid var(--js-cta-border);
  border-radius: 6px;
  background: var(--js-cta-bg);
  color: var(--js-cta-color);
  font-family: "Inter", sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  overflow: hidden;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.js-cta,
.js-cta *,
.js-cta *::before,
.js-cta *::after {
  box-sizing: border-box;
}

/* A CTA with no link renders as a <span>; keep it inert-looking. */
span.js-cta {
  cursor: default;
}

.js-cta__label {
  white-space: nowrap;
}

.js-cta__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 0;
}

.js-cta__icon svg {
  display: block;
  width: 1em;
  height: 1em;
  fill: currentColor;
}

/* Full-width — the panel CTA on tablet/mobile, and the Width: Full setting. */
.js-cta--block {
  display: flex;
  width: 100%;
}

/* -------- Variants -------- */

/* Primary Button Dark. */
.js-cta--dark {
  --js-cta-bg: var(--js-color-primary, #111827);
  --js-cta-color: var(--js-color-white, #ffffff);
  --js-cta-bg-hover: var(--js-color-primary-hover, #1f2b40);
}

/* Primary Button White. */
.js-cta--white {
  --js-cta-bg: var(--js-color-white, #ffffff);
  --js-cta-color: var(--js-color-primary, #111827);
  --js-cta-bg-hover: var(--js-color-white-hover, #eef2f7);
  --js-cta-color-hover: var(--js-color-primary, #111827);
}

.js-cta--outline {
  --js-cta-bg: transparent;
  --js-cta-color: var(--js-color-text, #475569);
  --js-cta-border: var(--js-color-border, #b0bed2);
  --js-cta-bg-hover: var(--js-color-primary, #111827);
  --js-cta-color-hover: var(--js-color-white, #ffffff);
  --js-cta-border-hover: var(--js-color-primary, #111827);
}

/* -------- States -------- */

/* Hover only where hovering is real, so a tap on touch doesn't stick the
   hover colours on until the next tap elsewhere. */
@media (hover: hover) {
  a.js-cta:hover,
  a.js-cta:focus-visible {
    background: var(--js-cta-bg-hover);
    color: var(--js-cta-color-hover);
    border-color: var(--js-cta-border-hover);
  }
}

a.js-cta:focus-visible {
  outline: 2px solid var(--js-color-highlight, #b28b2c);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .js-cta {
    transition: none;
  }
}

/* -------- Disabled -------- */

/* Button Link left blank with "Disable When Link Is Empty" on: it keeps its
   size and position so surrounding layout does not shift, but reads as
   unavailable. Styled with opacity / cursor / pointer-events rather than
   colours, because the widget's own controls emit
   {{WRAPPER}} .js-cta-button__button rules that would outrank a plain class —
   these three properties are not controlled anywhere, so the state holds
   whatever palette the editor chose. It is a <span>, so there is nothing to
   click or tab to either. */
.js-cta--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* =========================================================================
   Standalone widget structure.

   Ported from cci-core's CTA Button: structural only — sizing, spacing and
   typography come from the Elementor controls. The button element carries both
   .js-cta (the shared variant look, also used by the Nav) and
   .js-cta-button__button (the hook the widget's controls target).
   ========================================================================= */

.js-cta-button {
  width: 100%;
  box-sizing: border-box;
}

.js-cta-button *,
.js-cta-button *::before,
.js-cta-button *::after {
  box-sizing: border-box;
}

.js-cta-button__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* Width is set responsively by the Width control. */
.js-cta-button__button-wrap {
  max-width: 100%;
}

.js-cta-button__button {
  width: 100%;
}

/* Defensive override — some themes force underline on hover. */
a.js-cta-button__button:hover,
a.js-cta-button__button:focus {
  text-decoration: none;
}

.js-cta-button__subtext {
  margin-top: 12px;
  color: var(--js-color-text, #475569);
  font-family: "Inter", sans-serif;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

.js-cta-button__sub-description {
  margin-top: 16px;
  width: 100%;
  max-width: 100%;
  color: var(--js-color-text, #475569);
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 24px;
}

.js-cta-button__sub-description p:last-child {
  margin-bottom: 0;
}

/* Match Button Width: the Width control emits the same width for this class,
   so the sub description tracks the button instead of the full widget. */
.js-cta-button__sub-description--match-button {
  margin-left: auto;
  margin-right: auto;
}
