/* ==========================================================================
   Testimonial card (.sp-tm-card): the one testimonial format site-wide.
   Markup: template-parts/shared/testimonial-cards.php.

   The testimonials page loads this file instead of the whole of
   service-pro.css (78 KB, 29 Sep 2026). Service and product pages still take
   the same rules from service-pro.css section 8a-ii, copied here verbatim:
   change both until service-pro.css loads this file instead (ROADMAP).
   ========================================================================== */

.sp-tm-card {
    position: relative;
    display: flex;
    flex-direction: column;
    margin: 0;
    background-color: var(--sd-color-white);
    border: 1px solid rgba(54, 69, 47, 0.08);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(54, 69, 47, 0.05);
    transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.sp-tm-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px -8px rgba(54, 69, 47, 0.16);
}

.sp-tm-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.75rem 1.75rem 1.5rem;
}

.sp-tm-card__rating {
    display: flex;
    gap: 2px;
    margin-bottom: 1.125rem;
    color: #f0b429;
}

.sp-tm-card__star {
    width: 16px;
    height: 16px;
}

.sp-tm-card__star--empty {
    color: rgba(54, 69, 47, 0.15);
}

/* The quote leads. Curly quotes come from CSS so every card matches whatever
   the data carried; the partial strips the data's own marks first. Six-line
   clamp keeps one long review from setting the row height — the full text is
   still in the DOM and the toggle below opens it in place. */
.sp-tm-card__quote {
    flex: 1;
    border: none;
    padding: 0;
    margin: 0 0 1.25rem;
    quotes: "\201C" "\201D";
}

.sp-tm-card__quote p {
    margin: 0;
    font-family: var(--sd-font-family-primary);
    font-style: normal; /* a global blockquote rule italicises; Outfit has no italic face, so that was a synthesised slant */
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--sd-color-primary-dark);
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sp-tm-card__quote p::before { content: open-quote; }
.sp-tm-card__quote p::after  { content: close-quote; }

.sp-tm-card.is-open .sp-tm-card__quote p {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

.sp-tm-card__more {
    align-self: flex-start;
    margin: -0.5rem 0 1.25rem;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--sd-font-family-primary);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--sd-color-cta);
}

.sp-tm-card__more[hidden] {
    display: none;
}

.sp-tm-card__more svg {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
}

.sp-tm-card.is-open .sp-tm-card__more svg {
    transform: rotate(180deg);
}

.sp-tm-card__more:hover {
    color: var(--sd-color-primary);
}

.sp-tm-card__more:focus-visible {
    outline: 2px solid var(--sd-color-cta);
    outline-offset: 3px;
    border-radius: 2px;
}

.sp-tm-card__meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sp-tm-card__name {
    font-family: var(--sd-font-family-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--sd-color-primary-dark);
}

.sp-tm-card__role {
    font-family: var(--sd-font-family-primary);
    font-size: 0.8125rem;
    line-height: 1.35;
    color: #5b6355; /* green-biased grey, 6.7:1 on white */
}

/* Project band — the whole band is the anchor. A 3:2 thumbnail at 96px shows
   the entire building; the old side rail showed a strip of cladding. */
.sp-tm-card__project {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem 1rem 1rem;
    background-color: #f7f9f4;
    border-top: 1px solid rgba(54, 69, 47, 0.08);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.25s ease;
}

.sp-tm-card__project:hover {
    background-color: #eef3e7;
}

.sp-tm-card__project:focus-visible {
    outline: 2px solid var(--sd-color-cta);
    outline-offset: -4px;
    border-radius: 6px;
}

.sp-tm-card__thumb {
    flex: none;
    width: 96px;
    aspect-ratio: 3 / 2;
    border-radius: 4px;
    overflow: hidden;
    background-color: #dfe5d8;
}

.sp-tm-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.sp-tm-card__project:hover .sp-tm-card__thumb img {
    transform: scale(1.05);
}

.sp-tm-card__ptext {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    flex: 1;
}

.sp-tm-card__ptitle {
    font-family: var(--sd-font-family-primary);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--sd-color-primary-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sp-tm-card__pcta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--sd-font-family-primary);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--sd-color-cta);
}

.sp-tm-card__pcta svg {
    width: 15px;
    height: 15px;
    flex: none;
    transition: transform 0.2s ease;
}

.sp-tm-card__project:hover .sp-tm-card__pcta svg {
    transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
    .sp-tm-card,
    .sp-tm-card__project,
    .sp-tm-card__thumb img,
    .sp-tm-card__more svg,
    .sp-tm-card__pcta svg {
        transition: none;
    }
    .sp-tm-card:hover,
    .sp-tm-card__project:hover .sp-tm-card__thumb img {
        transform: none;
    }
}

/* Whole quote, no clamp and no toggle: the testimonials page, where the
   phrase that matched the chosen theme has to be visible. */
.sp-tm-card--full .sp-tm-card__quote p {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

/* The phrase that earned the card its place under the chosen theme. */
.sp-tm-card__hl {
    color: inherit;
    background: linear-gradient(transparent 56%, rgba(141, 179, 90, 0.42) 56%);
    padding: 0 0.04em;
    border-radius: 1px;
}
