/* ══════════════════════════════════════════════════════════
 *  TESTIMONIALS PAGE — Advanced Layout
 *  Prefix: tst-
 *  Flex-column masonry with JS distribution & infinite scroll
 * ══════════════════════════════════════════════════════════ */

/* ── Hero ───────────────────────────────────────────────── */
.tst-hero {
    position: relative;
    padding: 6rem 0 4rem;
    overflow: hidden;
    background: linear-gradient(135deg, var(--tsw-ink, #1a2332) 0%, #1e3a2a 100%);
    color: #fff;
}

.tst-hero-shapes { position: absolute; inset: 0; pointer-events: none; }

.tst-hero .tsw-shape--1 {
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(94,142,62,.15), transparent 70%);
    top: -100px; right: -100px;
    border-radius: 50%;
}
.tst-hero .tsw-shape--2 {
    position: absolute;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(94,142,62,.1), transparent 70%);
    bottom: -80px; left: -80px;
    border-radius: 50%;
}
.tst-hero .tsw-shape--3 {
    position: absolute;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,.03), transparent 70%);
    top: 40%; left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

/* Badge */
.tst-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: rgba(94,142,62,.15);
    border: 1px solid rgba(94,142,62,.25);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tsw-green, #5e8e3e);
    margin-bottom: 1.5rem;
}

/* ── Hero Title FIX: explicit white color ─────────────── */
.tst-hero-title {
    font-family: var(--tsw-font-display, 'Qilka', serif);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: #fff;
}

/* Highlighted word inside hero title */
.tst-hero-title .tsw-highlight {
    color: var(--tsw-green-bright, #95bf47);
}

/* Subtitle */
.tst-hero-subtitle {
    font-size: 1.15rem;
    color: rgba(255,255,255,.75);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Hero Stats */
.tst-hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}
.tst-stat {
    text-align: center;
}
.tst-stat-value {
    display: block;
    font-family: var(--tsw-font-display, 'Qilka', serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--tsw-green, #5e8e3e);
}
.tst-stat-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,.6);
}


/* ══════════════════════════════════════════════════════════
 *  MASONRY GRID — Flex Column Layout
 *  JS distributes cards to shortest column for true masonry.
 *  CSS Grid fallback for no-JS environments.
 * ══════════════════════════════════════════════════════════ */
.tst-grid-section {
    padding: 4rem 0;
    background: var(--tsw-cloud, #f6f8f4);
}

/* ── No-JS fallback: CSS Grid row-by-row ── */
.tst-masonry {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: start;
}

/* ── JS-enhanced: Flex column layout ── */
.tst-masonry.tst-masonry--ready {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.tst-masonry-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}


/* ── Testimonial Card ────────────────────────────────────── */
.tst-card {
    width: 100%;
}

.tst-card-inner {
    background: #fff;
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 2px 16px rgba(0,0,0,.04);
    border: 1px solid rgba(0,0,0,.06);
    transition: transform .35s cubic-bezier(.25,.46,.45,.94),
                box-shadow .35s cubic-bezier(.25,.46,.45,.94),
                border-color .35s ease;
}
.tst-card-inner:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0,0,0,.1);
    border-color: rgba(94,142,62,.15);
}

/* Quote icon */
.tst-quote-icon {
    margin-bottom: 0.75rem;
}
.tst-quote-icon i {
    font-size: 2rem;
    color: var(--tsw-green, #5e8e3e);
    opacity: 0.3;
}

/* Stars */
.tst-stars {
    display: flex;
    gap: 0.15rem;
    margin-bottom: 1rem;
}
.tst-stars i {
    font-size: 0.9rem;
    color: #f0ad4e;
}
.tst-stars .bi-star {
    color: #ddd;
}

/* Testimonial text */
.tst-text {
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--tsw-graphite, #4a5568);
    margin: 0 0 1.25rem;
    border: 0;
    padding: 0;
}
.tst-text p {
    margin: 0 0 0.75rem;
}
.tst-text p:last-child {
    margin-bottom: 0;
}

/* Project tag */
.tst-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(94,142,62,.08);
    color: var(--tsw-green, #5e8e3e);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Author */
.tst-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,.06);
}

.tst-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.tst-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tsw-green, #5e8e3e) 0%, #4a7a2e 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.tst-author-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.tst-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--tsw-ink, #1a2332);
}

