/*
 * RS Google-Bewertungen – Grundgerüst (immer geladen, wenn ein Widget auf der Seite ist).
 *
 * Nur Mechanik: Raster und Spalten, Kürzen, Ein-/Ausblenden, Karussell, Laufband,
 * schwebendes Fenster, Sterne. Keine Farben, Rahmen oder Schriftgrößen.
 * Das Aussehen kommt aus skin.css (Plugin-Design, Klasse .rsgb--skin) oder aus einer Design-Vorlage.
 */

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

.rsgb {
	position: relative;
	width: 100%;
	max-width: var(--rsgb-maxw, none);
	margin-left: auto;
	margin-right: auto;
}

.rsgb:not(.rsgb--schwebend):not(.rsgb--badge) {
	container-type: inline-size;
	container-name: rsgb;
}

.rsgb .rsgb-hide,
.rsgb [hidden] {
	display: none !important;
}

.rsgb img {
	max-width: none;
}

/* Sterne: graue Reihe, darüber die gefüllte Reihe mit Breite in Prozent. */
.rsgb .rsgb-stars {
	position: relative;
	display: inline-block;
	line-height: 0;
	white-space: nowrap;
	vertical-align: middle;
}

.rsgb .rsgb-stars svg {
	display: inline-block;
	width: var(--rsgb-star-size, 18px);
	height: var(--rsgb-star-size, 18px);
}

.rsgb .rsgb-stars__bg svg {
	fill: var(--rsgb-star-empty, rgba(0, 0, 0, .18));
}

.rsgb .rsgb-stars__fill {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	white-space: nowrap;
}

.rsgb .rsgb-stars__fill svg {
	fill: var(--rsgb-star, #fbbc04);
}

.rsgb .rsgb-g {
	display: inline-block;
	flex: none;
	width: 20px;
	height: 20px;
	vertical-align: middle;
}

.rsgb .rsgb-avatar {
	width: var(--rsgb-avatar, 44px);
	height: var(--rsgb-avatar, 44px);
	flex: none;
	object-fit: cover;
	border-radius: 50%;
}

.rsgb .rsgb-avatar--initial {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	line-height: 1;
}

/* Kachel: Grundaufbau, damit Logo unten und Einrückung funktionieren. */
.rsgb .rsgb-card {
	display: flex;
	flex-direction: column;
}

.rsgb .rsgb-card__head {
	display: flex;
	align-items: center;
	min-width: 0;
}

.rsgb .rsgb-card__who {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
}

.rsgb .rsgb-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.rsgb .rsgb-card__logo {
	margin-top: auto;
}

.rsgb .rsgb-text {
	overflow-wrap: anywhere;
}

.rsgb.rsgb--indent:not(.rsgb--card-sprechblase) .rsgb-card__body {
	margin-left: calc(var(--rsgb-avatar, 44px) + 12px);
}

/* Gekürzter Text: ausgeklappt per Klasse .is-open an der Kachel. */
.rsgb.rsgb--clamp .rsgb-card:not(.is-open) .rsgb-text {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--rsgb-lines, 4);
	line-clamp: var(--rsgb-lines, 4);
	overflow: hidden;
}

.rsgb.rsgb--clamp .rsgb-card:not(.is-open) .rsgb-reply,
.rsgb.rsgb--clamp .rsgb-card:not(.is-open) .rsgb-photos {
	display: none;
}

/* Knöpfe ohne Theme-Gestaltung starten lassen. */
.rsgb .rsgb-more,
.rsgb .rsgb-arrow,
.rsgb .rsgb-dot,
.rsgb .rsgb-panel__close,
.rsgb .rsgb-float__btn {
	min-height: 0;
	width: auto;
	margin: 0;
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
}

.rsgb .rsgb-more {
	align-self: flex-start;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	color: inherit;
}

/* Raster, Mauerwerk, Liste. */
.rsgb .rsgb-grid {
	display: grid;
	grid-template-columns: repeat(var(--rsgb-cols, 3), minmax(0, 1fr));
	gap: var(--rsgb-gap, 24px);
	align-items: start;
}

