/*
 * mcf-google-reviews — carousel styles.
 * Override CSS custom properties on .scgr from your host theme to re-skin.
 */

.scgr {
    --scgr-cols: 3;                        /* visible cards */
    --scgr-gap: 20px;
    --scgr-bg: transparent;
    --scgr-card-bg: #ffffff;
    --scgr-card-border: rgba(0,0,0,0.08);
    --scgr-text: #1a1a2e;
    --scgr-muted: #6b7280;
    --scgr-star: #f59e0b;
    --scgr-star-empty: #e5e7eb;
    --scgr-accent: #2563eb;
    --scgr-nav-bg: #ffffff;
    --scgr-nav-size: 44px;
    --scgr-radius: 16px;

    position: relative;
    color: var(--scgr-text);
    background: var(--scgr-bg);
    font-family: inherit;
}

/* ---- Summary bar ---- */
.scgr__summary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 24px;
}

.scgr__rating-num {
    font-size: 2em;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.scgr__stars,
.scgr__card-stars {
    display: inline-flex;
    gap: 2px;
    line-height: 1;
}

.scgr__star {
    font-size: 1.15em;
    color: var(--scgr-star);
}

.scgr__star--empty {
    color: var(--scgr-star-empty);
}

.scgr__star--half {
    background: linear-gradient(90deg, var(--scgr-star) 50%, var(--scgr-star-empty) 50%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.scgr__count {
    color: var(--scgr-muted);
    font-size: 0.9em;
}

.scgr__source {
    margin-left: auto;
    color: var(--scgr-accent);
    text-decoration: none;
    font-size: 0.88em;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.scgr__source:hover,
.scgr__source:focus {
    text-decoration: underline;
}

/* ---- Viewport + nav ---- */
.scgr__viewport {
    position: relative;
}

.scgr__track {
    display: flex;
    gap: var(--scgr-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    list-style: none;
    margin: 0;
    padding: 6px 2px 6px;   /* just enough for card shadow to breathe */

    /* hide scrollbar on all browsers */
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.scgr__track::-webkit-scrollbar {
    display: none;
}

/* ---- Cards: exactly 3 visible, calculated width ---- */
.scgr__card {
    flex: 0 0 calc((100% - (var(--scgr-cols) - 1) * var(--scgr-gap)) / var(--scgr-cols));
    max-width: calc((100% - (var(--scgr-cols) - 1) * var(--scgr-gap)) / var(--scgr-cols));
    background: var(--scgr-card-bg);
    border: 1px solid var(--scgr-card-border);
    border-radius: var(--scgr-radius);
    padding: 24px 22px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.06),
        0 4px 16px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.scgr__card:hover {
    box-shadow:
        0 2px 6px rgba(0,0,0,0.08),
        0 12px 32px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}

/* ---- Card head ---- */
.scgr__card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scgr__avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #e5e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1em;
    color: #6b7280;
    text-transform: uppercase;
}

.scgr__author {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.scgr__author-name {
    font-weight: 700;
    font-size: 0.97em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Stars on card ---- */
.scgr__card-stars .scgr__star {
    font-size: 1.05em;
}

/* ---- Review text ---- */
.scgr__card-text {
    font-size: 0.93em;
    line-height: 1.65;
    color: var(--scgr-text);
    flex: 1;
}

.scgr__toggle {
    display: inline;
    background: none;
    border: 0;
    color: var(--scgr-accent);
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    font: inherit;
    font-size: 0.92em;
    font-weight: 500;
    text-decoration: underline;
}

.scgr__toggle:hover,
.scgr__toggle:focus {
    text-decoration: none;
}

/* ---- Nav buttons ---- */
.scgr__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: var(--scgr-nav-size);
    height: var(--scgr-nav-size);
    border-radius: 50%;
    border: none;
    background: #1a1a2e;
    color: #ffffff;
    cursor: pointer;
    font-size: 1.6em;
    font-weight: 300;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.scgr__nav--prev { left: calc(-1 * var(--scgr-nav-size) / 2 - 4px); }
.scgr__nav--next { right: calc(-1 * var(--scgr-nav-size) / 2 - 4px); }

.scgr__nav:hover,
.scgr__nav:focus {
    background: var(--scgr-accent);
    box-shadow: 0 4px 18px rgba(37,99,235,0.35);
    transform: translateY(-50%) scale(1.08);
    outline: none;
}

.scgr__nav:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    box-shadow: none;
    transform: translateY(-50%) scale(1);
}


/* ---- Responsive ---- */
@media (max-width: 900px) {
    .scgr { --scgr-cols: 2; }
}

@media (max-width: 560px) {
    .scgr {
        --scgr-cols: 1;
        --scgr-gap: 14px;
    }
    .scgr__card { padding: 18px 16px; }
    .scgr__nav { display: none; }
}

/* ---- Error / empty states ---- */
.scgr-error,
.mcfgr-error,
.scgr-empty {
    padding: 14px 18px;
    border-radius: 10px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.95em;
}
