/**
 * Recenze | richta.cz - mod_richta_reviews
 *
 * Two styles: .rr-style-google (classic Google look) and .rr-style-modern.
 * Units: rem for type and spacing, px only for hairlines, outlines and icons.
 * Override: copy to media/templates/site/<template>/css/mod_richta_reviews/reviews.css
 * or change the custom properties (--rr-...) in your template CSS.
 */

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */

.rr-reviews {
    --rr-gap: 1rem;
    --rr-star-on: #fbbc04;
    --rr-star-off: #dadce0;
    --rr-star-size: 14px;
    --rr-avatar-size: 2.5rem;

    container: rr / inline-size;
    font-family: var(--rr-font);
    color: var(--rr-text);
}

.rr-reviews.rr-font-inherit {
    font-family: inherit;
}

.rr-reviews *,
.rr-reviews *::before,
.rr-reviews *::after {
    box-sizing: border-box;
}

/* Visible columns follow the width of the module, not of the screen. */
.rr-reviews .rr-body {
    --rr-vis: var(--rr-cols, 3);
}

@container rr (max-width: 899px) {
    .rr-reviews .rr-body {
        --rr-vis: var(--rr-cols-m, 3);
    }
}

@container rr (max-width: 639px) {
    .rr-reviews .rr-body {
        --rr-vis: var(--rr-cols-s, 2);
    }
}

@container rr (max-width: 439px) {
    .rr-reviews .rr-body {
        --rr-vis: 1;
    }
}

/* Grid */
.rr-reviews.rr-is-grid .rr-list {
    display: grid;
    grid-template-columns: repeat(var(--rr-vis), minmax(0, 1fr));
    gap: var(--rr-gap);
    align-items: start;
}

/* Equal height: every card as tall as the tallest one. */
.rr-reviews.rr-is-grid.rr-equal .rr-list {
    align-items: stretch;
    grid-auto-rows: 1fr;
}

/* Carousel: native horizontal scrolling with snapping (works with touch). */
.rr-reviews.rr-is-carousel .rr-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (var(--rr-vis) - 1) * var(--rr-gap)) / var(--rr-vis));
    gap: var(--rr-gap);
    align-items: stretch;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 0.25rem 0.125rem 1rem;
    margin: -0.25rem -0.125rem -1rem;
}

.rr-reviews.rr-is-carousel .rr-list::-webkit-scrollbar {
    display: none;
}

@container rr (max-width: 439px) {
    /* Show a part of the next card, so it is obvious the list can be swiped. */
    .rr-reviews.rr-is-carousel .rr-list {
        grid-auto-columns: 86%;
    }
}

.rr-reviews.rr-is-carousel .rr-card {
    scroll-snap-align: start;
}

.rr-reviews .rr-list:focus-visible {
    outline: 2px solid var(--rr-accent);
    outline-offset: 0.25rem;
}

/* Card */
.rr-reviews .rr-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
}

.rr-reviews .rr-avatar {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--rr-avatar-size);
    height: var(--rr-avatar-size);
    border-radius: 50%;
    color: #fff;
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1;
    text-transform: uppercase;
    user-select: none;
}

.rr-reviews .rr-avatar-img {
    display: block;
    object-fit: cover;
    background: #e8eaed;
}

.rr-reviews .rr-author {
    overflow-wrap: anywhere;
}

.rr-reviews a.rr-author,
.rr-reviews a.rr-source {
    color: inherit;
    text-decoration: none;
}

.rr-reviews a.rr-author:hover,
.rr-reviews a.rr-source:hover {
    text-decoration: underline;
}

/* Stars */
.rr-reviews .rr-stars {
    display: inline-flex;
    gap: 1px;
    line-height: 0;
}

.rr-reviews .rr-star-wrap {
    flex: 0 0 auto;
    display: inline-flex;
}

.rr-reviews .rr-star {
    display: block;
    width: var(--rr-star-size);
    height: var(--rr-star-size);
    fill: var(--rr-star-off);
}

.rr-reviews .rr-star-wrap.is-on .rr-star {
    fill: var(--rr-star-on);
}

.rr-reviews .rr-stars-partial {
    position: relative;
}

.rr-reviews .rr-stars-base,
.rr-reviews .rr-stars-fill {
    display: inline-flex;
    gap: inherit;
}

.rr-reviews .rr-stars-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    overflow: hidden;
    white-space: nowrap;
}

/* Text and "More" (without JavaScript the whole text is visible) */
.rr-reviews .rr-text {
    margin: 0;
    overflow-wrap: break-word;
}

.rr-reviews .rr-ellipsis,
.rr-reviews .rr-more {
    display: none;
}