.rsgb.rsgb--equal .rsgb-grid,
.rsgb.rsgb--equal .rsgb-track {
	align-items: stretch;
}

.rsgb.rsgb--equal .rsgb-item,
.rsgb.rsgb--equal .rsgb-slide {
	display: flex;
}

.rsgb.rsgb--equal .rsgb-card {
	width: 100%;
	height: 100%;
}

.rsgb.rsgb--masonry .rsgb-grid {
	display: block;
	column-count: var(--rsgb-cols, 3);
	column-gap: var(--rsgb-gap, 24px);
}

.rsgb.rsgb--masonry .rsgb-item {
	break-inside: avoid;
	margin-bottom: var(--rsgb-gap, 24px);
}

.rsgb.rsgb--liste .rsgb-grid {
	grid-template-columns: minmax(0, 1fr);
}

.rsgb .rsgb-loadmore {
	display: flex;
	justify-content: center;
}

/* Karussell und Galerie (Galerie = .rsgb-carousel--focus). */
.rsgb .rsgb-carousel {
	position: relative;
}

.rsgb .rsgb-track {
	position: relative;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--rsgb-cols, 3) - 1) * var(--rsgb-gap, 24px)) / var(--rsgb-cols, 3));
	gap: var(--rsgb-gap, 24px);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	align-items: start;
}

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

.rsgb .rsgb-slide {
	min-width: 0;
	scroll-snap-align: start;
}

.rsgb .rsgb-carousel--focus .rsgb-track {
	grid-auto-columns: min(560px, 70cqw);
	padding-left: calc((100cqw - min(560px, 70cqw)) / 2);
	padding-right: calc((100cqw - min(560px, 70cqw)) / 2);
}

.rsgb .rsgb-carousel--focus .rsgb-slide {
	scroll-snap-align: center;
}

.rsgb .rsgb-arrow {
	position: absolute;
	top: calc(50% - 26px);
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
}

.rsgb .rsgb-arrow svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.rsgb .rsgb-arrow[disabled] {
	opacity: 0;
	pointer-events: none;
}

.rsgb .rsgb-arrow--prev { left: 0; }
.rsgb .rsgb-arrow--next { right: 0; }

