/* ===== Lundia testimonials page (cards rebuilt from legacy tables) ===== */
.tm-jump {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 auto 2rem;
  padding: 0 1rem;
  font-family: Arial, sans-serif;
}

.tm-jump a {
  padding: 0.45rem 1rem;
  border: 1px solid #cfe5d5;
  border-radius: 999px;
  background-color: #f1f8f2;
  color: #1e7d3d;
  font-size: 0.9rem;
  font-weight: bold;
  text-decoration: none;
}

.tm-jump a:hover,
.tm-jump a:focus-visible {
  background-color: #1e7d3d;
  color: #fff;
}

#video-reviews,
.tm-section {
  scroll-margin-top: 1rem;
}

.tm-section {
  box-sizing: border-box;
  max-width: 1150px;
  margin: 3rem auto 0;
  padding: 0 1rem;
  font-family: Arial, sans-serif;
  color: #2b3542;
}

.tm-section *,
.tm-section *::before,
.tm-section *::after {
  box-sizing: border-box;
}

.tm-heading {
  margin: 0 0 1.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 3px solid #1e7d3d;
  font-size: 1.8rem;
  color: #2b3542;
  text-align: center;
}

/* Written testimonials: two-column masonry */
.tm-grid {
  column-count: 2;
  column-gap: 1.5rem;
}

.tm-grid .tm-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 1.5rem;
  break-inside: avoid;
}

/* Photo testimonials: one per row */
.tm-list {
  display: grid;
  gap: 1.75rem;
  max-width: 980px;
  margin: 0 auto;
}

.tm-card {
  overflow: hidden;
  border: 1px solid #e1e4e8;
  border-top: 4px solid #1e7d3d;
  border-radius: 10px;
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

/* Photos: one row, equal heights (each figure grows by its aspect ratio) */
.tm-photos {
  display: flex;
  gap: 6px;
  padding: 6px 6px 0;
}

.tm-photos figure {
  flex: var(--ar) 1 0;
  min-width: 0;
  margin: 0;
}

.tm-photos img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.tm-video {
  max-width: 340px;
  margin: 1.25rem auto 0;
  aspect-ratio: 9 / 16;
}

.tm-video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
}

.tm-body {
  padding: 1.25rem 1.5rem 1.4rem;
}

.tm-label {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background-color: #1e7d3d;
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tm-stars {
  margin-bottom: 0.6rem;
  color: #f5b500;
  font-size: 1.2rem;
  letter-spacing: 3px;
  line-height: 1;
}

.tm-star-off {
  color: #d9dce0;
}

.tm-quote {
  position: relative;
  margin: 0;
  padding: 0 0 0 1.1rem;
  border-left: 3px solid #e1e4e8;
}

.tm-quote p {
  margin: 0 0 0.7rem;
  font-size: 1rem;
  line-height: 1.65;
  color: #3a4250;
}

.tm-quote p:last-child {
  margin-bottom: 0;
}

.tm-quote a {
  color: #1e7d3d;
}

.tm-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid #eef0f2;
  font-size: 0.92rem;
}

.tm-name {
  font-weight: bold;
  color: #2b3542;
}

.tm-loc {
  color: #6b7280;
}

.tm-finish {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background-color: #f1f8f2;
  color: #1e7d3d;
  font-size: 0.82rem;
  font-weight: bold;
}

.tm-note {
  flex-basis: 100%;
  font-size: 0.85rem;
  font-style: italic;
  color: #6b7280;
}

/* Closing call to action */
.tm-cta {
  box-sizing: border-box;
  max-width: 980px;
  margin: 3rem auto;
  padding: 2rem 1.5rem;
  border-radius: 10px;
  background-color: #f1f8f2;
  font-family: Arial, sans-serif;
  text-align: center;
}

.tm-cta h2 {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
  color: #2b3542;
}

.tm-cta p {
  margin: 0 0 1.2rem;
  font-size: 1.05rem;
  color: #444;
}

.tm-cta-btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  border-radius: 6px;
  background-color: #1e7d3d;
  color: #fff;
  font-weight: bold;
  text-decoration: none;
}

.tm-cta-btn:hover,
.tm-cta-btn:focus-visible {
  background-color: #145c2b;
  color: #fff;
}

@media (max-width: 800px) {
  .tm-grid {
    column-count: 1;
  }
}

@media (max-width: 600px) {
  .tm-section {
    margin-top: 2rem;
    padding: 0 0.75rem;
  }

  .tm-heading {
    font-size: 1.45rem;
  }

  .tm-body {
    padding: 1rem 1.1rem 1.15rem;
  }

  /* 4-5 photos: switch to a 2-column grid so they aren't tiny */
  .tm-photos-4,
  .tm-photos-5 {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .tm-photos-4 img,
  .tm-photos-5 img {
    aspect-ratio: 3 / 4;
    height: 100%;
    object-fit: cover;
  }

  .tm-photos-5 figure:first-child {
    grid-column: 1 / -1;
  }

  .tm-photos-5 figure:first-child img {
    aspect-ratio: auto;
  }

  .tm-cta-btn {
    display: block;
  }
}

/* Small, low-resolution photos: show near their real size (max 1.3x) so they
   stay sharp, centered on a light panel; the card keeps its full width. */
.tm-photos-fit {
  justify-content: center;
  gap: 10px;
  margin: 6px 6px 0;
  padding: 14px;
  border-radius: 6px;
  background-color: #f3f4f6;
}

.tm-photos-fit figure {
  flex: 0 1 calc(var(--w) * 1.3px);
}
