/* Testimonials: public page and homepage carousel. Uses the theme variables that home.css defines under body.home. */

/* Public page */

.tm-warn {
    color: #ffd34d;
    font-size: .8rem;
}

.tm-empty {
    color: var(--dim);
    font-size: .85rem;
}

.tm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tm-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    color: var(--dim);
    font-size: .8rem;
}

.tm-pager a {
    color: var(--acc);
}

.tm-pager a:hover {
    text-decoration: underline;
}

/* Card (shared by the page and the homepage carousel) */

.tm-card {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    height: 100%;
    margin: 0;
    padding: 1rem 1.1rem;
}

.tm-card--featured {
    border-color: var(--acc);
}

.tm-card-head {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.tm-avatar {
    flex: 0 0 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid hsl(var(--avatar-hue) 75% 55%);
    border-radius: 50%;
    background: hsl(var(--avatar-hue) 65% 18%);
    color: hsl(var(--avatar-hue) 90% 78%);
    font-size: 1rem;
    font-weight: 700;
}

.tm-who {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.tm-name {
    overflow: hidden;
    color: var(--ink);
    font-size: .9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-meta {
    color: var(--dim);
    font-size: .68rem;
}

.tm-quote {
    flex: 1 1 auto;
    margin: 0;
    color: var(--ink);
    font-size: .88rem;
    line-height: 1.6;
    white-space: pre-line;
}

.tm-card-foot {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .75rem;
    color: var(--dim);
    font-size: .68rem;
}

.tm-stars {
    color: #ffd34d;
    font-size: .85rem;
    letter-spacing: .1em;
}

.tm-stars-off {
    color: var(--line);
}

.tm-head {
    margin: 0 0 1.25rem;
}

.tm-title {
    margin: 0 0 .35rem;
    color: var(--ink);
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 800;
    line-height: 1.15;
}

.tm-sub {
    max-width: 60ch;
    margin: 0;
    color: var(--dim);
    font-size: .85rem;
}

.tm-all {
    margin: 1rem 0 0;
    font-size: .85rem;
}

.tm-all a {
    color: var(--acc);
}

.tm-slide .tm-quote {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
}

.tm-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 1.5rem;
}

.tm-chip {
    padding: .35rem .8rem;
    border: 1px solid var(--line);
    color: var(--dim);
    font-size: .75rem;
    text-decoration: none;
}

.tm-chip:hover,
.tm-chip.is-active {
    border-color: var(--acc);
    color: var(--acc);
}

/* Homepage carousel */

.tm-carousel-bar {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    margin-bottom: .75rem;
}

.tm-nav-btn {
    min-width: 2.4rem;
    padding: .35rem .6rem;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--acc);
    font: inherit;
    font-size: .9rem;
    cursor: pointer;
}

.tm-nav-btn:hover:not(:disabled) {
    border-color: var(--acc);
}

.tm-nav-btn:disabled {
    opacity: .35;
    cursor: default;
}

.tm-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(min(17rem, 85vw), 22rem);
    gap: 1rem;
    margin: 0;
    padding: .25rem .25rem 1rem;
    list-style: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}

.tm-track:focus-visible,
.tm-nav-btn:focus-visible {
    outline: 2px solid var(--acc);
    outline-offset: 2px;
}

.tm-slide {
    min-width: 0;
    scroll-snap-align: start;
}

.tm-slide > .tm-card {
    height: 100%;
}

@media (prefers-reduced-motion: reduce) {
    .tm-track {
        scroll-behavior: auto;
    }
}