.rsgb .rsgb-dots {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

/* Laufband. */
.rsgb .rsgb-ticker {
	overflow: hidden;
}

.rsgb .rsgb-ticker__track {
	display: flex;
	width: max-content;
	animation: rsgb-tick calc(var(--rsgb-n, 6) * var(--rsgb-ticker-s, 6s)) linear infinite;
}

.rsgb .rsgb-ticker:hover .rsgb-ticker__track,
.rsgb .rsgb-ticker:focus-within .rsgb-ticker__track {
	animation-play-state: paused;
}

.rsgb .rsgb-ticker__set {
	display: flex;
	gap: var(--rsgb-gap, 24px);
	padding-right: var(--rsgb-gap, 24px);
}

.rsgb .rsgb-ticker .rsgb-slide {
	flex: none;
	width: var(--rsgb-ticker-w, 340px);
}

@keyframes rsgb-tick {
	to { transform: translateX(-50%); }
}

/* Badge. */
.rsgb .rsgb-badge-wrap { display: flex; }
.rsgb .rsgb-badge-wrap--mitte { justify-content: center; }
.rsgb .rsgb-badge-wrap--rechts { justify-content: flex-end; }
.rsgb .rsgb-badge { display: inline-flex; }

/* Schwebendes Widget mit Seitenfenster (offen: .rsgb-float.is-open). */
.rsgb.rsgb--schwebend {
	position: static;
	max-width: none;
}

.rsgb .rsgb-float {
	position: fixed;
	bottom: var(--rsgb-float-y, 20px);
	z-index: 99990;
}

.rsgb .rsgb-float--rechts { right: var(--rsgb-float-x, 20px); }
.rsgb .rsgb-float--links { left: var(--rsgb-float-x, 20px); }

.rsgb .rsgb-float__btn {
	display: inline-flex;
	align-items: center;
}

.rsgb .rsgb-panel__backdrop {
	position: fixed;
	inset: 0;
	z-index: 99991;
	opacity: 0;
	transition: opacity .25s ease;
}

.rsgb .rsgb-panel {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 99992;
	display: flex;
	flex-direction: column;
	width: min(440px, 100vw);
	transform: translateX(100%);
	transition: transform .3s ease;
}

.rsgb .rsgb-float--links .rsgb-panel {
	right: auto;
	left: 0;
	transform: translateX(-100%);
}

.rsgb .rsgb-float.is-open .rsgb-panel { transform: none; }
.rsgb .rsgb-float.is-open .rsgb-panel__backdrop { opacity: 1; }

.rsgb .rsgb-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.rsgb .rsgb-panel__close {
	display: flex;
	align-items: center;
	justify-content: center;
}

.rsgb .rsgb-panel__close svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

.rsgb .rsgb-panel__body {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.rsgb .rsgb-panel__list {
	display: flex;
	flex-direction: column;
}

@media (max-width: 640px) {
	.rsgb .rsgb-float--no-mobile { display: none; }
}

/* Vorschau im Backend: schwebendes Widget bleibt im Vorschaufenster. */
.rsgb.rsgb--preview .rsgb-float { position: static; }
.rsgb.rsgb--preview .rsgb-float__btn,
.rsgb.rsgb--preview .rsgb-panel,
.rsgb.rsgb--preview .rsgb-panel__backdrop { position: absolute; }
.rsgb.rsgb--preview .rsgb-float__btn { bottom: var(--rsgb-float-y, 20px); z-index: 1; }
.rsgb.rsgb--preview .rsgb-float--rechts .rsgb-float__btn { right: var(--rsgb-float-x, 20px); }
.rsgb.rsgb--preview .rsgb-float--links .rsgb-float__btn { left: var(--rsgb-float-x, 20px); }
.rsgb.rsgb--preview .rsgb-panel__backdrop { z-index: 2; }
.rsgb.rsgb--preview .rsgb-panel { z-index: 3; width: min(440px, 100%); }

@media (prefers-reduced-motion: reduce) {
	.rsgb .rsgb-ticker { overflow-x: auto; }
	.rsgb .rsgb-ticker__track { animation: none; }
	.rsgb .rsgb-ticker__set[aria-hidden] { display: none; }
	.rsgb .rsgb-track { scroll-behavior: auto; }
}

/* Hinweis in der Vorschau. */
.rsgb-notice {
	padding: 14px 18px;
	border: 1px dashed #c3c4c7;
	border-radius: 8px;
	background: #f6f7f7;
	color: #50575e;
	font-size: 14px;
}

/* Spalten nach Platz des Widgets (Container), nicht nach Bildschirm. */
@container rsgb (max-width: 1023px) {
	.rsgb .rsgb-grid { grid-template-columns: repeat(var(--rsgb-cols-t, 2), minmax(0, 1fr)); }
	.rsgb.rsgb--masonry .rsgb-grid { column-count: var(--rsgb-cols-t, 2); }
	.rsgb.rsgb--liste .rsgb-grid { grid-template-columns: minmax(0, 1fr); }
	.rsgb .rsgb-track { grid-auto-columns: calc((100% - (var(--rsgb-cols-t, 2) - 1) * var(--rsgb-gap, 24px)) / var(--rsgb-cols-t, 2)); }
	.rsgb .rsgb-carousel--focus .rsgb-track { grid-auto-columns: 78cqw; padding-left: 11cqw; padding-right: 11cqw; }
}

@container rsgb (max-width: 639px) {
	.rsgb .rsgb-grid { grid-template-columns: repeat(var(--rsgb-cols-m, 1), minmax(0, 1fr)); }
	.rsgb.rsgb--masonry .rsgb-grid { column-count: var(--rsgb-cols-m, 1); }
	.rsgb .rsgb-track { grid-auto-columns: calc((100% - (var(--rsgb-cols-m, 1) - 1) * var(--rsgb-gap, 24px)) / var(--rsgb-cols-m, 1)); }
	.rsgb .rsgb-carousel--focus .rsgb-track { grid-auto-columns: 86cqw; padding-left: 7cqw; padding-right: 7cqw; }
	.rsgb .rsgb-arrow { display: none; }
}
