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

/**
 * PureTextOld — legacy text section (title + body + optional two-column extra).
 * Class naming: no BEM `__`; elements nested under `.pure-text-old`. Background,
 * alignment and two-column modifiers bared to `&.bg-*` / `&.align-*` /
 * `&.two-column`. The CTA slot wrapper is `.cta-slot` (not `.cta`) to avoid the
 * global `.cta` block (Cta component).
 */

.pure-text-old,
.pure-text-old *,
.pure-text-old *::before,
.pure-text-old *::after {
  box-sizing: border-box;
}

.pure-text-old {
  display: block;
  width: 100%;
  background: #ffffff;
  min-height: 232px;
  padding: 48px 20px 64px;
  font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;

  @media (min-width: 1024px) {
    min-height: 260px;
    padding: 72px 20px 72px;
  }

  &.bg-white {
    background: #ffffff;
  }

  &.bg-gray {
    background: #d6dcd9; /* neutral.lighter */
  }

  &.bg-dark {
    background: #292929; /* neutral.darkest */

    .title {
      color: #ffffff;
    }

    .body {
      color: #f1f3f2;
    }

    .body a {
      color: #8edb00; /* primary.40 — readable on dark */
    }
  }

  .inner {
    margin: 0 auto;
    width: 100%;
    max-width: calc(1388px + 40px);
    display: grid;
    grid-column-gap: 16px;
    grid-template-columns: repeat(4, 1fr);
    grid-template-areas: 'body body body body';

    @media (min-width: 600px) {
      grid-column-gap: 36px;
      grid-template-columns: repeat(8, 1fr);
      grid-template-areas: 'body body body body body body body body';
    }

    @media (min-width: 768px) {
      grid-template-areas: '. body body body body body body .';
    }

    @media (min-width: 1024px) {
      grid-column-gap: 24px;
      grid-template-columns: repeat(12, 1fr);
      grid-template-areas: '. body body body body body body body body body body .';
    }
  }

  .content {
    grid-area: body;
  }

  &.align-center {
    text-align: center;

    .content {
      text-align: center;
    }
  }

  &.align-left {
    text-align: left;

    .content {
      text-align: left;
    }

    @media (min-width: 1024px) {
      .inner {
        grid-template-areas: 'body body body body body body body body . . . .';
      }
    }
  }

  /* ====================================================================
   * Two-column layout — ports creditas-site WhyTrustUs `Reason`
   * (<div data-testid="reason">) grid + ExtraInfos right column.
   *   - Grid: 1fr below 1024px with 48px row-gap; repeat(2,1fr) at >=1024px
   *     with 24px column-gap (DefaultGrid up('5xl')).
   *   - Left column = MainInfos (width 100%). Right = ExtraInfos.
   * Modifier selectors (0,2,0) override the base .inner grid (0,1,0).
   * ================================================================== */
  &.two-column {
    .inner {
      grid-template-columns: 1fr;
      grid-template-areas: none;
      grid-column-gap: 24px;
      grid-row-gap: 48px;

      @media (min-width: 1024px) {
        grid-template-columns: repeat(2, 1fr);
        grid-template-areas: none;
      }
    }

    .content {
      grid-area: auto;
      width: 100%;
    }

    /* Left-aligned single-column tweak must not force the 2-col grid back. */
    &.align-left {
      @media (min-width: 1024px) {
        .inner {
          grid-template-areas: none;
        }
      }
    }
  }

  .extra {
    display: flex;
    color: #292929; /* neutral.90 */
    font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
    font-weight: 400;
    font-size: 14px; /* bodySmRegular */
    line-height: 20px;
    letter-spacing: 0.3px;

    a {
      color: #4f9e00; /* primary.60 */
      text-underline-position: under;
    }

    @media (min-width: 1024px) {
      justify-content: flex-end;
      text-align: right;
      font-size: 16px; /* bodyMdRegular */
      line-height: 24px;

      /* margin-top 8% lives on the rich-text block itself (old ExtraInfos Text). */
      & > *,
      & ::slotted(*) {
        margin-top: 8%;
      }
    }
  }

  .title {
    margin: 0 0 22px;
    color: #292929; /* neutral.90 */
    font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
    font-weight: 600;
    font-size: 32px;
    line-height: 40px !important;
    letter-spacing: 0.5px;

    @media (min-width: 1024px) {
      /* Old creditas-site (/seguranca): 48 / 52.8 Maison Neue Extended */
      font-size: 48px;
      line-height: 64px !important;
    }
  }

  .body {
    color: #3b4540; /* neutral.80 */
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.3px;

    @media (min-width: 1024px) {
      font-size: 20px;
      line-height: 28px;
    }

    p {
      margin: 0 0 24px; /* consistent inter-paragraph spacing */

      &:last-child {
        margin-bottom: 40px;
      }
    }

    a {
      color: #4f9e00; /* primary.60 */
    }

    strong,
    b {
      font-weight: 700;
    }
  }

  /* ---------- CTA slot (a dropped-in CTA component) ---------------- */
  .cta-slot {
    margin-top: 32px;
  }
}

/* Flatten Webflow's slot wrapper so the CTA sits inline and follows the
   section's text-align (left/center). */
.pure-text-old .cta-slot ::slotted(*) {
  display: contents;
}

