/*
  cta-v1 — dual-CTA band on red circular-outline plate.
  Desktop: Figma 170:2180 · Mobile: Figma 172:4264
*/

.cta-v1 {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* Fallback matches the plate while the image loads */
  background-color: var(--color-cta-v1-surface);
  color: var(--color-text-inverse);
}

/* ---------- Decorative red plate ---------- */

.cta-v1__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/*
  Figma crops a tall plate with circles clustered at the top.
  Mobile: ~126% height · Desktop: ~591% height (node 170:2180).
*/
.cta-v1__bg-img {
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0;
  inline-size: 100%;
  block-size: 126.06%;
  max-width: none;
  object-fit: cover;
  object-position: top center;
}

/* ---------- Inner content band ---------- */

.cta-v1__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Mobile: text block → actions gap is 40px (Figma 172:4264) */
  gap: var(--cta-v1-stack-gap-mobile);
  box-sizing: border-box;
  inline-size: 100%;
  max-inline-size: var(--header-frame-max);
  margin-inline: auto;
  padding-block: var(--cta-v1-pad-y-mobile); /* 56px */
  padding-inline: var(--space-md); /* 16px */
}

/* ---------- Header (title + body) ---------- */

.cta-v1__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg); /* 24px — mobile text-block gap */
  inline-size: 100%;
  text-align: center;
}

.cta-v1__title {
  margin: 0;
  inline-size: 100%;
  font-family: var(--font-heading);
  font-weight: var(--fw-black);
  font-size: var(--fs-cta-v1-title-mobile); /* 24px */
  line-height: var(--lh-cta-v1-title-mobile); /* 29px */
  letter-spacing: var(--ls-cta-v1-title-mobile);
  text-transform: uppercase;
  color: var(--color-text-inverse);
}

/* Desktop / mobile title variants (line breaks differ in Figma) */
.cta-v1__title-desktop {
  display: none;
}

.cta-v1__title-mobile {
  display: inline;
}

.cta-v1__text {
  margin: 0;
  inline-size: 100%;
  font-family: var(--font-body-alt); /* Inter — Figma P2 */
  font-weight: var(--fw-regular);
  font-size: var(--fs-cta-v1-body-mobile); /* 17px */
  line-height: var(--lh-cta-v1-body); /* 30px */
  letter-spacing: var(--ls-cta-v1-body);
  /* Mobile body is left-aligned in Figma 172:4264 (title stays centered) */
  text-align: start;
  color: var(--color-text-inverse);
}

.cta-v1__text-desktop {
  display: none;
}

.cta-v1__text-mobile {
  display: inline;
}

/* ---------- Actions ---------- */

.cta-v1__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-lg); /* 24px */
  /* Full width on mobile so long labels wrap inside the pill. */
  inline-size: 100%;
  max-inline-size: 100%;
}

.cta-v1__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm); /* 10px */
  box-sizing: border-box;
  inline-size: 100%;
  padding-block: var(--cta-v1-btn-pad-y); /* 20px */
  padding-inline: var(--cta-v1-btn-pad-x); /* 40px */
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: var(--font-heading);
  font-weight: var(--fw-medium);
  font-size: var(--fs-cta); /* 18px */
  line-height: var(--lh-nav); /* 23px */
  letter-spacing: var(--ls-cta);
  text-decoration: none;
  /* Wrap on narrow viewports (e.g. long franchise CTA on /locations/). */
  white-space: normal;
  text-align: center;
  color: var(--color-text-inverse);
  transition: background-color var(--transition-base), opacity var(--transition-base),
    border-color var(--transition-base);
}

.cta-v1__btn:focus-visible {
  outline: 2px solid var(--color-text-inverse);
  outline-offset: 3px;
}

/* Primary — Shine Grey fill */
.cta-v1__btn--primary {
  background-color: var(--color-text);
  border-color: var(--color-text);
}

.cta-v1__btn--primary:hover {
  opacity: 0.92;
}

/* Secondary — white outline on red */
.cta-v1__btn--secondary {
  background-color: transparent;
  border-color: var(--color-text-inverse);
}

.cta-v1__btn--secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.cta-v1__btn-text {
  /* Let long labels wrap on mobile; desktop pills size to label + arrow. */
  min-inline-size: 0;
  flex-shrink: 0;
}

.cta-v1__btn-icon {
  display: block;
  flex-shrink: 0;
  inline-size: 0.875rem; /* 14px — Figma icon */
  block-size: 0.875rem;
}

/* ---------- Desktop — Figma 170:2180 ---------- */
/* --bp-lg: 1024px */

@media (min-width: 1024px) {
  .cta-v1__bg-img {
    block-size: 590.58%;
  }

  .cta-v1__inner {
    gap: var(--space-xl); /* 32px — heading → buttons */
    padding-block: var(--cta-v1-pad-y); /* 120px */
    padding-inline: var(--header-pad-x); /* clamps toward 220px */
  }

  .cta-v1__header {
    gap: var(--space-xl); /* 32px */
    max-inline-size: var(--cta-v1-header-max); /* 1499px */
  }

  .cta-v1__title {
    font-size: var(--fs-cta-v1-title); /* 54px */
    line-height: var(--lh-cta-v1-title); /* 54px */
    letter-spacing: 0;
  }

  .cta-v1__title-desktop {
    display: inline;
  }

  .cta-v1__title-mobile {
    display: none;
  }

  .cta-v1__text {
    font-size: var(--fs-cta-v1-body); /* 18px */
    text-align: center;
  }

  .cta-v1__text-desktop {
    display: inline;
  }

  .cta-v1__text-mobile {
    display: none;
  }

  .cta-v1__actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    /* Grow with label length — fixed 575px caused nowrap text to paint over the arrow. */
    inline-size: auto;
    max-inline-size: 100%;
  }

  .cta-v1__btn {
    flex: 0 1 auto;
    inline-size: auto;
    min-inline-size: 0;
    white-space: nowrap;
  }
}

/*
  About band on the single blog page — Figma 321:297.
  Three equal grey pills. Reuses cta-v1 surface + type.
*/
.cta-v1--about .cta-v1__inner {
  gap: var(--space-3xl); /* 60px — closer to desktop stack on large phones */
}

.cta-v1--about .cta-v1__text {
  text-align: center;
}

.cta-v1--about .cta-v1__actions {
  inline-size: 100%;
  max-inline-size: 20.5rem;
}

.cta-v1--about .cta-v1__btn {
  font-family: var(--font-body-alt); /* Inter Medium — Figma 321:297 */
}

@media (min-width: 1024px) {
  .cta-v1--about .cta-v1__inner {
    gap: var(--cta-v1-about-stack-gap); /* 60px */
    padding-block: var(--cta-v1-about-pad-y); /* 140px */
  }

  .cta-v1--about .cta-v1__text {
    max-inline-size: var(--cta-v1-about-body-max); /* 1039px */
  }

  .cta-v1--about .cta-v1__actions {
    flex-wrap: nowrap;
    inline-size: var(--cta-v1-about-actions-w); /* 951px */
    max-inline-size: none;
    gap: var(--space-lg); /* 24px */
  }

  .cta-v1--about .cta-v1__btn {
    flex: 0 0 var(--cta-v1-about-btn-w); /* 300px */
    inline-size: var(--cta-v1-about-btn-w);
  }
}
