/*
 * Alber Marketing Google Bewertungen – Frontend
 * Alles läuft über CSS-Variablen (--agr-*), die das Plugin pro Profil setzt.
 * Container Queries sorgen dafür, dass das Widget auch in schmalen Spalten gut aussieht.
 */

.agr {
	--agr-accent: #1a73e8;
	--agr-on-accent: #fff;
	--agr-star: #fbbc04;
	--agr-star-off: rgba(120, 130, 150, .28);
	--agr-surface: #fff;
	--agr-line: rgba(15, 23, 42, .1);
	--agr-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 12px 32px -14px rgba(15, 23, 42, .22);
	--agr-radius: 18px;
	--agr-gap: 16px;
	--agr-star-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E");

	container: agr / inline-size;
	display: block;
	width: 100%;
	margin: 0;
	color: var(--agr-ink, inherit);
	line-height: 1.45;
	text-align: left;
	-webkit-font-smoothing: antialiased;
}

.agr[data-theme="dark"] {
	--agr-ink: #eef2fb;
	--agr-surface: #141c2e;
	--agr-line: rgba(255, 255, 255, .13);
	--agr-star-off: rgba(255, 255, 255, .22);
	--agr-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -14px rgba(0, 0, 0, .65);
}

.agr[data-layout="badge"] { max-width: 440px; }
.agr[data-align="center"] { margin-inline: auto; text-align: center; }

/* Reset gegen Theme-Einflüsse */
.agr *, .agr *::before, .agr *::after { box-sizing: border-box; }
.agr p { margin: 0; padding: 0; }
.agr a { box-shadow: none; }
.agr a:focus-visible, .agr button:focus-visible, .agr .agr-track:focus-visible {
	outline: 2px solid var(--agr-accent);
	outline-offset: 2px;
}
.agr-sr {
	position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.agr .agr-title {
	margin: 0 0 14px;
	font-size: 1.3em;
	font-weight: 700;
	line-height: 1.25;
}

/* ------------------------------------------------------------ Karte */

.agr-box {
	background: var(--agr-surface);
	border: 1px solid var(--agr-line);
	border-radius: var(--agr-radius);
	box-shadow: var(--agr-shadow);
}

.agr-summary {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
	padding: 22px;
}
.agr[data-align="center"] .agr-summary { align-items: center; }

.agr-brand {
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
}
.agr[data-align="center"] .agr-brand { flex-direction: column; gap: 10px; }

.agr-logo {
	flex: none;
	display: grid;
	place-items: center;
	width: 60px;
	height: 60px;
	padding: 6px;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--agr-line);
	border-radius: 16px;
}
.agr .agr-logo-img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: contain;
	border-radius: 0;
}

.agr .agr-name {
	font-size: 1.12em;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -.005em;
	overflow-wrap: anywhere;
}
.agr .agr-source {
	display: flex;
	align-items: center;
	gap: 7px;
	margin-top: 4px;
	font-size: .8em;
	opacity: .7;
}
.agr[data-align="center"] .agr-source { justify-content: center; }
.agr .agr-g { flex: none; display: block; width: 16px; height: 16px; }

.agr-rating { display: flex; flex-direction: column; align-items: inherit; gap: 6px; min-width: 0; }
.agr-rate {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 14px;
}
.agr[data-align="center"] .agr-rate { justify-content: center; }

.agr .agr-score {
	font-size: 2.9em;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -.035em;
	font-variant-numeric: tabular-nums;
}

.agr .agr-stars {
	--agr-fill: 100%;
	display: inline-block;
	flex: none;
	width: 5em;
	height: 1em;
	font-size: 1.45em;
	background: linear-gradient(90deg, var(--agr-star) var(--agr-fill), var(--agr-star-off) var(--agr-fill));
	-webkit-mask: var(--agr-star-mask) 0 0 / 1em 1em repeat-x;
	mask: var(--agr-star-mask) 0 0 / 1em 1em repeat-x;
}
.agr .agr-stars--sm { font-size: 1.1em; }

.agr a.agr-count, .agr span.agr-count {
	color: inherit;
	font-size: .94em;
	text-decoration: none;
	opacity: .8;
}
.agr a.agr-count:hover { opacity: 1; text-decoration: underline; }
.agr .agr-count strong { font-weight: 700; }

.agr a.agr-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: stretch;
	gap: 10px;
	margin-top: 4px;
	padding: .85em 1.3em;
	background: var(--agr-accent);
	border: 0;
	border-radius: 999px;
	color: var(--agr-on-accent);
	font-size: .94em;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 8px 18px -8px var(--agr-accent);
	transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}
