.pmseo-tg-grid {
    position: relative;
}

/* Fallback (before JS has measured and positioned cards, or if JS
   fails to run at all): plain stacked column, full width. The
   moment layout() runs once, it adds pmseo-tg-masonry-ready and these
   switch to absolutely-positioned masonry columns. */
.pmseo-tg-card {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 20px;
    padding: 32px 28px 24px;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(14px) scale(0.98);
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease,
        left 0.35s ease, top 0.35s ease;
}

.pmseo-tg-grid.pmseo-tg-masonry-ready .pmseo-tg-card {
    position: absolute;
    top: 0;
    left: 0;
    margin-bottom: 0;
}

.pmseo-tg-card.pmseo-tg-in-view {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.pmseo-tg-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.pmseo-tg-text {
    margin: 0 0 20px;
    line-height: 1.6;
    white-space: pre-line;
}

.pmseo-tg-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pmseo-tg-author-pill {
    display: inline-block;
    background: #fff;
    color: inherit;
    border-radius: 999px;
    padding: 8px 18px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.pmseo-tg-toggle {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.25s ease, transform 0.2s ease;
}

.pmseo-tg-toggle:hover {
    opacity: 1;
}

.pmseo-tg-icon {
    width: 100%;
    height: 100%;
    display: flex;
}

.pmseo-tg-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: currentColor;
}

/* 1 column at 767px and under, matching the carousel's own breakpoint
   (also read by testimonials-grid.js, which needs the same number to
   decide column count for layout()). */
@media (max-width: 767px) {
    .pmseo-tg-card {
        padding: 26px 22px 20px;
    }
}
