/* tt-testimonials.css — TestimonialTree fragment styles for marketing pages
 *
 * Paired with tools/tt-emit-fragments.py. That emitter produces 9 fragments
 * under tools/tt-fragments/ carrying the .tt-* class names this stylesheet
 * targets; tools/inject-tt-fragments.py then stamps those fragments into
 * sentinel-gated slots on marketing pages.
 *
 * Tracked per Convention #14 (every asset referenced by HTML must be tracked).
 *
 * Scope: loaded by pages/testimonials.html, per-agent pages, and any other
 *   marketing surface that hosts an injected TT fragment. The only surfaces
 *   linking this file must also expect the emitter's HTML shape.
 *
 * Palette mirrors css/ddf-fragment.css: dark cards on #0a0a0a/#111,
 * Royal LePage brand red #EA002A accents, Roboto body / Raleway display.
 */

/* ---------------------------------------------------------------------- */
/* Fragment outer container                                                */
/* ---------------------------------------------------------------------- */

.tt-fragment {
  max-width: 1200px;
  margin: 40px auto 60px;
  padding: 0 20px;
  color: #f0f0f0;
  font-family: 'Roboto', sans-serif;
  font-weight: 300;
  line-height: 1.6;
}

/* ---------------------------------------------------------------------- */
/* Aggregate rating block (top of agent + brokerage-rollup fragments)      */
/* ---------------------------------------------------------------------- */

.tt-aggregate {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  padding: 20px 24px;
  margin: 0 0 24px;
  background: #111;
  border: 1px solid #1e1e1e;
  border-left: 3px solid #EA002A;
  border-radius: 4px;
}
.tt-agg-value {
  font-family: 'Raleway', sans-serif;
  font-weight: 900;
  font-size: 2rem;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
}
.tt-agg-stars {
  color: #f5b301;
  font-size: 1.25rem;
  letter-spacing: 2px;
  line-height: 1;
}
.tt-agg-count {
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
}
.tt-agg-count [itemprop="reviewCount"] {
  color: #fff;
  font-weight: 500;
}

/* ---------------------------------------------------------------------- */
/* Card grid                                                               */
/* ---------------------------------------------------------------------- */

.tt-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* Honour the HTML `hidden` attribute on the rollup reserve.
 * Without this, `display: grid` above would override the default
 * `display: none` that `hidden` implies — rendering all 246 cards
 * regardless of Load-more state (observed 2026-04-24 on the live
 * pages/testimonials.html canary; the section was 31,284 px tall
 * because the 234-card reserve wrapper stayed visible). */
.tt-cards[hidden] {
  display: none;
}

.tt-card {
  background: #111;
  border: 1px solid #1e1e1e;
  border-radius: 4px;
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  transition: transform .3s, border-color .3s;
}
.tt-card:hover {
  transform: translateY(-4px);
  border-color: #EA002A;
}

.tt-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.tt-stars {
  color: #f5b301;
  font-size: 1rem;
  letter-spacing: 2px;
  line-height: 1;
}
.tt-date {
  font-family: 'Roboto', sans-serif;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.02em;
}

.tt-body {
  margin: 0 0 16px;
  padding: 0;
  color: #f0f0f0;
  font-size: 0.95rem;
  line-height: 1.55;
  font-style: normal;
  quotes: none;
  border: none;
  flex-grow: 1;
}
.tt-body::before,
.tt-body::after {
  content: "";
}

.tt-attribution {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 14px;
  border-top: 1px solid #1e1e1e;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
}
.tt-author {
  color: #fff;
  font-style: normal;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}
.tt-agent-badge {
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.tt-agent-badge a {
  color: #EA002A;
  text-decoration: none;
  font-weight: 500;
}
.tt-agent-badge a:hover,
.tt-agent-badge a:focus-visible {
  text-decoration: underline;
  outline: none;
}

/* ---------------------------------------------------------------------- */
/* View-all tail (agent fragments)                                         */
/* ---------------------------------------------------------------------- */

.tt-view-all {
  display: inline-block;
  margin: 18px 0 0;
  color: #EA002A;
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}
.tt-view-all:hover,
.tt-view-all:focus-visible {
  text-decoration: underline;
  outline: none;
}

/* ---------------------------------------------------------------------- */
/* Load-more (brokerage-rollup)                                            */
/*                                                                         */
/* The emitter ships the "more" batch wrapped in both `hidden` attribute   */
/* and `.tt-rollup-hidden` class. The Load-more button carries             */
/* `data-expand-target="tt-rollup-hidden"` — a small JS stub on the        */
/* hosting page strips the `hidden` attr on click. No JS yet; when         */
/* landed, the CSS below hides the button once the target is expanded.    */
/* ---------------------------------------------------------------------- */

.tt-cards.tt-rollup-hidden {
  margin-top: 20px;
}
.tt-load-more {
  display: inline-block;
  margin: 24px 0 0;
  padding: 12px 28px;
  background: transparent;
  border: 1px solid #EA002A;
  color: #EA002A;
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 2px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.tt-load-more:hover,
.tt-load-more:focus-visible {
  background: #EA002A;
  color: #fff;
  outline: none;
}
.tt-load-more[hidden] {
  display: none;
}

/* ---------------------------------------------------------------------- */
/* Mobile tuning                                                           */
/* ---------------------------------------------------------------------- */

@media (max-width: 600px) {
  .tt-fragment {
    margin: 28px auto 40px;
    padding: 0 16px;
  }
  .tt-aggregate {
    padding: 16px 18px;
  }
  .tt-agg-value {
    font-size: 1.6rem;
  }
  .tt-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .tt-card {
    padding: 18px 18px 16px;
  }
  .tt-body {
    font-size: 0.92rem;
  }
}
