/* Latest Reviews block and [laatste_reviews] (includes/block-latest-reviews.php). */

/* --n columns and --g gap; on mobile (up to 48rem) the mobile values. The
   side space is padding of the block, so the cards never touch the screen
   edge; it also insets the counter and the button. */
.cmg-latest-reviews {
    --cmg-lr-n: var(--cmg-lr-columns, 3);
    --cmg-lr-g: var(--cmg-lr-gap, 0.625rem);
    box-sizing: border-box;
    inline-size: 100%;
    padding-inline: var(--cmg-lr-pad, 0);
}

.cmg-lr-counter {
    margin: 0 0 0.9375rem;
    font-size: 0.9em;
    font-style: italic;
    color: var(--cmg-lr-counter);   /* not set: inherits the text colour */
}

.cmg-lr-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: var(--cmg-lr-justify, center);
    gap: var(--cmg-lr-g);
    margin-block-end: 1.25rem;
}

.cmg-lr-review {
    box-sizing: border-box;
    flex: 0 0 calc((100% - (var(--cmg-lr-n) - 1) * var(--cmg-lr-g)) / var(--cmg-lr-n));
    min-inline-size: 0;
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    border: 0.0625rem solid var(--cmg-lr-card-border, transparent);
    border-radius: var(--cmg-lr-radius, 0.375rem);
    background: var(--cmg-lr-card-bg, transparent);
    line-height: 1.3;
}

.cmg-latest-reviews--shadow .cmg-lr-review {
    box-shadow: var(--cmg-lr-shadow-x, 0) var(--cmg-lr-shadow-y, 0.125rem) var(--cmg-lr-shadow-blur, 0.5rem) var(--cmg-lr-shadow-spread, 0) var(--cmg-lr-shadow-color, rgba(0, 0, 0, 0.1));
}

@media (max-width: 48rem) {
    .cmg-latest-reviews {
        --cmg-lr-n: var(--cmg-lr-columns-mobile, 1);
        --cmg-lr-g: var(--cmg-lr-gap-mobile, 0.625rem);
        padding-inline: var(--cmg-lr-pad-mobile, 1rem);
    }

    .cmg-lr-review--desktop {
        display: none;
    }
}

.cmg-lr-product {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--cmg-lr-link);   /* not set: inherits the text colour */
    font-weight: bold;
}

.cmg-lr-stars {
    display: block;
    color: var(--cmg-lr-star);   /* not set: inherits the text colour */
    font-size: 1.25em;
    line-height: 1.2;
    letter-spacing: 0.0625rem;
}

.cmg-lr-meta {
    margin-block-end: 0.375rem;
    color: var(--cmg-lr-meta);   /* not set: inherits the text colour */
    font-size: 0.8em;
}

.cmg-lr-name {
    text-transform: capitalize;
}

.cmg-lr-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--cmg-lr-lines, 3);
    line-clamp: var(--cmg-lr-lines, 3);
    overflow: hidden;
    color: var(--cmg-lr-text);   /* not set: inherits the text colour */
    font-size: 0.9em;
    font-style: italic;
}

.cmg-lr-more {
    margin-block-start: 0.625rem;
    text-align: center;
}

/* The look comes from the theme's button styles (wp-element-button). */
.cmg-lr-button {
    display: inline-block;
}
