/* Localized text CTAs size from their content and existing horizontal padding. */
html body :is(
  .fenix-home-button,
  .fenix-home-cases__button,
  .fenix-case-featured__button,
  .fenix-case-study-cta__button,
  .fenix-case-detail-related__button,
  .fenix-case-study-filterbar__button,
  .fenix-careers-job__button,
  .fenix-job-detail-summary__button,
  .fenix-resources-company__button,
  .fenix-not-found-hero__button,
  .fenix-testimonial-card__button,
  .fenix-testimonial-detail-card__button
):not(#fenix-fixed-button-width) {
  width: max-content !important;
  min-width: max-content !important;
  flex: 0 0 auto !important;
  white-space: nowrap;
}

html body :is(
  .fenix-home-button,
  .fenix-home-cases__button,
  .fenix-case-featured__button,
  .fenix-case-study-cta__button,
  .fenix-case-detail-related__button,
  .fenix-case-study-filterbar__button,
  .fenix-careers-job__button,
  .fenix-resources-company__button,
  .fenix-not-found-hero__button,
  .fenix-testimonial-card__button,
  .fenix-testimonial-detail-card__button
):not(#fenix-fixed-button-width) > :is(svg, img, [aria-hidden='true']) {
  flex-shrink: 0;
}

/* Match the shared CTA to the primary 52px Figma button. */
html body .fenix-case-study-cta__button:not(#fenix-fixed-button-width) {
  --button-bg: var(--fenix-primary-500);
  --button-fg: var(--fenix-white);
  --button-hover-bg: var(--fenix-primary-100);
  --button-hover-fg: var(--fenix-neutral-900);
  --button-stroke: url('../../images/design-system/button-stroke.svg') center / 100% 100% no-repeat;
  --button-stroke-content: '';
  height: 52px !important;
  min-height: 52px !important;
  padding-inline: 24px !important;
  gap: 8px !important;
  border-radius: 16px !important;
  background: var(--button-bg) !important;
  color: var(--button-fg) !important;
}

html body .fenix-case-study-cta__button:not(#fenix-fixed-button-width):hover,
html body .fenix-case-study-cta__button:not(#fenix-fixed-button-width):focus-visible {
  --button-stroke-content: none;
  background: var(--button-hover-bg) !important;
  color: var(--button-hover-fg) !important;
}

html body .fenix-case-study-cta__button:not(#fenix-fixed-button-width) > span:last-child {
  width: 24px !important;
  height: 24px !important;
  flex: 0 0 24px !important;
  font-size: 0 !important;
  background: currentColor !important;
  -webkit-mask: url('../../images/case-studies-pc/arrow-up-right.svg') center / 12px 12px no-repeat;
  mask: url('../../images/case-studies-pc/arrow-up-right.svg') center / 12px 12px no-repeat;
}
