/* The receipts band on the front page: the case on the left, a phone with
   the photographed receipt on the right and the card of what was read off it
   overlapping the phone's trailing edge, the brand's glow behind. Stacked on
   a phone, the picture under the words. */

@layer components {
  .home-receipts {
    --home-bleed-background: var(--color-canvas);

    padding-block: 4.5rem;
    scroll-margin-block-start: var(--home-header-block-size);

    @media (width >= 768px) {
      padding-block: 6rem;
    }
  }

  .home-receipts__container {
    align-items: center;
    display: grid;
    gap: 3rem;

    @media (width >= 1024px) {
      gap: 4rem;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
  }

  .home-receipts__title {
    font-size: clamp(1.75rem, 3.2vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 1.25rem;
    text-wrap: balance;
  }

  .home-receipts__text {
    color: var(--color-ink-muted);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0 0 1.5rem;
    max-inline-size: 32rem;
  }

  .home-receipts__list {
    display: grid;
    gap: 0.75rem;
    list-style: none;
    margin: 0 0 2rem;
    padding: 0;
  }

  .home-receipts__point {
    align-items: center;
    display: flex;
    font-size: 0.9375rem;
    gap: 0.625rem;
  }

  .home-receipts__check {
    align-items: center;
    background: var(--color-brand-tint);
    block-size: 1.125rem;
    border-radius: var(--radius-pill);
    color: var(--color-brand);
    display: flex;
    flex-shrink: 0;
    inline-size: 1.125rem;
    justify-content: center;
  }

  /* The phone stands left of centre so the card has room to overlap it. */
  .home-receipts__visual {
    display: grid;
    justify-items: center;
    padding-block-end: 2rem;
    position: relative;

    @media (width >= 768px) {
      justify-items: start;
      padding-inline-start: 10%;
    }
  }

  .home-receipts__visual::before {
    background: radial-gradient(closest-side, oklch(from var(--color-brand) l c h / 55%), transparent);
    content: "";
    inset: -10% -10% 0 20%;
    pointer-events: none;
    position: absolute;
  }

  .home-receipts__phone {
    background: var(--color-surface-inverted);
    border-radius: var(--radius-3xl);
    box-shadow: var(--shadow-lifted);
    inline-size: min(15rem, 62%);
    padding: 0.5rem;
    position: relative;
  }

  .home-receipts__photo {
    block-size: auto;
    border-radius: var(--radius-2xl);
    display: block;
    inline-size: 100%;
  }

  .home-receipts__read {
    display: grid;
    gap: 0.5rem;
    inline-size: min(17rem, 80%);
    inset-block-end: 0;
    inset-inline-end: 0;
    position: absolute;

    @media (width >= 768px) {
      inset-block-end: 12%;
      inset-inline-end: 4%;
    }
  }

  .home-receipts__read-badge {
    align-items: center;
    background: var(--color-positive-tint);
    border-radius: var(--radius-pill);
    color: var(--color-positive);
    display: inline-flex;
    font-size: 0.6875rem;
    font-weight: 600;
    gap: 0.25rem;
    justify-self: start;
    padding: 0.125rem 0.625rem;
  }

  .home-receipts__fields {
    display: grid;
    margin: 0;
  }

  .home-receipts__field {
    align-items: baseline;
    border-block-end: 1px solid var(--color-border-subtle);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding-block: 0.5rem;

    dt {
      color: var(--color-ink-muted);
    }

    dd {
      font-weight: 600;
      margin: 0;
    }
  }

  .home-receipts__saved {
    align-items: center;
    color: var(--color-brand);
    display: flex;
    font-weight: 600;
    gap: 0.375rem;
  }
}
