/**
 * Reilink Verified Reviews — front-end styles.
 *
 * These rules serve the [reilink_reviews] shortcode and the
 * reilink/verified-reviews block, which render from PHP and ship no CSS of
 * their own.
 *
 * The Apex editor's apex/verified-review block embeds its own <style> in
 * post_content (see apex/app/features/_shared/verified-review-block.js) and
 * therefore overrides everything here — inline <style> in the body beats an
 * enqueued stylesheet in the head. Keep the two visually in step; that file is
 * the one to match when changing the look.
 *
 * COLOUR/SHAPE come from the Apex template tokens declared on .lp_872a20
 * (see getDefaultGutenbergContentCssForTemplate in apex/app/assets/js/helper.js).
 * Custom properties inherit, so a widget rendered inside a template group picks
 * them up automatically; the fallbacks repeat the template defaults so it still
 * looks right anywhere else. Don't reach for --wp--preset--* or the apex-base
 * theme vars — the templates deliberately don't use them.
 */

.reilink-verified-review {
    --rv-accent: var(--accent, #d97706);
    --rv-primary: var(--primary, #1e3a5f);
    --rv-text: var(--text, #0f172a);
    --rv-heading: var(--heading, #1e293b);
    --rv-border: var(--border-color, #e2e8f0);
    --rv-tint: var(--bg-tint, #f1f5f9);

    display: block;
    margin: 1.5rem 0;
    color: var(--rv-text);
}

.reilink-verified-review .rv-widget-title {
    margin: 0 0 0.75rem;
    color: var(--rv-heading);
}

/* "Leave us a review on Google" — synced from Apex site settings. */
.reilink-verified-review .rv-google-cta {
    margin: 0 0 1.25rem;
}

.reilink-verified-review .rv-google-cta a {
    color: var(--rv-accent);
    font-weight: 700;
}

/* ---- Reviews list ---- */
.reilink-verified-review .rv-summary {
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: var(--rv-tint);
    color: var(--rv-primary);
    font-size: 0.875rem;
    font-weight: 700;
}

/* Matches the templates' card grid. */
.reilink-verified-review .rv-list-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 2rem;
}

.reilink-verified-review .rv-list-empty {
    margin: 0;
    padding: 2rem;
    border: 1px dashed var(--rv-border);
    border-radius: 6px;
    text-align: center;
    opacity: 0.7;
}

/* ---- Review card: mirrors .lp_872a20_testimonial_card ---- */
/* min-width:0 + overflow-wrap: reviewers paste URLs and long unbroken strings,
   and a grid item defaults to min-content width, so without both one long word
   pushes the card past the viewport on phones.

   No height:100%, unlike the templates' testimonial card: as a grid item the row
   height is indefinite, so the percentage resolved against nothing and the cards
   overflowed the grid box. Grid stretch equalises the heights anyway, and
   space-between still pins each footer to the bottom. */
.reilink-verified-review .rv-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    padding: 2.5rem;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    text-align: left;
    overflow-wrap: anywhere;
}

.reilink-verified-review .rv-item-rating {
    color: var(--rv-accent);
    letter-spacing: 0.08em;
    line-height: 1;
}

/* Collapsed by default; the JS toggles the modifier. */
.reilink-verified-review .rv-item-quote {
    margin: 0.75rem 0 0;
    font-size: 1rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.reilink-verified-review .rv-item-quote.rv-item-quote--expanded {
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
    overflow: visible;
}

.reilink-verified-review .rv-more {
    align-self: flex-start;
    margin-top: 0.75rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--rv-accent);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.reilink-verified-review .rv-item-foot {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rv-border);
}

.reilink-verified-review .rv-item-name {
    font-style: normal;
    font-weight: 700;
    color: var(--rv-heading);
}

.reilink-verified-review .rv-item-meta {
    font-size: 0.8125rem;
    opacity: 0.7;
}

/* ---- Submission form ---- */
.reilink-verified-review .rv-form {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rv-border);
    max-width: 640px;
}

.reilink-verified-review .rv-form-title {
    margin: 0 0 1rem;
    color: var(--rv-heading);
}

.reilink-verified-review .rv-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.reilink-verified-review .rv-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.reilink-verified-review .rv-field > span {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.reilink-verified-review .rv-req {
    color: #dc2626;
}

.reilink-verified-review .rv-field input,
.reilink-verified-review .rv-field select,
.reilink-verified-review .rv-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--rv-border);
    border-radius: 6px;
    background: #fff;
    color: var(--rv-text);
    font: inherit;
    font-size: 1rem;
    font-weight: 400;
}

/* An outline rather than a box-shadow ring, so the focus colour can be the
   accent token directly instead of a hardcoded rgba() of it. */
.reilink-verified-review .rv-field input:focus,
.reilink-verified-review .rv-field select:focus,
.reilink-verified-review .rv-field textarea:focus {
    outline: 2px solid var(--rv-accent);
    outline-offset: 2px;
    border-color: var(--rv-accent);
}

.reilink-verified-review .rv-field textarea {
    resize: vertical;
    min-height: 7rem;
}

/* Shaped like the templates' CTA buttons. */
.reilink-verified-review .rv-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border: none;
    border-radius: 6px;
    background: var(--rv-accent);
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: filter 0.18s ease, transform 0.18s ease;
}

.reilink-verified-review .rv-submit:hover {
    filter: brightness(0.88);
    transform: translateY(-2px);
}

.reilink-verified-review .rv-submit:disabled {
    opacity: 0.7;
    cursor: default;
    transform: none;
}

@media (max-width: 640px) {
    .reilink-verified-review .rv-item {
        padding: 1.5rem;
    }

    .reilink-verified-review .rv-form-row {
        grid-template-columns: 1fr;
    }
}
