/* Bewertungs-Slider (hilfsportal/google_reviews.html).
   Farben aus der Seite, falls vorhanden (--about-*), sonst die Grundpalette der Website. */

.gr-section {
    --gr-text: var(--about-text, #2f2a27);
    --gr-muted: var(--about-muted, #6e625a);
    --gr-line: var(--about-line, #e2d7ca);
    --gr-accent: var(--about-accent, #b98f68);
    --gr-accent-dark: var(--about-accent-dark, #8c6749);
    --gr-star: #fbbc04;
    --gr-gap: 1.25rem;

    padding-block: clamp(3rem, 5.5vw, 4.75rem);
    padding-inline: max(1.25rem, (100% - 1180px) / 2);
    background: #fffaf5;
    color: var(--gr-text);
}

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

.gr-inner {
    max-width: 1180px;
    margin-inline: auto;
}

/* ── Kopf ───────────────────────────────────────────── */

.gr-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem 3rem;
    margin-bottom: 2rem;
}

.gr-head__text {
    max-width: 680px;
}

.gr-kicker {
    font-size: .78rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gr-accent-dark);
    font-weight: 800;
    margin: 0 0 1rem;
}

.gr-kicker::after {
    content: "";
    display: block;
    width: 42px;
    height: 1px;
    background: var(--gr-accent);
    margin-top: .75rem;
}

.gr-title {
    font-family: 'Cormorant Infant', 'Cormorant Fallback', Georgia, serif;
    font-size: clamp(1.7rem, 3vw, 2.6rem);
    font-weight: 400;
    line-height: 1.15;
    margin: 0 0 .75rem;
}

.gr-intro {
    color: var(--gr-muted);
    line-height: 1.7;
    margin: 0;
}

.gr-summary {
    display: grid;
    gap: .35rem;
    justify-items: start;
}

.gr-summary p {
    margin: 0;
}

.gr-summary__score {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.gr-summary__score strong {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
}

.gr-summary__count {
    color: var(--gr-muted);
    font-size: .92rem;
}

.gr-summary__links {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.25rem;
}

.gr-summary__links a {
    color: var(--gr-accent-dark);
    font-weight: 700;
    font-size: .92rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.gr-summary__links a:hover {
    text-decoration-thickness: 2px;
}

.gr-summary__links a.gr-write {
    padding: .45rem 1rem;
    border: 1px solid var(--gr-accent-dark);
    border-radius: 999px;
    text-decoration: none;
}

.gr-summary__links a.gr-write:hover {
    background: var(--gr-accent-dark);
    color: #fff;
}

/* ── Slider ─────────────────────────────────────────── */

.gr-slider {
    position: relative;
}

.gr-track {
    display: flex;
    gap: var(--gr-gap);
    /* Innenabstand, damit Schatten und Fokusrahmen nicht abgeschnitten werden;
       der negative Rand gleicht ihn aus, die Karten bleiben buendig. */
    margin: -8px -8px -28px;
    padding: 8px 8px 28px;
    scroll-padding-inline: 8px;
    list-style: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.gr-track::-webkit-scrollbar {
    display: none;
}

.gr-track:focus-visible {
    outline: 2px solid var(--gr-accent-dark);
    outline-offset: 4px;
}

/* 4 Karten nebeneinander, darunter 3, 2 und auf dem Handy eine mit Anschnitt der naechsten */
.gr-card {
    flex: 0 0 calc((100% - 3 * var(--gr-gap)) / 4);
    scroll-snap-align: start;
    cursor: auto;
}

.gr-card article {
    display: flex;
    flex-direction: column;
    gap: .7rem;
    height: 100%;
    padding: 1.4rem 1.4rem 1.2rem;
    background: #fff;
    border: 1px solid var(--gr-line);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(68, 48, 34, .05),
    0 4px 12px rgba(68, 48, 34, .06);
    transition: transform .35s cubic-bezier(.2, .7, .3, 1),
    box-shadow .35s ease, border-color .35s ease;
}

.gr-card__head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .75rem;
}

.gr-avatar {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1;
}

.gr-card__who {
    min-width: 0;
}

.gr-name {
    margin: 0;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.gr-date {
    display: block;
    color: var(--gr-muted);
    font-size: .86rem;
}

.gr-card__source {
    align-self: start;
    line-height: 0;
}

.gr-google {
    display: inline-block;
    flex: none;
}

.gr-stars {
    display: inline-flex;
    gap: 1px;
    line-height: 0;
}

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

.gr-stars svg.is-empty {
    fill: #dadce0;
}

.gr-text {
    margin: 0;
    line-height: 1.6;
    white-space: pre-line;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    overflow: hidden;
}

.gr-text.is-expanded {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: none;
}

/* ── Lesefenster (reviews.js) ───────────────────────── */

.gr-dialog-open {
    overflow: hidden;
}

.gr-dialog {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: clamp(3.5rem, 7vh, 4.5rem) 1rem 2rem;
    border: 0;
    background: transparent;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.gr-dialog::backdrop {
    background: rgba(30, 22, 16, .72);
}

.gr-dialog__list {
    display: grid;
    gap: 1rem;
    max-width: 560px;
    min-height: 100%;
    margin-inline: auto;
    align-content: start;
}

.gr-dialog article {
    display: flex;
    flex-direction: column;
    gap: .7rem;
    padding: 1.5rem 1.6rem;
    background: #fff;
    border-radius: 14px;
    color: var(--gr-text);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    scroll-margin-top: clamp(3.5rem, 7vh, 4.5rem);
}

.gr-dialog .gr-text {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: none;
    font-size: 1.02rem;
    line-height: 1.7;
}

.gr-dialog__close {
    position: fixed;
    top: .75rem;
    right: .75rem;
    z-index: 1;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    /* dunkel hinterlegt: auf dem Handy liegt das Kreuz ueber den weissen Karten */
    background: rgba(30, 22, 16, .82);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    cursor: pointer;
}

.gr-dialog__close::before,
.gr-dialog__close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 2px;
    background: #fff;
}

.gr-dialog__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.gr-dialog__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.gr-dialog__close:hover {
    background: rgba(30, 22, 16, .95);
}

.gr-dialog__close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.gr-more {
    align-self: flex-start;
    margin-top: auto;
    padding: 0;
    background: none;
    border: 0;
    color: var(--gr-muted);
    font: inherit;
    font-size: .9rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: transparent;
    transition: color .2s ease, text-decoration-color .2s ease;
}

.gr-more:hover,
.gr-more:focus-visible {
    color: var(--gr-accent-dark);
    text-decoration-color: currentColor;
}

/* Pfeile: runde Knoepfe am Rand, wie beim Trustindex-Slider */
.gr-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--gr-line);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(68, 48, 34, .14);
    cursor: pointer;
    transform: translateY(-50%);
    transition: opacity .2s ease, box-shadow .2s ease;
}

.gr-nav::before {
    content: "";
    width: 10px;
    height: 10px;
    border-top: 2px solid var(--gr-accent-dark);
    border-right: 2px solid var(--gr-accent-dark);
}

.gr-nav--prev {
    left: -22px;
}

.gr-nav--prev::before {
    transform: translateX(2px) rotate(-135deg);
}

.gr-nav--next {
    right: -22px;
}

.gr-nav--next::before {
    transform: translateX(-2px) rotate(45deg);
}

.gr-nav:hover {
    box-shadow: 0 4px 14px rgba(68, 48, 34, .22);
}

.gr-nav:focus-visible {
    outline: 2px solid var(--gr-accent-dark);
    outline-offset: 2px;
}

.gr-nav:disabled {
    opacity: 0;
    pointer-events: none;
}

.gr-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .gr-card {
        flex-basis: calc((100% - 2 * var(--gr-gap)) / 3);
    }

    .gr-nav--prev {
        left: -12px;
    }

    .gr-nav--next {
        right: -12px;
    }
}

@media (max-width: 860px) {
    .gr-card {
        flex-basis: calc((100% - var(--gr-gap)) / 2);
    }
}

/* Handy: Wischen statt Pfeile, die naechste Karte schaut an, damit klar ist, dass es weitergeht */
@media (max-width: 560px) {
    .gr-section {
        --gr-gap: .85rem;
    }

    .gr-card {
        flex-basis: 86%;
    }

    .gr-nav {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gr-track {
        scroll-behavior: auto;
    }
}

/* ── Bewegung beim Überfahren ──────────────────────────
   Nur mit Maus (auf dem Handy bliebe der Zustand nach dem Tippen haengen)
   und nur, wenn "Bewegung reduzieren" nicht eingeschaltet ist.
   Die Karte hebt sich wie die Ablauf-Karten der Seite, dazu kleine Details:
   Avatar, Google-Logo, Sterne nacheinander und ein Pfeil bei "Weiterlesen". */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .gr-avatar,
    .gr-card .gr-google,
    .gr-card .gr-stars svg {
        transition: transform .35s cubic-bezier(.2, .7, .3, 1);
    }

    .gr-card article:hover {
        transform: translateY(-6px);
        border-color: #d8c2ab;
        /* negativer Spread: der Schatten bleibt innerhalb des Scrollbereichs */
        box-shadow: 0 2px 6px rgba(68, 48, 34, .06),
        0 16px 22px -10px rgba(68, 48, 34, .22);
    }

    .gr-card article:hover .gr-avatar {
        transform: scale(1.08);
    }

    .gr-card article:hover .gr-google {
        transform: rotate(-12deg) scale(1.1);
    }

    .gr-card article:hover .gr-stars svg {
        transform: translateY(-2px) scale(1.15);
    }

    .gr-card .gr-stars svg:nth-child(2) { transition-delay: .04s; }
    .gr-card .gr-stars svg:nth-child(3) { transition-delay: .08s; }
    .gr-card .gr-stars svg:nth-child(4) { transition-delay: .12s; }
    .gr-card .gr-stars svg:nth-child(5) { transition-delay: .16s; }

    .gr-more::after {
        content: "→";
        display: inline-block;
        margin-left: .35em;
        opacity: 0;
        transform: translateX(-4px);
        transition: opacity .25s ease, transform .25s ease;
    }

    .gr-card article:hover .gr-more::after {
        opacity: 1;
        transform: none;
    }

    .gr-more:hover::after {
        transform: translateX(3px);
    }

    .gr-nav {
        transition: opacity .2s ease, box-shadow .2s ease, transform .2s ease;
    }

    .gr-nav:hover {
        transform: translateY(-50%) scale(1.08);
    }
}

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

.gr-name a:hover,
.gr-name a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.gr-attribution {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: 1.75rem 0 0;
    color: var(--gr-muted);
    font-size: .8rem;
}
