/* ==========================================================================
   Eigener Google-Bewertungs-Abschnitt (bewertungen/bewertungen.php)
   Eigenständig: hängt nicht an .oschwald-b2b/.oschwald-privat, damit er auch auf der
   Startseite und den Objektseiten passt. Farben fallen auf feste Werte zurück, falls
   die Variablen aus vorlagen-basis.css auf einer Seite fehlen.
   ========================================================================== */

.bw {
    --bw-gruen: var(--oschwald-green, #55701F);
    --bw-gruen-dunkel: var(--oschwald-green-dark, #4a6120);
    --bw-gruen-hell: var(--oschwald-green-light, #E8F0E0);
    --bw-text: var(--text-dark, #333333);
    --bw-text-leise: var(--text-medium, #666666);
    --bw-stern: #F5B400;
    --bw-abstand: 24px;

    padding: clamp(56px, 8vw, 96px) 24px;
    background: linear-gradient(180deg, var(--bg-light, #F5F5F5) 0%, #eef3e6 100%);
    color: var(--bw-text);
}

.bw-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* ----- Kopf: Titel links, Gesamtnote rechts ----- */
.bw-kopf {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px 40px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.bw-dachzeile {
    display: inline-block;
    color: var(--bw-gruen);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.bw .bw-titel {
    font-size: clamp(26px, 3.4vw, 34px);
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.bw .bw-gesamt {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px 14px 18px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.06);
    color: var(--bw-text);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bw .bw-gesamt:hover,
.bw .bw-gesamt:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05), 0 12px 28px rgba(0, 0, 0, 0.09);
    color: var(--bw-text);
}

.bw-gesamt .bw-g {
    width: 30px;
    height: 30px;
    flex: none;
}

.bw-gesamt-note {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.5px;
}

.bw-gesamt-rest {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bw-gesamt-anzahl {
    font-size: 13px;
    color: var(--bw-text-leise);
    line-height: 1.2;
}

/* ----- Sterne ----- */
.bw-sterne {
    display: inline-flex;
    gap: 2px;
    line-height: 0;
}

.bw-sterne svg {
    width: 19px;
    height: 19px;
}

.bw-sterne--klein svg {
    width: 17px;
    height: 17px;
}

.bw-stern-leer { fill: #E2E2DC; }
.bw-stern-voll { fill: var(--bw-stern); }

/* ----- Karten-Spur (waagerecht wischbar) ----- */
.bw-spur {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 2 * var(--bw-abstand)) / 3);
    gap: var(--bw-abstand);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Platz für die Schatten, ohne dass sie abgeschnitten werden */
    padding: 6px 6px 22px;
    margin: -6px -6px 0;
}

.bw-spur::-webkit-scrollbar { display: none; }

.bw-spur:focus-visible {
    outline: 2px solid var(--bw-gruen);
    outline-offset: 4px;
    border-radius: 18px;
}

.bw-karte {
    position: relative;
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
    background: #fff;
    border-radius: 16px;
    padding: 28px 28px 22px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
}

/* Dezentes Anführungszeichen oben rechts */
.bw-karte::before {
    content: '\201C';
    position: absolute;
    top: 14px;
    right: 22px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 72px;
    line-height: 1;
    color: var(--bw-gruen);
    opacity: 0.14;
    pointer-events: none;
}

.bw-karte .bw-sterne {
    margin-bottom: 16px;
}

.bw-text {
    font-size: 16px;
    line-height: 1.65;
    color: #444;
}

.bw .bw-text p {
    margin: 0 0 0.75em;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

.bw .bw-text p:last-child { margin-bottom: 0; }

/* Lange Texte (ab 9 Zeilen, siehe JS): auf sieben Zeilen gekürzt, unten weich ausgeblendet */
.bw-karte.ist-lang .bw-text {
    max-height: calc(1.65em * 7);
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent);
    mask-image: linear-gradient(180deg, #000 62%, transparent);
}

.bw-karte.ist-lang.ist-offen .bw-text {
    max-height: none;
    -webkit-mask-image: none;
    mask-image: none;
}

/* Theme-Button-Stile (Hello Elementor) gezielt zurücksetzen */
.bw button.bw-mehr {
    align-self: flex-start;
    margin-top: -10px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--bw-gruen);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.bw button.bw-mehr:hover,
.bw button.bw-mehr:focus-visible {
    background: none;
    color: var(--bw-gruen-dunkel);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bw button.bw-mehr[hidden] { display: none; }

/* Fuß der Karte: margin-top:auto schiebt ihn bei kurzen Texten nach unten,
   damit alle Karten einer Reihe auf einer Linie enden. */
.bw-text,
.bw button.bw-mehr {
    margin-bottom: 20px;
}

.bw-person {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #EEEEEA;
}

.bw-initialen {
    flex: none;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bw-gruen-hell);
    color: var(--bw-gruen-dunkel);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.bw-person-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.bw-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--bw-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bw-datum {
    font-size: 13px;
    color: var(--bw-text-leise);
}

.bw .bw-quelle {
    margin-left: auto;
    flex: none;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.bw .bw-quelle:hover,
.bw .bw-quelle:focus-visible {
    background: #F3F4F0;
}

.bw-quelle .bw-g {
    width: 20px;
    height: 20px;
}

/* ----- Steuerung: Pfeile und Fortschritt ----- */
.bw-steuerung {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

.bw--passt .bw-steuerung { display: none; }

.bw button.bw-pfeil {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(85, 112, 31, 0.28);
    border-radius: 50%;
    background: #fff;
    color: var(--bw-gruen);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.bw button.bw-pfeil svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bw button.bw-pfeil:hover:not(:disabled),
.bw button.bw-pfeil:focus-visible {
    background: var(--bw-gruen);
    border-color: var(--bw-gruen);
    color: #fff;
}

.bw button.bw-pfeil:disabled {
    opacity: 0.35;
    cursor: default;
}

.bw-fortschritt {
    position: relative;
    width: 140px;
    height: 3px;
    border-radius: 3px;
    background: rgba(85, 112, 31, 0.16);
    overflow: hidden;
}

.bw-fortschritt span {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--bw-anteil, 33%);
    border-radius: 3px;
    background: var(--bw-gruen);
    transform: translateX(var(--bw-versatz, 0%));
    transition: transform 0.25s ease;
}

/* ----- Pflichthinweis (§ 5b Abs. 3 UWG) ----- */
.bw .bw-hinweis {
    max-width: 780px;
    margin: 28px auto 0;
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
    color: var(--bw-text-leise);
}

.bw .bw-hinweis a {
    color: var(--bw-gruen);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
}

/* ----- Responsive ----- */
@media (max-width: 1024px) {
    .bw-spur {
        grid-auto-columns: calc((100% - var(--bw-abstand)) / 2);
    }
}

@media (max-width: 680px) {
    .bw {
        --bw-abstand: 14px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .bw-kopf {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        margin-bottom: 24px;
    }

    .bw .bw-gesamt {
        align-self: flex-start;
    }

    /* Nächste Karte schaut rechts hervor: zeigt, dass man wischen kann */
    .bw-spur {
        grid-auto-columns: 86%;
    }

    .bw-karte {
        padding: 24px 22px 18px;
    }

    .bw .bw-hinweis {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bw-spur { scroll-behavior: auto; }
    .bw .bw-gesamt,
    .bw-fortschritt span { transition: none; }
}