.tst-role {
    font-size: 0.8rem;
    color: var(--tsw-graphite, #4a5568);
}


/* ══════════════════════════════════════════════════════════
 *  CARD REVEAL ANIMATIONS
 *  IntersectionObserver adds .tst-card--visible per card
 * ══════════════════════════════════════════════════════════ */

/* Initial state — hidden */
.tst-card--reveal {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
}

/* Visible state — smooth entrance */
.tst-card--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity .55s cubic-bezier(.25,.46,.45,.94),
                transform .55s cubic-bezier(.25,.46,.45,.94);
}

/* AJAX-loaded card entrance (backwards compat) */
.tst-card--entering {
    opacity: 0;
    transform: translateY(20px);
    animation: tstFadeIn .5s ease forwards;
}

@keyframes tstFadeIn {
    to { opacity: 1; transform: translateY(0); }
}


/* ══════════════════════════════════════════════════════════
 *  LOADING / END STATES
 * ══════════════════════════════════════════════════════════ */
.tst-loader {
    text-align: center;
    padding: 2rem 0;
}
.tst-loader-text {
    margin-top: 0.75rem;
    color: var(--tsw-graphite, #4a5568);
    font-size: 0.9rem;
}

/* Shimmer skeleton placeholder */
.tst-skeleton {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 0;
}
.tst-skeleton-card {
    flex: 1;
    height: 220px;
    border-radius: 16px;
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: tstShimmer 1.5s ease-in-out infinite;
}

@keyframes tstShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.tst-end-msg {
    text-align: center;
    padding: 2rem 0;
    color: var(--tsw-graphite, #4a5568);
}
.tst-end-msg i {
    font-size: 1.5rem;
    color: var(--tsw-green, #5e8e3e);
    display: block;
    margin-bottom: 0.5rem;
}
.tst-end-msg p {
    margin: 0;
    font-size: 0.9rem;
}

/* Scroll sentinel — invisible trigger for IntersectionObserver */
.tst-sentinel {
    height: 1px;
    margin-top: -1px;
}


/* ══════════════════════════════════════════════════════════
 *  CTA SECTION
 * ══════════════════════════════════════════════════════════ */
.tst-cta {
    padding: 5rem 0;
    background: #fff;
}
.tst-cta-title {
    font-family: var(--tsw-font-display, 'Qilka', serif);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    color: var(--tsw-ink, #1a2332);
    margin-bottom: 0.75rem;
}
.tst-cta-desc {
    color: var(--tsw-graphite, #4a5568);
    font-size: 1.05rem;
    max-width: 550px;
    margin: 0 auto;
}

.tst-btn-primary {
    background: var(--tsw-green, #5e8e3e);
    color: #fff;
    border: 2px solid var(--tsw-green, #5e8e3e);
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all .3s ease;
}
.tst-btn-primary:hover {
    background: var(--tsw-forest, #4a7a2e);
    border-color: var(--tsw-forest, #4a7a2e);
    color: #fff;
    transform: translateY(-2px);
}

.tst-btn-outline {
    background: transparent;
    color: var(--tsw-ink, #1a2332);
    border: 2px solid rgba(0,0,0,.15);
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all .3s ease;
}
.tst-btn-outline:hover {
    border-color: var(--tsw-green, #5e8e3e);
    color: var(--tsw-green, #5e8e3e);
    transform: translateY(-2px);
}


/* ══════════════════════════════════════════════════════════
 *  RESPONSIVE
 * ══════════════════════════════════════════════════════════ */

/* Tablet: 2 columns */
@media (max-width: 991.98px) {
    .tst-masonry:not(.tst-masonry--ready) {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 767.98px) {
    .tst-hero { padding: 4rem 0 3rem; }
    .tst-grid-section { padding: 3rem 0; }

    .tst-masonry:not(.tst-masonry--ready) {
        grid-template-columns: 1fr;
    }

    .tst-hero-stats {
        gap: 1.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    .tst-stat {
        flex: 0 0 40%;
    }
    .tst-stat-value {
        font-size: 1.5rem;
    }

    .tst-cta { padding: 3rem 0; }

    .tst-skeleton { flex-direction: column; }
    .tst-skeleton-card { height: 160px; }
}

/* Small mobile */
@media (max-width: 575.98px) {
    .tst-hero { padding: 3rem 0 2rem; }
    .tst-hero-title { font-size: 1.75rem; }

    .tst-card-inner { padding: 1.25rem; }
}
