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

/**
 * FaqQuestion — single accordion item inside a Faq section.
 * Uses native <details>/<summary> for keyboardable expand/collapse
 * without any JavaScript.
 *
 * Class naming: single-class, no BEM `__` separator; element rules are
 * nested under the `.details` root. The `.faq-question` block below is
 * vestigial (no element carries that class — the root is <details>); it
 * is kept verbatim so the box-sizing baseline is unchanged.
 *
 * Token values inlined from @creditas-ui/themes standard:
 *   colors.neutral.15   = #d6dcd9
 *   colors.neutral.90   = #292929
 *   colors.primary.60   = #4f9e00
 *
 *   typography.body.lg → 18px / 26px / 0.3px
 *   typography.body.md → 16px / 24px / 0.3px
 */

:host,
.faq-question {
  display: block;
}

.faq-question,
.faq-question *,
.faq-question *::before,
.faq-question *::after {
  box-sizing: border-box;
}

.details {
  border-bottom: 1px solid #d6dcd9;

  &:first-of-type {
    border-top: 1px solid #d6dcd9;
  }

  &[open] .icon {
    transform: rotate(180deg);
  }

  .summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 32px 0;
    list-style: none;
    cursor: pointer;
    color: #292929;
    font-weight: 500;
    font-size: 18px;
    line-height: 26px;
    letter-spacing: 0.3px;
    transition: color 0.2s ease;

    /* Hide default arrow on Safari */
    &::-webkit-details-marker {
      display: none;
    }

    &:hover {
      color: #4f9e00;
    }

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

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

  .question {
    flex: 1;
    padding-right: 24px;
  }

  .icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
  }

  .body {
    padding: 0 24px 40px 0;
    color: #292929;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.3px;

    /* Rich-text answer content (bullets / links / emphasis) — shared with
       the plain answer, which simply contains none of these elements. */
    p {
      margin: 0 0 12px;
    }

    p:last-child {
      margin-bottom: 0;
    }

    ul,
    ol {
      margin: 8px 0;
      padding-left: 20px;
    }

    li {
      margin: 4px 0;
    }

    strong,
    b {
      font-weight: 700;
    }

    :is(p, ul, ol) {
      margin: 0 0 1em;
    }

    :is(p, ul, ol):last-child {
      margin-bottom: 0;
    }

    a {
      color: #4f9e00;
      text-decoration: underline;
      font-weight: 500;
    }
  }

  .redirect {
    display: inline-block;
    margin-top: 16px;
    color: #4f9e00;
    font-weight: 500;
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
  }
}

