/* ============================================
   HOMEPAGE REVIEW CARDS
   The Institutional Reviews and Success Stories sections draw the same card
   Manage Reviews draws (admin-pages/css/admin-pages/shared/front-of-site.css,
   .ma-review-card): who, a sub-line, the overall rating and the date; then the
   comment, who wrote it, and a bar per metric. Minus the admin's feature toggle.
   What an admin approves is what a visitor reads.
   ============================================ */

.hr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 2rem auto 0;
}

.hr-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--card-bg);
    border: 1px solid rgba(var(--border-rgb), 0.6);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hr-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.hr-head {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.hr-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(var(--border-rgb), 0.5);
}

/* An institution's logo is a mark, not a face: square corners read better. */
.hr-avatar.hr-logo {
    border-radius: 10px;
    object-fit: contain;
    background: var(--card-bg);
    border: 1px solid rgba(var(--border-rgb), 0.6);
}

.hr-who {
    flex: 1;
    min-width: 0;
}

.hr-who h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.hr-muted {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0.15rem 0 0;
}

.hr-meta {
    text-align: right;
    white-space: nowrap;
}

.hr-stars {
    color: var(--primary-color);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.hr-stars b {
    color: var(--text-primary);
    margin-left: 0.25rem;
    letter-spacing: 0;
}

.hr-quote {
    font-style: italic;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.hr-attribution {
    margin: -0.35rem 0 0;
}

.hr-metrics {
    display: grid;
    gap: 0.35rem;
}

.hr-metric {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 90px 1.75rem;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.8rem;
}

.hr-metric-label {
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hr-metric-bar {
    height: 6px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(var(--border-rgb), 0.8);
}

.hr-metric-bar span {
    display: block;
    height: 100%;
    background: var(--primary-color);
    border-radius: 999px;
}

.hr-metric-value {
    text-align: right;
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .hr-grid {
        grid-template-columns: 1fr;
    }

    .hr-head {
        flex-wrap: wrap;
    }

    .hr-meta {
        text-align: left;
        width: 100%;
    }
}

/* The two sections' own containers set a fixed column count (and the
   institutional one with !important, from when its cards faded in and out).
   Two classes outrank one, so the review grid decides the columns. */
.professional-reviews-grid.hr-grid,
.testimonials-slider.hr-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    padding: 0 1rem;
}

@media (max-width: 480px) {
    .professional-reviews-grid.hr-grid,
    .testimonials-slider.hr-grid {
        grid-template-columns: 1fr !important;
    }
}
