/* Legacy-parity text rendering: the old Creditas site sets
 * -webkit-font-smoothing: antialiased globally, which renders type
 * lighter/thinner on macOS. Webflow Code Components live in isolated
 * shadow roots, so this must be declared per-component on :host to
 * inherit into the shadow tree (the property does not cross the
 * shadow boundary). Without it, Blink defaults to subpixel smoothing
 * and identical 400-weight text looks heavier than the old site. */
:host {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/**
 * CrossSell — centered section with heading, optional pre-title and
 * description, a flex row of cards, and an optional CTA link.
 *
 * Class naming: single-class, no BEM `__` separator; element rules nested
 * under `.cross-sell`. The section CTA is `.cta-link` (not `.cta`) to avoid the
 * global `.cta` block from the Cta component. The card's own title/description/
 * cta are prefixed `card-*` (see CrossSellCard.css) so the section's
 * `.cross-sell .title` etc. don't reach the slotted cards.
 *
 * Tokens inlined from @creditas-ui/themes standard:
 *   colors.neutral.0 #ffffff  .10 #f1f3f2  .60 #52605a  .100 #292929
 *   colors.primary.40 #8edb00  .60 #4f9e00
 *   section padding Y: 64px mobile → 96px desktop (1024px+)
 *   container: max-width 1072px, margin 0 auto, width 90%
 */

:host,
.cross-sell {
  display: block;
}

.cross-sell,
.cross-sell *,
.cross-sell *::before,
.cross-sell *::after {
  box-sizing: border-box;
}

.cross-sell {
  background-color: #ffffff;
  color: #292929;
  font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
  padding: 64px 0;
  text-align: left;

  @media (min-width: 1024px) {
    padding: 96px 0;
  }

  /* ---------- dark variant ---------------------------------------- */

  &.dark {
    background-color: #292929;
    color: #ffffff;
  }

  /* ---------- container ------------------------------------------- */

  .container {
    width: 90%;
    max-width: 1072px;
    margin: 0 auto;
  }

  /* ---------- pre-title ------------------------------------------- */

  .pretitle {
    margin: 0 0 8px;
    font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 24px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #4f9e00;
  }

  /* ---------- title ----------------------------------------------- */

  .title {
    margin: 0 0 12px;
    font-family: 'Maison Neue Extended', 'Maisonneueextended Book',
      'Maisonneueextended', 'Helvetica Now Display', 'Helveticanowdisplay',
      sans-serif;
    font-weight: 500;
    font-size: 32px;
    line-height: 32px;
    color: #292929;

    /* When there's no description, the cards follow directly after the title */
    &:last-child,
    & + .cards {
      margin-top: 40px;
    }
  }

  /* ---------- description ----------------------------------------- */

  .description {
    margin: 0 0 40px;
    font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    color: #52605a;
  }

  &.dark .title {
    color: #ffffff;
  }
  &.dark .description {
    color: #f1f3f2;
  }

  /* ---------- cards row ------------------------------------------- */

  .cards {
    display: flex;
    gap: var(--cross-sell-cards-gap, 24px);
    justify-content: flex-start;
    align-items: stretch;

    &.row {
      flex-flow: row wrap;
    }

    &.column {
      flex-direction: column;
      flex-wrap: nowrap;
      align-items: flex-start;
    }

    /* Flatten Webflow's slot wrapper without breaking regular React children. */
    ::slotted(*) {
      display: contents;
    }
  }

  /* ---------- CTA link -------------------------------------------- */

  .cta-wrapper {
    margin-top: 40px;
  }

  .cta-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 24px;
    color: #4f9e00;
    text-decoration: none;
    transition: color 0.2s ease;

    &:hover {
      color: #8edb00;
    }

    &:focus-visible {
      outline: 2px solid #4f9e00;
      outline-offset: 2px;
      border-radius: 2px;
    }

    .cta-arrow {
      font-size: 18px;
      line-height: 1;
    }
  }
}

