/* WP Review Widgets — front-end layouts */

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

.gre {
    --gre-star: #f5b301;
    --gre-accent: #e23b4a;
    --gre-card: #ffffff;
    --gre-text: #3c4043;
    --gre-name: #202124;
    --gre-muted: #5f6368;
    --gre-gap: 22px;
    /* Same Google “G” as RichPlugins --rpi-logo-g */
    --gre-logo-g: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M482.56 261.36c0-16.73-1.5-32.83-4.29-48.27H256v91.29h127.01c-5.47 29.5-22.1 54.49-47.09 71.23v59.21h76.27c44.63-41.09 70.37-101.59 70.37-173.46z' fill='%234285f4'/%3E%3Cpath d='M256 492c63.72 0 117.14-21.13 156.19-57.18l-76.27-59.21c-21.13 14.16-48.17 22.53-79.92 22.53-61.47 0-113.49-41.51-132.05-97.3H45.1v61.15c38.83 77.13 118.64 130.01 210.9 130.01z' fill='%2334a853'/%3E%3Cpath d='M123.95 300.84c-4.72-14.16-7.4-29.29-7.4-44.84s2.68-30.68 7.4-44.84V150.01H45.1C29.12 181.87 20 217.92 20 256c0 38.08 9.12 74.13 25.1 105.99l78.85-61.15z' fill='%23fbbc05'/%3E%3Cpath d='M256 113.86c34.65 0 65.76 11.91 90.22 35.29l67.69-67.69C373.03 43.39 319.61 20 256 20c-92.25 0-172.07 52.89-210.9 130.01l78.85 61.15c18.56-55.78 70.59-97.3 132.05-97.3z' fill='%23ea4335'/%3E%3C/svg%3E");
    color: var(--gre-text);
    font-family: inherit;
    line-height: 1.45;
}

.gre a {
    color: inherit;
    text-decoration: none;
}

.gre button {
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.gre-mark {
    display: inline-flex;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.gre-mark svg {
    display: block;
    width: 100%;
    height: 100%;
}

.gre-mark--bubble {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #fff;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.gre-mark--bubble svg {
    width: 24px;
    height: 24px;
}

.gre-mark--tiny {
    width: 14px;
    height: 14px;
}

.gre-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    line-height: 1;
}

.gre-star {
    position: relative;
    display: inline-block;
    width: 1em;
    height: 1em;
    font-size: 16px;
}

.gre-star svg {
    display: block;
    width: 1em;
    height: 1em;
}

.gre-star-bg {
    fill: #e4e5e7;
}

.gre-star-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--gre-fill, 0%);
    overflow: hidden;
}

.gre-star-fill svg {
    fill: var(--gre-star);
}

.gre-rating-num {
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.gre-score-line,
.gre-fab-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.gre-based {
    color: var(--gre-muted);
    font-size: 14px;
}

/* Static: inline bar, banner, card, business header */

.gre--align-center {
    display: flex;
    justify-content: center;
}

.gre--static-inline,
.gre--static-banner {
    color: inherit;
}

/* Design 2 — horizontal: colored G + Google Reviews | score ★★★★★ (count) */
.gre-summary--inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    color: inherit;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.gre-summary--inline .gre-mark {
    width: 18px;
    height: 18px;
}

.gre-inline-label {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0;
    color: inherit;
}

.gre-inline-sep {
    display: inline-block;
    width: 1px;
    height: 1.05em;
    margin: 0 2px;
    background: currentColor;
    opacity: 0.85;
    flex: 0 0 auto;
}

.gre-summary--inline .gre-score-line {
    gap: 6px;
}

.gre-summary--inline .gre-rating-num {
    font-size: 16px;
    font-weight: 600;
    color: inherit;
    letter-spacing: 0;
}

.gre-summary--inline .gre-star {
    font-size: 15px;
}

.gre-summary--inline .gre-star-bg {
    fill: rgba(251, 188, 4, 0.28);
}

.gre-summary--inline .gre-star-fill svg {
    fill: var(--gre-star, #fbbc04);
}

.gre-summary--inline .gre-inline-count {
    margin-left: 4px;
    font-size: 16px;
    font-weight: 600;
    color: inherit;
    opacity: 1;
}

@media (max-width: 520px) {
    .gre-summary--inline {
        flex-wrap: wrap;
        white-space: normal;
        row-gap: 6px;
    }
}

/*
 * Design 1 — matches Aperitif / RichPlugins header badge:
 * 40px Google logo | gold 5.0 + stars
 *                  | Based on N reviews (13px)
 */
.gre-summary--banner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    color: inherit;
    font-family: Arial, Helvetica, sans-serif;
    text-decoration: none;
    line-height: normal;
    vertical-align: middle;
}

/* Design 1 logo — identical technique to .rpi-logo-google */
.gre-summary--banner .gre-logo-google {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    position: relative;
}

.gre-summary--banner .gre-logo-google::before {
    content: "";
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gre-logo-g) center / cover no-repeat;
}