.agr a.agr-btn:hover {
	color: var(--agr-on-accent);
	filter: brightness(1.06);
	transform: translateY(-1px);
}
.agr a.agr-btn:active { transform: none; }
.agr a.agr-btn .agr-g {
	box-sizing: content-box;
	width: 16px;
	height: 16px;
	padding: 3px;
	background: #fff;
	border-radius: 50%;
}

/* ------------------------------------------------------ Rezensionen */

.agr-reviews { margin-top: var(--agr-gap); }

.agr-card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
	padding: 20px;
	background: var(--agr-surface);
	border: 1px solid var(--agr-line);
	border-radius: var(--agr-radius);
	box-shadow: var(--agr-shadow);
	text-align: left;
}

.agr-card-head { display: flex; align-items: center; gap: 12px; }
.agr-card-head .agr-g { margin-left: auto; opacity: .9; }

.agr-avatar {
	flex: none;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	color: #fff;
	font-size: 1.05em;
	font-weight: 700;
	line-height: 1;
}

.agr-who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.agr .agr-author {
	overflow: hidden;
	color: inherit;
	font-size: .97em;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.agr a.agr-author:hover { text-decoration: underline; }
.agr .agr-date { font-size: .8em; opacity: .62; }

.agr .agr-text { font-size: .94em; line-height: 1.6; }
.agr .agr-text p {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 6;
	line-clamp: 6;
	overflow: hidden;
	overflow-wrap: anywhere;
}
.agr .agr-card.is-open .agr-text p {
	display: block;
	-webkit-line-clamp: unset;
	line-clamp: unset;
}
.agr .agr-more {
	margin: 6px 0 0;
	padding: 0;
	background: none;
	border: 0;
	color: inherit;
	font: inherit;
	font-size: .88em;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
	opacity: .85;
	cursor: pointer;
}
.agr .agr-more:hover { opacity: 1; }

/* Raster / Liste */
.agr-reviews--grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
	gap: var(--agr-gap);
}
.agr-reviews--list { display: flex; flex-direction: column; gap: var(--agr-gap); }

/* Slider */
.agr-track {
	display: flex;
	gap: var(--agr-gap);
	margin: -12px -14px 0;
	padding: 12px 14px 28px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 14px;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.agr-track::-webkit-scrollbar { display: none; }
.agr-track > .agr-card {
	flex: 0 0 calc((100% - 2 * var(--agr-gap)) / 3);
	scroll-snap-align: start;
}

.agr-pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin-top: -6px;
}
.agr-pager[hidden] { display: none; }
.agr .agr-pos { min-width: 5.5em; font-size: .85em; text-align: center; opacity: .7; font-variant-numeric: tabular-nums; }
.agr .agr-nav {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	margin: 0;
	padding: 0;
	background: var(--agr-surface);
	border: 1px solid var(--agr-line);
	border-radius: 50%;
	box-shadow: var(--agr-shadow);
	color: inherit;
	cursor: pointer;
	transition: transform .16s ease, opacity .16s ease;
}
.agr .agr-nav:hover:not(:disabled) { transform: scale(1.07); }
.agr .agr-nav:disabled { opacity: .35; cursor: default; box-shadow: none; }
.agr .agr-nav--prev svg { transform: rotate(180deg); }

/* ------------------------------------------------ Container Queries */

@container agr (max-width: 900px) {
	.agr-track > .agr-card { flex-basis: calc((100% - var(--agr-gap)) / 2); }
}
@container agr (max-width: 560px) {
	.agr-track > .agr-card { flex-basis: 88%; }
	.agr-summary { padding: 18px; }
}
@container agr (min-width: 680px) {
	.agr:not([data-layout="badge"]) .agr-summary {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 16px 28px;
		padding: 24px 28px;
		text-align: left;
	}
	.agr:not([data-layout="badge"]) .agr-brand { flex: 1 1 auto; flex-direction: row; gap: 16px; text-align: left; }
	.agr:not([data-layout="badge"]) .agr-source { justify-content: flex-start; }
	.agr:not([data-layout="badge"]) .agr-rating { align-items: flex-start; flex: none; }
	.agr:not([data-layout="badge"]) .agr-rate { justify-content: flex-start; }
	.agr:not([data-layout="badge"]) a.agr-btn { align-self: center; margin-top: 0; flex: none; }
}

/* ----------------------------------------------------------- Hinweis */

.agr-notice {
	padding: 12px 14px;
	background: #fff7f7;
	border: 1px dashed #d63638;
	border-radius: 8px;
	color: #8a1f1f;
	font-size: 13px;
	line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
	.agr *, .agr *::before, .agr *::after { transition: none !important; scroll-behavior: auto !important; }
}
