/* ==========================================================================
   Testimonianze (testimonianze.php)
   Loaded after css/site.css; only tokens from site.css, classes prefixed .ts-.
   ========================================================================== */

/* Opening panel: the reviews start the page, with the inner-hero spacing and brand mesh
   (clay top right, slate bottom left) over the sage tint. */
.ts-reviews {
    padding-block: clamp(1.5rem, 1rem + 2vw, 3rem) var(--section-y);
    background:
        radial-gradient(50% 45% at 95% 0%, rgb(201 123 99 / 0.2), transparent 70%),
        radial-gradient(45% 40% at 0% 100%, rgb(95 127 140 / 0.16), transparent 70%),
        var(--c-sage-soft);
}

.ts-reviews__head {
    margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem);
}

.ts-reviews__head .stars {
    margin-bottom: var(--space-3);
}

.ts-reviews__title {
    font-size: clamp(2.375rem, 1.5rem + 3vw, 4rem);
    line-height: 1.1;
    margin-bottom: var(--space-3);
}

.ts-reviews__head .lead {
    max-width: 48rem; /* one line on desktop */
}

.ts-reviews__title em {
    padding-bottom: 0.06em; /* descender room for the italic "p" */
}

/* Reviews: a bento of five, the featured review on the dark tile spans two columns and two rows. */

.ts-bento {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-4);
    margin: 0;
    padding: 0;
    list-style: none;
}

.ts-review {
    position: relative;
    padding: clamp(1.5rem, 1.2rem + 1vw, 2.25rem);
    border-radius: var(--radius);
    background: var(--c-surface);
    box-shadow: var(--shadow-sm);
}

/* Author pinned to the bottom, so tiles in a row line up. */
.ts-review figure {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0;
}

.ts-review blockquote {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 1.125rem;
    line-height: 1.5;
    color: var(--c-ink);
    text-wrap: pretty;
}

.ts-review__by {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: auto;
    padding-top: var(--space-5);
    font-size: var(--fs-sm);
    line-height: 1.35;
    color: var(--c-ink-soft);
}

.ts-review__by strong {
    display: block;
    font-weight: 600;
    color: var(--c-ink);
}

.ts-review--clay {
    background: var(--c-secondary-soft);
}

.ts-review--slate {
    background: var(--c-tertiary-soft);
}

.ts-review--clay .monogram,
.ts-review--slate .monogram {
    background: var(--c-surface);
}

.ts-review--ink {
    grid-column: span 2;
    grid-row: span 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2rem, 1.25rem + 2.5vw, 3.5rem);
    background: var(--c-ink);
    box-shadow: var(--shadow);
}

.ts-review__mark {
    width: 52px;
    height: 52px;
    margin-bottom: var(--space-5);
    color: var(--c-secondary);
    --icon-duo: var(--c-secondary);
    --icon-duo-opacity: 0.45;
}

.ts-review--ink blockquote {
    font-size: clamp(1.5rem, 1.2rem + 1vw, 2.125rem);
    line-height: 1.35;
    color: var(--c-on-dark);
}

.ts-review--ink .ts-review__by {
    color: var(--c-on-dark-soft);
}

.ts-review--ink .ts-review__by strong {
    color: var(--c-on-dark);
}

.ts-review--ink .monogram {
    background: rgb(251 252 251 / 0.1);
    color: #e8b6a5;
}

/* Online therapy stories: the intro stays in view while the stories scroll past. */
.ts-stories__grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-7) clamp(2.5rem, 1rem + 5vw, 6rem);
    align-items: start;
}

.ts-stories__intro {
    position: sticky;
    top: calc(var(--header-h-compact) + var(--space-6));
}

.ts-stories__intro .h2 {
    margin-bottom: var(--space-4);
}

.ts-stories__intro .h2 em {
    padding-bottom: 0.06em;
}

.ts-stories__intro .lead {
    margin-bottom: var(--space-4);
}

.ts-stories__list {
    display: grid;
    gap: var(--space-4);
}

.ts-story {
    padding: clamp(1.5rem, 1.2rem + 1.2vw, 2.5rem);
    border-radius: var(--radius);
    background: var(--c-surface);
    box-shadow: var(--shadow-sm);
}

.ts-story__title {
    font-family: var(--font-serif);
    font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--c-ink);
    text-wrap: balance;
}

.ts-story__text {
    margin: var(--space-4) 0 0;
}

.ts-story__text p {
    max-width: 65ch;
    line-height: 1.75;
    color: var(--c-ink-soft);
    text-wrap: pretty;
}

.ts-story__text p + p {
    margin-top: var(--space-3);
}

/* Long stories open on five lines of the first paragraph; the whole text stays in the page
   (and visible without JS). */
.js .ts-story__text[data-clamp]:not(.is-open) p:not(:first-child) {
    display: none;
}

.js .ts-story__text[data-clamp]:not(.is-open) p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    overflow: hidden;
}

.ts-story__more {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
    margin-top: var(--space-1);
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--c-teal-strong);
    cursor: pointer;
}

/* Shown by js/site.js only: without JS the full text is already visible. */
.ts-story__more[hidden] {
    display: none;
}

.ts-story__more:hover {
    color: var(--c-ink);
}

.ts-story__more .icon {
    width: 16px;
    height: 16px;
    transition: transform var(--dur) var(--ease-out);
}

.ts-story__more[aria-expanded="true"] .icon {
    transform: rotate(180deg);
}

.ts-story__by {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--c-line);
    font-size: var(--fs-sm);
    line-height: 1.35;
    color: var(--c-ink-soft);
}

.ts-story__by strong {
    display: block;
    font-weight: 600;
    color: var(--c-ink);
}

.ts-story:nth-child(3n + 2) .monogram {
    background: var(--c-tertiary-soft);
    color: var(--c-tertiary-strong);
}

.ts-story:nth-child(3n + 3) .monogram {
    background: var(--c-sage-soft);
    color: var(--c-teal-strong);
}

.ts-note {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius);
    background: var(--c-mist-soft);
    font-size: var(--fs-sm);
    line-height: 1.55;
    color: var(--c-ink-soft);
}

.ts-note .icon {
    margin-top: 0.1em;
    color: var(--c-tertiary-strong);
}

/* Responsive */
/* Below desktop the bento keeps two columns: the featured review across the top, two pairs below
   (four columns would squeeze the short quotes into narrow towers). */
@media (max-width: 1199px) {
    .ts-bento {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ts-review--ink {
        grid-row: auto;
    }
}

@media (max-width: 1023px) {
    .ts-stories__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ts-stories__intro {
        position: static;
        max-width: 40rem;
    }
}

@media (max-width: 767px) {
    .ts-bento {
        grid-template-columns: minmax(0, 1fr);
    }

    .ts-review--ink {
        grid-column: auto;
    }

    .ts-review--ink blockquote {
        font-size: 1.3125rem;
    }
}

/* Phones: the featured quote gets the width back from the tile padding. */
@media (max-width: 599px) {
    .ts-review--ink {
        padding: var(--space-6) var(--space-5);
    }

    .ts-review__mark {
        width: 40px;
        height: 40px;
        margin-bottom: var(--space-4);
    }
}