.gre-banner-copy,
.gre-header-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 3px;
}

.gre-summary--banner .gre-banner-copy {
    justify-content: center;
}

.gre-summary--banner .gre-score-line {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 18px;
    line-height: 1;
}

.gre-summary--banner .gre-rating-num {
    font-size: 14.4px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--gre-star, #ffb500);
    line-height: 18px;
    margin-right: 4px;
}

.gre-summary--banner .gre-stars {
    gap: 2px;
    height: 18px;
}

.gre-summary--banner .gre-star {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.gre-summary--banner .gre-star-bg {
    fill: var(--gre-star, #ffb500);
    opacity: 0.28;
}

.gre-summary--banner .gre-star-fill svg {
    fill: var(--gre-star, #ffb500);
}

.gre-summary--banner .gre-based {
    display: block;
    margin: 0;
    color: inherit;
    opacity: 1;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.15;
}

.gre-summary--card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    max-width: 280px;
    background: #fff;
    color: #202124;
    border-radius: 10px;
    border-top: 4px solid var(--gre-accent);
    padding: 14px 16px 13px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.gre-label-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gre-label {
    font-size: 16px;
    font-weight: 600;
    color: #202124;
}

.gre-summary--card .gre-rating-num {
    font-size: 26px;
    color: #202124;
}

.gre-summary--card .gre-star {
    font-size: 16px;
}

.gre-summary--card .gre-based {
    color: #5f6368;
    font-size: 14px;
}

.gre-summary--header {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--gre-card);
    color: #202124;
    border-radius: 20px;
    padding: 18px 22px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.gre-business-name {
    display: block;
    margin-bottom: 4px;
    color: var(--gre-accent);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
}

.gre-summary--header .gre-rating-num {
    font-size: 18px;
    color: #202124;
}

.gre-summary--header .gre-star {
    font-size: 16px;
}

.gre-summary--header .gre-based {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    color: #5f6368;
}

.gre-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f1f3f4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 auto;
}

.gre-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gre-avatar .gre-mark {
    width: 28px;
    height: 28px;
}

/* Review cards, shared by grid, carousel, and the slide-out list */

.gre-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 240px;
    background: var(--gre-card);
    color: var(--gre-text);
    border-radius: 20px;
    padding: 22px 22px 18px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
}

.gre-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.gre-card-text {
    flex: 0 1 auto;
    min-height: 0;
    max-height: var(--gre-text-max, 150px);
    overflow: auto;
    padding-right: 8px;
    font-size: 15px;
    line-height: 1.5;
    overflow-wrap: break-word;
    scrollbar-width: thin;
    scrollbar-color: #c5c8c6 transparent;
}

.gre-card-text::-webkit-scrollbar {
    width: 8px;
}

.gre-card-text::-webkit-scrollbar-thumb {
    background: #c5c8c6;
    border-radius: 8px;
}

.gre-card-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 16px;
    color: var(--gre-name);
    font-weight: 700;
}

.gre-card-author a:hover {
    text-decoration: underline;
}

.gre-author-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.gre-date {
    display: block;
    margin-top: 2px;
    color: var(--gre-muted);
    font-size: 12px;
    font-weight: 400;
}

.gre--grid {
    container-type: inline-size;
}

.gre--grid .gre-summary--header {
    margin-bottom: var(--gre-gap);
}

.gre-grid {
    display: grid;
    grid-template-columns: repeat(var(--gre-cols, 3), minmax(0, 1fr));
    gap: var(--gre-gap);
}

.gre-more-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 28px;
    width: 100%;
}

