/* ==========================================================================
   MEET YOUR LOCAL PRO — credibility section (css/meet-pro.css)
   Markup is rendered into [[MEET_PRO]] by scripts/generate.js from a
   config's optional "meet_pro" block. Sits between the hero and services.
   ========================================================================== */

.mp-section {
  background: var(--color-bg-alt);
}

/* ---------------------------------------------------------------
   Intro: bio + trust chips beside the pro's work photos
--------------------------------------------------------------- */
.mp-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}

/* No photos: centered single column instead of a lopsided grid. */
.mp-intro--text-only {
  grid-template-columns: 1fr;
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

.mp-intro--text-only .mp-chips {
  justify-content: center;
}

.mp-bio {
  color: var(--color-text);
  line-height: var(--line-height-relaxed);
  margin-top: var(--space-sm);
}

.mp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: var(--space-md);
}

/* .badge is white-space: nowrap; meet-pro chips carry full sentences, and an
   unwrappable chip inflates the whole page past the viewport on phones. */
.mp-chip {
  white-space: normal;
  line-height: 1.4;
}

/* Grid items default to min-width: auto — without this, wide content in
   either column can stretch the section beyond the viewport. */
.mp-intro-text,
.mp-photos {
  min-width: 0;
}

.mp-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.mp-photo {
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-sm);
}

/* Odd photo counts get a full-width lead tile (3 -> 1 big + 2 small, 1 -> 1
   big); even counts pair up cleanly with no dangling half row. All tiles stay
   4:3: client photos (e.g. before/after composites with edge labels) are
   native 4:3, so this avoids cropping them. */
.mp-photo:first-child:nth-last-child(odd) {
  grid-column: 1 / -1;
}

.mp-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------------------------------------------------------------
   Reviews marquee — the track holds the card set twice (second
   copy aria-hidden), so translateX(-50%) loops seamlessly with
   zero JS. Pauses on hover/focus; static scroller under
   prefers-reduced-motion. Desktop-only: at <=768px the marquee
   becomes a scroll-snap swipe scroller (see Responsive below).
--------------------------------------------------------------- */
.mp-reviews-heading {
  text-align: center;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

.mp-reviews {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
  mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.mp-reviews-track {
  display: flex;
  width: max-content;
  animation: mp-marquee var(--mp-marquee-duration, 40s) linear infinite;
}

.mp-reviews:hover .mp-reviews-track,
.mp-reviews:focus-within .mp-reviews-track {
  animation-play-state: paused;
}

.mp-reviews-set {
  display: flex;
  gap: var(--space-md);
  padding-right: var(--space-md);
}

@keyframes mp-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.mp-review-card {
  flex: 0 0 320px;
  background: var(--white);
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.mp-stars {
  color: var(--color-star);
  font-size: 1.05rem;
  letter-spacing: 2px;
  margin-bottom: var(--space-xs);
}

.mp-review-text {
  color: var(--color-text);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: var(--space-sm);
}

.mp-review-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto; /* pins the author row to the card bottom for equal-height cards */
}

.mp-review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.mp-review-name {
  display: block;
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.85rem;
}

.mp-review-source {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.mp-disclosure {
  text-align: center;
  margin-top: var(--space-sm);
  margin-inline: auto; /* base.css caps p at 70ch; recenter the box itself */
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ---------------------------------------------------------------
   CTA back to the lead form
--------------------------------------------------------------- */
.mp-cta-row {
  text-align: center;
  margin-top: var(--space-lg);
}

.mp-cta-note {
  margin-top: var(--space-xs);
  margin-inline: auto; /* base.css caps p at 70ch; recenter the box itself */
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ---------------------------------------------------------------
   Motion preference: no animation, manual horizontal scroll,
   duplicate card set hidden.
--------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .mp-reviews-track {
    animation: none;
    width: auto;
  }
  .mp-reviews {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .mp-reviews-set[aria-hidden="true"] {
    display: none;
  }
}

/* ---------------------------------------------------------------
   Responsive
--------------------------------------------------------------- */
@media (max-width: 768px) {
  .mp-intro {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  /* Marquee -> native swipe scroller: auto-scroll is unreadable at one card
     per screen and the pause is hover-only, which touch doesn't have. */
  .mp-reviews-track {
    animation: none;
    width: auto;
  }

  .mp-reviews {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: none;
    mask-image: none; /* the edge-cut peek of the next card is the swipe cue */
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .mp-reviews::-webkit-scrollbar {
    display: none;
  }

  .mp-reviews-set[aria-hidden="true"] {
    display: none; /* duplicate loop copy not needed without the animation */
  }

  .mp-review-card {
    scroll-snap-align: start;
  }
}

@media (max-width: 480px) {
  .mp-review-card {
    flex-basis: 260px;
  }
}
