/*
 * Humanitas Portal Ratings — public styles.
 * Class names mirror the portal landing page (hcc-landing.css) so the badge and
 * review cards look consistent across portal + WordPress. Self-contained: the
 * --humanitas-* custom properties fall back to literal values when the theme
 * does not define them.
 */

/* ─── Rating badge ─── */
.hcc-rating-badge,
a.hcc-rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 14px;
    padding: 7px 14px;
    background: #fff;
    border: 1px solid var(--humanitas-border, rgba(0, 0, 0, 0.08));
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--humanitas-text, #212121);
    white-space: nowrap;
}

.hcc-rating-badge:hover,
.hcc-rating-badge:focus {
    text-decoration: none;
    color: var(--humanitas-text, #212121);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    outline: 2px solid var(--humanitas-primary, #1e7393);
    outline-offset: 2px;
}

.hcc-rating-badge--compact {
    padding: 4px 10px;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.hcc-rating-star {
    color: #f5b50a;
    line-height: 1;
}

.hcc-rating-score {
    font-weight: 700;
    color: var(--humanitas-text, #212121);
}

.hcc-rating-sep {
    color: var(--humanitas-gray, #616161);
}

.hcc-rating-count {
    color: var(--humanitas-gray, #616161);
    font-weight: 500;
}

/* ─── Reviews block ─── */
.hcc-reviews {
    margin: 0 0 24px;
}

/* Aggregate header: ★ rating · count + read-all / write-a-review links */
.hcc-reviews-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin: 0 0 16px;
}

.hcc-reviews-source-label {
    font-size: 0.8rem;
    color: var(--humanitas-gray, #616161);
    margin: 0;
}

.hcc-reviews-header .hcc-rating-badge {
    margin: 0;
}

.hcc-reviews-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
}

.hcc-reviews-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--humanitas-primary, #1e7393);
    text-decoration: none;
}

.hcc-reviews-link:hover,
.hcc-reviews-link:focus {
    text-decoration: underline;
}

.hcc-review-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 700px) {
    .hcc-review-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.hcc-review {
    background: #fff;
    border: 1px solid var(--humanitas-border, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
}

.hcc-review-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.hcc-review-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.hcc-review-photo--initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--humanitas-primary, #1e7393);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
}

.hcc-review-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hcc-review-author {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--humanitas-text, #212121);
    text-decoration: none;
}

a.hcc-review-author:hover,
a.hcc-review-author:focus {
    text-decoration: underline;
    color: var(--humanitas-primary, #1e7393);
}

.hcc-review-stars {
    color: #f5b50a;
    font-size: 0.85rem;
    line-height: 1.2;
    letter-spacing: 1px;
}

.hcc-review-time,
.hcc-review-role {
    font-size: 0.78rem;
    color: var(--humanitas-gray, #616161);
}

.hcc-review-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--humanitas-text, #212121);
    margin: 0 0 12px;
}

/* Clamp added by JS only — without JS the full text shows (compliance-safe). */
.hcc-review-text--clamped {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hcc-review-more {
    align-self: flex-start;
    background: none;
    border: none;
    padding: 0;
    margin: 0 0 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--humanitas-primary, #1e7393);
    cursor: pointer;
}

.hcc-review-more:hover,
.hcc-review-more:focus {
    text-decoration: underline;
}

.hcc-review-source {
    margin-top: auto;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--humanitas-gray, #616161);
    text-decoration: none;
}

.hcc-review-source:hover,
.hcc-review-source:focus {
    text-decoration: underline;
    color: var(--humanitas-primary, #1e7393);
}