.rr-reviews.rr-js .rr-text:not(.is-open) .rr-ellipsis {
    display: inline;
}

.rr-reviews.rr-js .rr-text:not(.is-open) .rr-rest {
    display: none;
}

.rr-reviews.rr-js .rr-text:not(.is-open) .rr-more {
    display: inline;
}

.rr-reviews .rr-more {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 500;
    color: var(--rr-accent);
    cursor: pointer;
}

.rr-reviews .rr-more:hover,
.rr-reviews .rr-more:focus-visible {
    text-decoration: underline;
}

/* Related link (case study, service...) */
.rr-reviews .rr-related {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
}

.rr-reviews .rr-related a {
    color: var(--rr-accent);
    text-decoration: none;
}

.rr-reviews .rr-related a:hover {
    text-decoration: underline;
}

.rr-reviews .rr-nowrap {
    white-space: nowrap;
}

/* The arrow stays right behind the last word, also when the link wraps. */
.rr-reviews .rr-arrow {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 0.25rem;
    vertical-align: -3px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.rr-reviews .rr-related a:hover .rr-arrow {
    transform: translateX(2px);
}

/* Summary */
.rr-reviews .rr-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    margin: 0 0 1.25rem;
}

.rr-reviews .rr-score {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rr-reviews .rr-score-detail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rr-reviews .rr-average {
    line-height: 1;
}

.rr-reviews .rr-count a {
    color: inherit;
}

.rr-reviews .rr-write {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    white-space: nowrap;
}

/* Carousel controls */
.rr-reviews .rr-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.rr-reviews .rr-controls[hidden] {
    display: none;
}

.rr-reviews .rr-dots {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
}

.rr-reviews .rr-dot-btn {
    width: 0.5rem;
    height: 0.5rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--rr-dot);
    cursor: pointer;
    transition: width 0.25s ease, background-color 0.25s ease;
}

.rr-reviews .rr-dot-btn[aria-current="true"] {
    background: var(--rr-accent);
}

.rr-reviews .rr-buttons {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.rr-reviews .rr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    color: var(--rr-text);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.rr-reviews .rr-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.rr-reviews .rr-pause .rr-icon-play,
.rr-reviews .rr-pause.is-paused .rr-icon-pause {
    display: none;
}

.rr-reviews .rr-pause.is-paused .rr-icon-play {
    display: block;
}

.rr-reviews .rr-btn:focus-visible,
.rr-reviews .rr-dot-btn:focus-visible,
.rr-reviews .rr-write:focus-visible,
.rr-reviews .rr-more:focus-visible,
.rr-reviews .rr-related a:focus-visible,
.rr-reviews a.rr-author:focus-visible {
    outline: 2px solid var(--rr-accent);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Style: classic Google                                               */
/* ------------------------------------------------------------------ */

.rr-reviews.rr-style-google {
    --rr-font: Roboto, Arial, sans-serif;
    --rr-bg: #fff;
    --rr-border: #dadce0;
    --rr-text: #202124;
    --rr-muted: #70757a;
    --rr-accent: #1a73e8;
    --rr-dot: #dadce0;
}

.rr-style-google .rr-card {
    background: var(--rr-card-bg, var(--rr-bg));
    border: 1px solid var(--rr-border);
    border-radius: var(--rr-card-radius, 0.5rem);
    padding: 1rem;
}

.rr-style-google .rr-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.5rem;
}

.rr-style-google .rr-author {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
}

.rr-style-google .rr-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.5rem;
}

.rr-style-google .rr-date {
    font-size: 0.75rem;
    line-height: 1rem;
    color: var(--rr-muted);
}

