/* 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 — one card inside a PersonalizedService grid.
 * Icon + title + description, optionally clickable.
 *
 * Class naming: single-class, no BEM `__` separator; element rules nested
 * under `.personalized-service-card`. The card keeps `.title`/`.description`;
 * the parent section scopes its own to `.info` so they don't clash.
 */

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

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

.personalized-service-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 0;
  text-decoration: none;
  color: inherit;
  font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
  /* Shared card-sizing contract (--card-*) — as a flex ITEM. Inert in
     Grid/Stack (parent is a grid there); takes effect only in the Row layout,
     where the parent sets them to make equal, wrapping columns. */
  flex: var(--card-grow, 0) var(--card-shrink, 1) var(--card-basis, auto);
  min-width: 0;

  @media (min-width: 1024px) {
    margin-left: 25px;
  }

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

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

  &.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;

    @media (min-width: 600px) {
      width: 48px;
      height: 48px;
    }

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

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

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

  .card-title {
    margin: 0;
    font-weight: 500;
    font-size: 18px;
    line-height: 26px;
    letter-spacing: 0.3px;
  }

  .card-description {
    margin: 0;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.3px;
    opacity: 0.85;
  }
}

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

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

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

