/* 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;
}

/**
 * PersonalizedServiceCard (Old) — one card inside a PersonalizedService grid.
 *
 * Class naming: single-class, no BEM `__` separator; element rules nested
 * under `.personalized-service-card-old`. The title/description/cta are prefixed
 * `card-*` so the parent section's `.personalized-service .title` etc. don't
 * reach them (the `channels` layout renders the section title outside `.info`,
 * so the parent can't scope it away). `card-cta` also avoids the global `.cta`.
 */

:host,
.personalized-service-card-old {
  display: block;
}

.personalized-service-card-old,
.personalized-service-card-old *,
.personalized-service-card-old *::before,
.personalized-service-card-old *::after {
  box-sizing: border-box;
}

.personalized-service-card-old {
  /* Old creditas-site: icon vertically centered against the text, 24px gap */
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 0;
  text-decoration: none;
  color: inherit;
  font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
  /* Shared card-sizing contract (--card-*) — inert in Grid/Stack; takes effect
     in the Row layout where the parent makes equal, wrapping columns. */
  flex: var(--card-grow, 0) var(--card-shrink, 1) var(--card-basis, auto);
  min-width: 0;

  &.small {
    gap: 12px;
    padding: 16px 0;
  }

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

    .content {
      max-width: none;
    }
  }

  .icon {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;

    /* icon squircle (ported from creditas-site CustomIcon/ShapeIcon) */
    img,
    svg {
      position: relative;
      z-index: 1;
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    &[data-squircle='true']::before {
      content: '';
      position: absolute;
      width: 77%;
      height: 85%;
      background: #8edb00; /* primary.40 */
      opacity: 0.25;
      border-radius: 8px;
      z-index: 0;
    }

    &[data-squircle-position='top-left']::before {
      top: 4px;
      left: 6px;
    }
    &[data-squircle-position='top-right']::before {
      top: 4px;
      right: 6px;
    }
    &[data-squircle-position='bottom-left']::before {
      bottom: 4px;
      left: 6px;
    }
    &[data-squircle-position='bottom-right']::before {
      bottom: 4px;
      right: 6px;
    }
    &[data-squircle-position='center-top']::before {
      top: 2px;
      left: 0;
      right: 0;
      margin: 0 auto;
    }
    &[data-squircle-position='center-bottom']::before {
      bottom: 2px;
      left: 0;
      right: 0;
      margin: 0 auto;
    }
  }

  &.small .icon {
    width: 30px;
    height: 30px;
  }

  .content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;

    @media (min-width: 1024px) {
      max-width: 350px;
    }
  }

  .card-title {
    /* Live .css-7kt026: mobile 14/20 bold 700 → 20/28 medium 500 at 5xl. */
    margin: 0;
    color: #292929; /* neutral.90 */
    font-weight: 700;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.3px;

    @media (min-width: 1024px) {
      font-weight: 500;
      font-size: 20px;
      line-height: 28px;
      letter-spacing: 0.5px;
    }
  }

  .card-description {
    /* Old creditas-site: 14/20 Neutral/Dark #52605a at full opacity */
    margin: 0;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.3px;
    color: #52605a;
    opacity: 1;
  }

  /* ---------- CTA variant (live channel card .css-14cj61g) --------- */

  &.cta-card {
    display: grid;
    align-content: space-between;
    align-items: initial;
    gap: 0;
    height: 100%;
    padding: 24px 0;
  }

  /* CTA link — live .css-l4zhtt.css-zvkmxc (action green, 700, 16/24). */
  .card-cta {
    display: flex;
    align-items: center;
    color: #317500; /* action green */
    font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 24px;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow 0.3s ease-in-out;

    &:hover,
    &:focus {
      color: #317500;
      text-decoration: underline;
    }

    /* Arrow reveal on hover/focus of the link. */
    &:hover .card-cta-arrow,
    &:focus .card-cta-arrow {
      opacity: 1;
      translate: 0;
    }
  }

  /* Arrow — hidden and nudged left until the link is hovered/focused. */
  .card-cta-arrow {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    margin-left: 14px;
    color: inherit;
    opacity: 0;
    translate: -10%;
    transition: opacity 0.3s ease-in-out, translate 0.3s ease-in-out;
  }

  /* Region label — live .css-82ivs7 (neutral.60, 14/20, pre-line). */
  .label {
    margin: 0;
    margin-top: 12px;
    color: #52605a; /* neutral.60 */
    font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.3px;
    white-space: pre-line;

    &:not(:last-child) {
      margin-bottom: 32px;
    }

    /* Trailing spacer — live .css-1hbumyu (bottom gap, 12 → 16 at 5xl). */
    &.spacer {
      margin-top: 0;
      margin-bottom: 12px;

      @media (min-width: 1024px) {
        margin-bottom: 16px;
      }
    }
  }
}

/* Clickable (anchor) card — hover/focus affordances on the root itself. */
a.personalized-service-card-old {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

a.personalized-service-card-old:hover {
  opacity: 0.85;
  transform: translateX(4px);
}

a.personalized-service-card-old:focus-visible {
  outline: 2px solid #8edb00;
  outline-offset: 4px;
  border-radius: 8px;
}