.rr-style-google .rr-text {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.rr-style-google .rr-related {
    margin-top: 0.75rem;
}

.rr-style-google .rr-average {
    font-size: 2.25rem;
    font-weight: 400;
}

.rr-style-google .rr-summary .rr-stars {
    --rr-star-size: 18px;
}

.rr-style-google .rr-count {
    font-size: 0.875rem;
    color: var(--rr-muted);
}

.rr-style-google .rr-count a {
    color: var(--rr-accent);
    text-decoration: none;
}

.rr-style-google .rr-count a:hover {
    text-decoration: underline;
}

.rr-style-google .rr-write {
    padding: 0.5rem 1rem;
    border: 1px solid var(--rr-btn-bg, var(--rr-border));
    border-radius: var(--rr-btn-radius, 999px);
    background: var(--rr-btn-bg, var(--rr-bg));
    color: var(--rr-btn-color, var(--rr-accent));
    font-size: 0.875rem;
    font-weight: 500;
}

.rr-style-google .rr-write:hover {
    background: color-mix(in srgb, var(--rr-btn-bg, #fff) 94%, #000);
    color: var(--rr-btn-color, var(--rr-accent));
}

.rr-style-google .rr-btn {
    border: 1px solid var(--rr-border);
    background: var(--rr-bg);
}

.rr-style-google .rr-btn:hover {
    background: #f1f3f4;
}

/* ------------------------------------------------------------------ */
/* Style: modern                                                       */
/* ------------------------------------------------------------------ */

.rr-reviews.rr-style-modern {
    --rr-font: "Google Sans", Roboto, Arial, sans-serif;
    --rr-surface: #f4f4f4;
    --rr-surface-hover: #fff;
    --rr-text: #1f2328;
    --rr-muted: #6b7280;
    --rr-line: rgba(15, 23, 42, 0.08);
    --rr-accent: #111827;
    --rr-dot: #d1d5db;
    --rr-star-size: 18px;
    --rr-gap: 1.25rem;
}

.rr-style-modern .rr-card {
    container: rrcard / inline-size;
    gap: 1rem;
    padding: clamp(1.125rem, 2.4cqi, 1.5rem);
    border: 1px solid transparent;
    border-radius: var(--rr-card-radius, 1.25rem);
    background: var(--rr-card-bg, var(--rr-surface));
    transition: background-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.rr-style-modern .rr-card:hover {
    background: var(--rr-surface-hover);
    border-color: var(--rr-line);
    box-shadow: 0 14px 32px -18px rgba(15, 23, 42, 0.35);
    transform: translateY(-2px);
}

/* Same text metrics as reviews on Google. */
.rr-style-modern .rr-text {
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.25rem;
}

/* "More" takes the size, spacing and line height of the text, only the weight differs. */
.rr-style-modern .rr-more {
    font-size: inherit;
    font-weight: 500;
    letter-spacing: inherit;
    line-height: inherit;
}

.rr-style-modern .rr-text-empty {
    color: var(--rr-muted);
    font-style: italic;
}

.rr-style-modern .rr-foot {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--rr-line);
}

.rr-style-modern .rr-who {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.rr-style-modern .rr-author,
.rr-style-modern .rr-sub {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rr-style-modern .rr-author {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: normal;
}

.rr-style-modern .rr-sub {
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--rr-muted);
}

.rr-style-modern .rr-dot {
    margin: 0 0.25rem;
}

/* Narrow card: hide the "· Google" label rather than cutting it (the summary names the source). */
@container rrcard (max-width: 229px) {
    .rr-style-modern .rr-sub .rr-dot,
    .rr-style-modern .rr-sub .rr-source {
        display: none;
    }
}

.rr-style-modern .rr-summary {
    margin-bottom: 1.75rem;
}

.rr-style-modern .rr-average {
    font-size: 3.25rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.rr-style-modern .rr-summary .rr-stars {
    --rr-star-size: 20px;
}

.rr-style-modern .rr-score-detail {
    gap: 0;
}

.rr-style-modern .rr-count {
    font-size: 0.9375rem;
    color: var(--rr-muted);
}

.rr-style-modern .rr-count a {
    text-decoration: underline;
    text-decoration-color: var(--rr-line);
    text-underline-offset: 3px;
}

.rr-style-modern .rr-count a:hover {
    color: var(--rr-text);
    text-decoration-color: currentColor;
}

.rr-style-modern .rr-write {
    padding: 0.5rem 1.25rem;
    border-radius: var(--rr-btn-radius, 999px);
    background: var(--rr-btn-bg, var(--rr-accent));
    color: var(--rr-btn-color, #fff);
    font-size: 0.9375rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rr-style-modern .rr-write:hover {
    background: color-mix(in srgb, var(--rr-btn-bg, var(--rr-accent)) 88%, #000);
    color: var(--rr-btn-color, #fff);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px -12px var(--rr-btn-bg, var(--rr-accent));
}

.rr-style-modern .rr-controls {
    justify-content: center;
}

.rr-style-modern .rr-dots {
    justify-content: center;
}

.rr-style-modern .rr-dot-btn[aria-current="true"] {
    width: 1.5rem;
}

.rr-style-modern .rr-btn {
    border: 1px solid var(--rr-line);
    background: var(--rr-surface);
}

.rr-style-modern .rr-btn:hover {
    border-color: var(--rr-accent);
    background: var(--rr-accent);
    color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    .rr-reviews .rr-list {
        scroll-behavior: auto;
    }

    .rr-reviews .rr-card,
    .rr-reviews .rr-write,
    .rr-reviews .rr-dot-btn,
    .rr-reviews .rr-arrow {
        transition: none;
    }

    .rr-style-modern .rr-card:hover,
    .rr-style-modern .rr-write:hover {
        transform: none;
    }
}
