/* ============================================================
   Calgary Games: "Reviews summary" block (calgarygames-reviews-home.php).
   Loaded only on pages that contain the block.

   Same width as the How to Order block above it on the home page; the
   review cards use the guide-card look (white, red top edge). Rules use
   two or three classes so they win over the theme's general rules for
   headings, lists, figures and quotes in page text.
   ============================================================ */

/* The space below is the section's own: the theme sets the top margin of
   the teal "Looking for Something Specific?" band that follows to 0. */
.cg-reviews-home {
    max-width: 780px;
    margin: 0 auto 3rem;
    text-align: center;
}
.cg-reviews-home .cg-reviews-home__title {
    margin: 0 0 0.4rem;
}
.cg-reviews-home .cg-reviews-home__summary,
.cg-reviews-home .cg-reviews-home__invite {
    margin: 0 0 1.25rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--cg-text-light, #555555);
}
.cg-reviews-home .cg-reviews-home__score {
    font-weight: 700;
    color: var(--cg-dark, #1B1B2F);
}
/* On a narrow screen "from 12 reviews" moves to the next line whole. */
.cg-reviews-home .cg-reviews-home__score,
.cg-reviews-home .cg-reviews-home__count {
    white-space: nowrap;
}

/* Stars: one star shape repeated five times and filled to the rating
   (--cg-stars, set on the element), so 4.8 shows four whole stars and
   most of the fifth. Same amber as the stars on the Reviews page. They
   are decorative: the rating is always written out beside them, so
   browsers without mask support simply leave them out. */
.cg-reviews-home .cg-reviews-home__stars {
    display: none;
}
@supports ((mask-repeat: repeat-x) or (-webkit-mask-repeat: repeat-x)) {
    .cg-reviews-home .cg-reviews-home__stars {
        --cg-star-size: 1.2em;
        display: inline-block;
        width: calc(var(--cg-star-size) * 5);
        height: var(--cg-star-size);
        margin-right: 0.15em;
        vertical-align: -0.22em;
        background: linear-gradient(90deg, #FFB900 var(--cg-stars, 100%), #D5D7DB var(--cg-stars, 100%));
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2.15L11.93 8.09L18.18 8.09L13.12 11.77L15.05 17.71L10 14.04L4.95 17.71L6.88 11.77L1.82 8.09L8.07 8.09Z'/%3E%3C/svg%3E");
        -webkit-mask-repeat: repeat-x;
        -webkit-mask-position: left center;
        -webkit-mask-size: var(--cg-star-size) var(--cg-star-size);
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2.15L11.93 8.09L18.18 8.09L13.12 11.77L15.05 17.71L10 14.04L4.95 17.71L6.88 11.77L1.82 8.09L8.07 8.09Z'/%3E%3C/svg%3E");
        mask-repeat: repeat-x;
        mask-position: left center;
        mask-size: var(--cg-star-size) var(--cg-star-size);
    }
}

/* ---------- The newest reviews ---------- */

/* One card sits in the middle; two sit side by side, and stack on phones. */
.cg-reviews-home .cg-reviews-home__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
}
.cg-reviews-home .cg-reviews-home__list .cg-reviews-home__item {
    flex: 1 1 260px;
    max-width: 380px;
    margin: 0;
    padding: 0;
}
.cg-reviews-home .cg-reviews-home__list .cg-reviews-home__review {
    box-sizing: border-box;
    height: 100%;
    margin: 0;
    padding: 1rem 1.1rem 1.05rem;
    text-align: left;
    background: #fff;
    border: 1px solid #e2e4e8;
    border-top: 3px solid var(--cg-red, #E41919);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.cg-reviews-home .cg-reviews-home__review .cg-reviews-home__rating {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    line-height: 1;
}
.cg-reviews-home .cg-reviews-home__review .cg-reviews-home__quote {
    margin: 0 0 0.6rem;
    padding: 0;
    border: 0;
    background: none;
    font-size: 0.98rem;
    font-style: normal;
    line-height: 1.55;
    color: var(--cg-text, #1A1A1A);
    overflow-wrap: anywhere;
}
.cg-reviews-home .cg-reviews-home__review .cg-reviews-home__quote p {
    margin: 0;
}
.cg-reviews-home .cg-reviews-home__review .cg-reviews-home__quote p::before {
    content: open-quote;
}
.cg-reviews-home .cg-reviews-home__review .cg-reviews-home__quote p::after {
    content: close-quote;
}
.cg-reviews-home .cg-reviews-home__review .cg-reviews-home__name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cg-text-light, #555555);
    overflow-wrap: anywhere;
}
.cg-reviews-home .cg-reviews-home__review .cg-reviews-home__name::before {
    content: "\2014\00a0";
}

/* ---------- Links ---------- */

.cg-reviews-home .cg-reviews-home__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem 1.5rem;
}
.cg-reviews-home .cg-reviews-home__links .cg-reviews-home__all {
    font-weight: 600;
}
.cg-reviews-home .cg-reviews-home__links .wp-block-button {
    display: inline-block;
    margin: 0;
}
.cg-reviews-home .cg-reviews-home__links .wp-block-button__link {
    display: inline-block;
}
.cg-reviews-home .cg-reviews-home__links a:focus-visible {
    outline: 3px solid var(--cg-teal, #2E97AF);
    outline-offset: 3px;
}

@media (max-width: 767px) {
    .cg-reviews-home {
        margin: 0 0 2.5rem;
    }
}
