/* =============================================================================
   Blocco "Recensioni Google" (page builder, tutti i siti)
   Template: views/partials/_recensioni_google.twig — JS: recensioni.js
   Colori dal blocco: --rg-sfondo (sezione), --rg-stella (stelle).
   ============================================================================= */
.rg {
    padding: 40px 16px;
    background: var(--rg-sfondo, transparent);
    color: #1f2937;
}
.rg-dentro { max-width: 1180px; margin: 0 auto; }
.rg-titolo { margin: 0 0 6px; text-align: center; font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; }
.rg-sotto { margin: 0 auto 18px; max-width: 720px; text-align: center; color: #6b7280; }

/* Il riepilogo: giudizio, stelle, voto, totale e Google (sempre i dati di Google) */
.rg-riepilogo { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0 0 28px; text-align: center; }
.rg-giudizio { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.rg-riga-voto { display: flex; align-items: center; gap: 10px; margin: 0; }
.rg-voto { font-size: 14px; }
.rg-totale { margin: 0; font-size: 12px; color: #6b7280; }
/* "Google Maps": l'attribuzione chiesta da Google (testo non modificato, Roboto o simile, grigio) */
.rg-attribuzione { margin-top: 4px; color: #5e5e5e; font-family: Roboto, Arial, sans-serif; font-size: 16px; font-weight: 400; text-decoration: none; }
.rg-attribuzione:hover { text-decoration: underline; }
.rg-attribuzione-fondo { margin: 18px 0 0; text-align: center; }

/* Le stelle: una striscia colorata fino alla percentuale (--pieno), ritagliata
   a forma di 5 stelle (mask). Funziona anche con le mezze stelle (4,5) */
.rg-stelle {
    --rg-forma: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6l2.85 5.95 6.55.85-4.8 4.55 1.2 6.5L12 17.25l-5.8 3.2 1.2-6.5-4.8-4.55 6.55-.85z'/%3E%3C/svg%3E");
    display: inline-block;
    flex: none;
    width: 90px;
    height: 18px;
    background: linear-gradient(90deg, var(--rg-stella, #fbbc04) var(--pieno, 0%), #dadce0 var(--pieno, 0%));
    -webkit-mask: var(--rg-forma) repeat-x left center / 18px 18px;
    mask: var(--rg-forma) repeat-x left center / 18px 18px;
}
.rg-stelle--grandi { width: 130px; height: 26px; -webkit-mask-size: 26px 26px; mask-size: 26px 26px; }

/* Le card: automatico = quante ne stanno; con la scelta del blocco dal
   telefono una, dal tablet al massimo due, dal computer quante scelte */
.rg-griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 20px; }
.rg-griglia.rg-per-riga-1,
.rg-griglia.rg-per-riga-2,
.rg-griglia.rg-per-riga-3,
.rg-griglia.rg-per-riga-4 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) {
    .rg-griglia.rg-per-riga-2,
    .rg-griglia.rg-per-riga-3,
    .rg-griglia.rg-per-riga-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .rg-griglia.rg-per-riga-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .rg-griglia.rg-per-riga-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.rg-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}
.rg-card-testa { display: flex; align-items: center; gap: 12px; width: 100%; }
.rg-avatar {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    background: #9ca3af;
}
.rg-avatar--c0 { background: #ea4335; }
.rg-avatar--c1 { background: #4285f4; }
.rg-avatar--c2 { background: #34a853; }
.rg-avatar--c3 { background: #f29900; }
.rg-avatar--c4 { background: #9334e6; }
.rg-avatar--c5 { background: #00897b; }
.rg-avatar--c6 { background: #e8710a; }
.rg-avatar--c7 { background: #5f6368; }
.rg-chi { display: flex; flex-direction: column; min-width: 0; }
.rg-autore { overflow: hidden; color: #1f2937; font-size: 14px; font-weight: 700; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
a.rg-autore:hover { text-decoration: underline; }
.rg-quando { font-size: 12px; color: #6b7280; }
.rg-apri {
    position: relative;
    flex: none;
    width: 20px;
    height: 20px;
    margin-left: auto;
    border-radius: 4px;
    opacity: .55;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E") no-repeat center / 16px 16px;
}
.rg-apri:hover { opacity: 1; }
.rg-vis-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
/* Il testo: 5 righe, poi "Leggi tutto" (recensioni.js lo mostra solo se serve) */
.rg-testo {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.55;
    color: #374151;
    overflow-wrap: anywhere;
    white-space: pre-line;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    line-clamp: 5;
}
.rg-testo.is-aperto { display: block; -webkit-line-clamp: unset; line-clamp: none; }
.rg-leggi {
    padding: 0;
    border: 0;
    background: none;
    color: #1a73e8;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.rg-leggi[hidden] { display: none; }
.rg-leggi:hover { text-decoration: underline; }

/* L'invito a lasciare una recensione e la fonte */
.rg-invito { margin: 28px 0 0; text-align: center; }
.rg-invito-bottone {
    display: inline-block;
    padding: 13px 24px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    color: #1f2937;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
    transition: box-shadow .2s ease, transform .2s ease;
}
.rg-invito-bottone:hover { box-shadow: 0 4px 16px rgba(15, 23, 42, .14); transform: translateY(-1px); }
.rg-fonte { margin: 14px auto 0; max-width: 720px; text-align: center; font-size: 12px; color: #6b7280; }
.rg-fonte a { color: inherit; }
/* Nella colonna laterale: meno spazio intorno */
.rg--colonna { padding: 0; }
.rg--colonna .rg-titolo { font-size: 18px; text-align: left; }
.rg--colonna .rg-griglia { gap: 12px; }
@media (prefers-reduced-motion: reduce) {
    .rg-invito-bottone { transition: none; }
}
