/* styles/sections/testimonial-feature.css
 * Featured testimonial (frames: Testimonial): the dithered portrait beside a display quote with
 * its open mark hung in the gutter, then two shorter quotes with company marks in two columns
 * under an ink 35% rule. The figcaptions use the attribution primitive. 390 stacks everything.
 * The 1920 frame sets the lead quote in regular weight at 68px. */
@layer sections {
  .testimonial-feature {
    padding-block: var(--section-xl);
    box-shadow: inset 0 1px 0 var(--line);
  }

  .testimonial-feature > .container {
    display: flex;
    flex-direction: column;
    gap: var(--space-48);
  }

  .testimonial-feature__lead {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    margin: 0;
  }

  .testimonial-feature__portrait {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    margin-bottom: var(--space-32);
  }

  .testimonial-feature__quote {
    margin: 0;
  }

  .testimonial-feature__quote p {
    position: relative;
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--t-h2-size);
    font-weight: 600;
    line-height: var(--t-h2-lh);
    letter-spacing: var(--t-h2-ls);
  }

  .testimonial-feature__mark {
    position: absolute;
    top: 0;
    right: 100%;
    line-height: inherit;
    letter-spacing: inherit;
  }

  .testimonial-feature__attribution {
    padding-top: var(--space-24);
  }

  .testimonial-feature__attribution .attribution__name {
    font-size: 14px;
  }

  .testimonial-feature__attribution .attribution__role,
  .more-quotes .attribution__role {
    font-size: 13px;
  }

  .more-quotes {
    display: flex;
    flex-direction: column;
    gap: var(--space-40);
    padding-top: 28px;
    box-shadow: inset 0 1px 0 var(--more-quotes-rule, var(--ink-20));
  }

  .more-quotes__item {
    display: flex;
    flex-direction: column;
    gap: var(--space-20);
    margin: 0;
  }

  .more-quotes__quote {
    margin: 0;
  }

  .more-quotes__quote p {
    position: relative;
    margin: 0;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.5;
  }

  .more-quotes__mark {
    position: absolute;
    top: 0;
    right: calc(100% + 1px);
  }

  .more-quotes .attribution--logo {
    gap: var(--space-12);
  }

  .more-quotes .attribution__logo {
    padding-right: var(--space-12);
  }

  .more-quotes .attribution__name {
    font-size: 14px;
  }

  .more-quotes__logo--reason {
    width: 83px;
    height: 24px;
  }

  .more-quotes__logo--eragon {
    width: 88px;
    height: 24px;
  }

  @media (width >= 900px) {
    .testimonial-feature > .container {
      gap: var(--space-80);
    }

    /* 400 : 800 at 1280 of content, scaled between the frame widths */
    .testimonial-feature__lead {
      grid-template-columns: minmax(0, 400fr) minmax(0, 800fr);
      grid-template-rows: auto 1fr;
      column-gap: var(--space-80);
    }

    .testimonial-feature__portrait {
      grid-row: 1 / 3;
      margin-bottom: 0;
    }

    .testimonial-feature__quote p {
      font-size: min(var(--t-display-sm-size), (100vw - 2 * var(--page-gutter)) * 0.05);
      line-height: var(--t-display-sm-lh);
      letter-spacing: var(--t-display-sm-ls);
    }

    .testimonial-feature__mark {
      margin-right: -1px;
    }

    .testimonial-feature__attribution {
      align-self: start;
      padding-top: var(--space-40);
    }

    .more-quotes {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: var(--space-80);
      --more-quotes-rule: var(--ink-35);
      padding-top: var(--space-32);
    }

    .more-quotes__quote p {
      font-size: 20px;
    }

    .more-quotes .attribution--logo {
      gap: var(--space-14);
    }

    .more-quotes .attribution__logo {
      padding-right: var(--space-14);
    }

    .more-quotes__logo--reason {
      width: 100px;
      height: 29px;
    }

    .more-quotes__logo--eragon {
      width: 80px;
      height: 22px;
    }
  }

  @media (width >= 1680px) {
    .testimonial-feature {
      --container-max: 1280px;
    }

    .testimonial-feature__lead {
      grid-template-columns: 480px minmax(0, 1fr);
    }

    .testimonial-feature__quote p {
      font-size: 68px;
      font-weight: 400;
      line-height: 1.06;
      letter-spacing: -1.8px;
    }

    .testimonial-feature__mark {
      font-size: 60px;
    }

    .testimonial-feature__attribution .attribution__name {
      font-size: 17px;
      font-weight: 600;
    }

    .testimonial-feature__attribution .attribution__role {
      font-size: 16px;
    }

    .more-quotes__quote p {
      font-size: 24px;
      line-height: 1.32;
      letter-spacing: -0.2px;
    }

    .more-quotes .attribution__name {
      font-weight: 600;
    }
  }
}

/* Pencil sets every line on a whole pixel (88 x 0.95 = 84, 18 x 1.6 = 29, 17 x 1.6 = 27);
   these rounded line heights keep the page's text boxes the frames' size. */
@layer sections {
  .testimonial-feature__quote p {
    line-height: round(nearest, 1.05em, 1px);
  }

  :is(.testimonial-feature__attribution, .more-quotes) :is(.attribution__name, .attribution__role) {
    line-height: round(nearest, 1.2em, 1px);
  }

  .more-quotes__quote p {
    line-height: round(nearest, 1.5em, 1px);
  }

  @media (width >= 900px) {
    .testimonial-feature__quote p {
      line-height: round(nearest, 0.95em, 1px);
    }
  }

  @media (width >= 1680px) {
    .testimonial-feature__quote p {
      line-height: round(nearest, 1.06em, 1px);
    }

    .more-quotes__quote p {
      line-height: round(nearest, 1.32em, 1px);
    }
  }
}
