// Inline testimonial cards.
// Placement:
//   - <EssayTestimonial />     directly after Essay Intensive CTA, before the thesis bridge
//   - <ComponentTestimonial /> directly after Component Intensive CTA, before Office Hours
//
// One student per card. No headers, no ratings, no carousels — these sit inline
// inside their respective product sections.

const PlaceholderAvatar = ({ initials, tone = "warm" }) => (
  <span className={`testimonial-avatar tone-${tone}`} aria-hidden="true">{initials}</span>
);

const Testimonial = ({ initials, tone, name, meta, quote, tag }) => (
  <section className="testimonial-section">
    <div className="wide">
      <article className="testimonial-card">
        <header className="testimonial-head">
          <PlaceholderAvatar initials={initials} tone={tone} />
          <div className="testimonial-id">
            <div className="testimonial-name">{name}</div>
            <div className="testimonial-meta">{meta}</div>
          </div>
        </header>
        <blockquote className="testimonial-quote">{quote}</blockquote>
        <div className="testimonial-tag">{tag}</div>
      </article>
    </div>
  </section>
);

const EssayTestimonial = () => (
  <Testimonial
    initials="AR"
    tone="warm"
    name="Amelia R."
    meta="Economics · Predicted 5 → Final 7"
    quote="I kept getting 5s because my IA didn't have a clear research question and I didn't know that was the problem. Steven made me rewrite the RQ three times before I touched the analysis. The actual writing took a week. The thinking took three. That's the thing nobody else made me do."
    tag="Essay Intensive · May 2026 cohort"
  />
);

const ComponentTestimonial = () => (
  <Testimonial
    initials="DK"
    tone="cool"
    name="Daniel K."
    meta="History EE · Predicted 6 → Final 7"
    quote="My first draft was 4,000 words of narrative. Elijah read it once and asked me what my argument actually was. I didn't have one. Three weeks later I had an argument, three sub-claims, and an EE that examiners could actually mark. The grade followed."
    tag="Component Intensive · 2026"
  />
);

Object.assign(window, { EssayTestimonial, ComponentTestimonial, Testimonial });