.gre-more {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: 0;
    padding: 10px 28px;
    border: 1px solid rgba(60, 64, 67, 0.18);
    border-radius: 999px;
    background: #fff;
    color: #202124;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.gre-more:hover,
.gre-more:focus {
    border-color: var(--gre-accent, #e23b4a);
    color: var(--gre-accent, #e23b4a);
    outline: none;
}

.gre-more:focus-visible {
    outline: 2px solid var(--gre-accent, #e23b4a);
    outline-offset: 2px;
}

.gre-more.is-loading {
    opacity: 0.65;
    cursor: wait;
    pointer-events: none;
}

.gre-more[hidden] {
    display: none !important;
}

@container (max-width: 980px) {
    .gre--cols-3 .gre-grid,
    .gre--cols-4 .gre-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container (max-width: 620px) {
    .gre--grid .gre-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .gre--grid .gre-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Carousel — no business header row, no separator line */

.gre--carousel {
    border: 0 !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
    background: transparent;
}

.gre--carousel .gre-summary--header {
    display: none !important;
}

.gre-carousel {
    position: relative;
    padding: 0 56px;
    border: 0;
    border-bottom: 0;
    box-shadow: none;
    background: transparent;
}

.gre-viewport {
    overflow: hidden;
    touch-action: pan-y;
    border: 0;
    box-shadow: none;
}

.gre-track {
    display: flex;
    align-items: stretch;
    gap: var(--gre-gap);
    transition: transform 0.45s ease;
    border: 0;
    box-shadow: none;
}

.gre--carousel .gre-card {
    flex: 0 0 auto;
    height: auto;
}

.gre--carousel .gre-card-text {
    max-height: 220px;
}

/* Beat theme button styles that turn arrows into black rectangles over cards */
.gre--carousel .gre-nav,
.gre .gre-nav {
    position: absolute !important;
    top: 50% !important;
    z-index: 3;
    box-sizing: border-box !important;
    display: grid !important;
    place-items: center !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(60, 64, 67, 0.12) !important;
    border-radius: 50% !important;
    background: #fff !important;
    background-image: none !important;
    color: #3c4043 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14) !important;
    transform: translateY(-50%) !important;
    line-height: 0 !important;
    font-size: 0 !important;
    text-indent: 0 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    cursor: pointer;
}

.gre--carousel .gre-nav svg,
.gre .gre-nav svg {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    stroke: currentColor !important;
    fill: none !important;
}

.gre--carousel .gre-nav--prev,
.gre .gre-nav--prev {
    left: 0 !important;
    right: auto !important;
}

.gre--carousel .gre-nav--next,
.gre .gre-nav--next {
    right: 0 !important;
    left: auto !important;
}

.gre--carousel .gre-nav:hover,
.gre--carousel .gre-nav:focus,
.gre .gre-nav:hover,
.gre .gre-nav:focus {
    background: #fff !important;
    color: #111 !important;
    border-color: rgba(60, 64, 67, 0.22) !important;
}

.gre--carousel .gre-nav:disabled,
.gre--carousel .gre-nav[hidden],
.gre .gre-nav:disabled,
.gre .gre-nav[hidden] {
    opacity: 0.35;
    cursor: default;
}

.gre-nav:focus-visible,
.gre-fab:focus-visible,
.gre-panel-close:focus-visible {
    outline: 2px solid var(--gre-accent);
    outline-offset: 2px;
}

/* Floating button and slide-out list */

.gre-fab {
    position: fixed;
    z-index: 99991;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 14px;
    border: 0;
    background: #fff;
    color: #202124;
    text-align: left;
    line-height: 1.1;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.gre--pos-right .gre-fab {
    top: 50%;
    right: 0;
    border-radius: 16px 0 0 16px;
    transform: translateY(-50%);
}

.gre--pos-left .gre-fab {
    top: 50%;
    left: 0;
    border-radius: 0 16px 16px 0;
    transform: translateY(-50%);
}

.gre--pos-bottom-right .gre-fab {
    right: 18px;
    bottom: 18px;
    border-radius: 999px;
}

.gre--pos-bottom-left .gre-fab {
    left: 18px;
    bottom: 18px;
    border-radius: 999px;
}

.gre-fab .gre-mark {
    width: 28px;
    height: 28px;
}

.gre-fab .gre-rating-num {
    font-size: 18px;
}

.gre-fab .gre-star {
    font-size: 14px;
}

.gre-fab-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.gre-fab-label {
    color: #5f6368;
    font-size: 12px;
    font-weight: 600;
}

.gre-scrim {
    position: fixed;
    inset: 0;
    z-index: 99990;
    background: rgba(32, 16, 18, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.gre--floating.is-open .gre-scrim {
    opacity: 1;
    pointer-events: auto;
}

.gre-panel {
    position: fixed;
    top: 0;
    z-index: 99992;
    display: flex;
    flex-direction: column;
    width: min(420px, 100%);
    height: 100%;
    background: #f6f3f3;
    color: #202124;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.22);
    transition: transform 0.35s ease;
}

.gre--pos-right .gre-panel,
.gre--pos-bottom-right .gre-panel {
    right: 0;
    transform: translateX(105%);
}

.gre--pos-left .gre-panel,
.gre--pos-bottom-left .gre-panel {
    left: 0;
    transform: translateX(-105%);
}

.gre--floating.is-open .gre-panel {
    transform: translateX(0);
}

.gre-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 16px 14px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.gre-panel-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.gre-panel-title strong {
    font-size: 18px;
    line-height: 1.3;
}

.gre-panel-title .gre-based {
    color: #5f6368;
}

.gre--floating .gre-panel-close,
.gre-panel-close {
    box-sizing: border-box;
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #3c4043;
    font: inherit;
    font-size: 0;
    line-height: 0;
    text-align: center;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.gre--floating .gre-panel-close:hover,
.gre-panel-close:hover {
    background: #f1f3f4;
    color: #202124;
}

.gre-panel-close__icon {
    display: block;
    width: 14px;
    height: 14px;
    flex: none;
    pointer-events: none;
}

.gre-panel-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px;
    min-height: 0; /* allow body to scroll inside fixed panel */
    -webkit-overflow-scrolling: touch;
}

/* Cards must keep natural height — min-height:0 + flex shrink caused stacked overlap. */
.gre--floating .gre-panel .gre-card,
.gre-panel .gre-card {
    position: relative;
    flex: 0 0 auto;
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    min-height: auto;
    height: auto;
    margin: 0;
    box-shadow: none;
    border: 1px solid #eceff1;
}

.gre--floating .gre-panel .gre-card-top,
.gre--floating .gre-panel .gre-card-author,
.gre-panel .gre-card-top,
.gre-panel .gre-card-author {
    flex: 0 0 auto;
}

.gre--floating .gre-panel .gre-card-text,
.gre-panel .gre-card-text {
    flex: 0 0 auto;
    min-height: auto;
    max-height: none;
    overflow: visible;
    padding-right: 0;
}

.gre-panel-footer {
    display: block;
    padding: 14px 16px;
    background: #fff;
    border-top: 1px solid #eee;
    color: var(--gre-accent);
    font-weight: 700;
    text-align: center;
}

.gre-panel-footer:hover {
    text-decoration: underline;
}

body.admin-bar .gre-panel {
    top: 32px;
    height: calc(100% - 32px);
}

@media (max-width: 782px) {
    body.admin-bar .gre-panel {
        top: 46px;
        height: calc(100% - 46px);
    }

    .gre--hide-mobile {
        display: none !important;
    }
}

.gre-empty,
.gre-admin-note {
    margin: 0;
    color: inherit;
    font-size: 14px;
    opacity: 0.8;
}

html.gre-scroll-lock {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .gre-track,
    .gre-panel,
    .gre-scrim {
        transition: none;
    }
}

/* Keep the fixed button from covering the block editor canvas. */
.editor-styles-wrapper .gre--floating .gre-fab,
.block-editor-block-list__layout .gre--floating .gre-fab {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    transform: none;
    border-radius: 16px;
}

.editor-styles-wrapper .gre--floating .gre-panel,
.block-editor-block-list__layout .gre--floating .gre-panel {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    width: 100%;
    height: auto;
    max-height: 480px;
    transform: none;
}

.editor-styles-wrapper .gre--floating .gre-scrim,
.block-editor-block-list__layout .gre--floating .gre-scrim {
    display: none;
}
