/**
 * Google Rezensionen Component - Stylesheet
 * Gestaltung passend zum Hauptstylesheet; Komponenten-Tokens bleiben überschreibbar.
 */

:root {
  /* Komponent-Tokens orientieren sich an main.css und bleiben überschreibbar. */
  --gr-bg: var(--white, #ffffff);
  --gr-card-bg: var(--white, #ffffff);
  --gr-card-border: var(--border, #e0e0e0);
  --gr-card-radius: var(--radius-lg, 12px);
  --gr-card-shadow: var(--shadow, 0 4px 12px rgba(0, 0, 0, 0.08));
  --gr-text-main: var(--text, #3a3a3a);
  --gr-text-muted: var(--muted, #757575);
  --gr-text-date: var(--muted, #757575);
  --gr-star-filled: var(--gold, #dfc787);
  --gr-star-empty: var(--border, #e0e0e0);
  --gr-badge-bg: var(--bg-lighter, #f4f4f4);
  --gr-accent: var(--gold-deep, #81602f);
  --gr-font: var(--font-body, 'Figtree', system-ui, sans-serif);
}

.gr-container {
  font-family: var(--gr-font);
  color: var(--gr-text-main);
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  box-sizing: border-box;
}

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

/* Header & Gesamtbewertung */
.gr-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--gr-card-border);
}

.gr-header-title {
  font-family: var(--font-head, 'Poppins', system-ui, sans-serif);
  font-size: 1.875rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: var(--dark, #2b2b2b);
}

.gr-badge-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--gr-badge-bg);
  border: 1px solid var(--gr-card-border);
  padding: 0.6rem 1rem;
  border-radius: var(--radius, 6px);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.gr-badge-summary:focus-visible {
  outline: 3px solid var(--gold-deep, #81602f);
  outline-offset: 2px;
}

.gr-badge-summary:hover {
  background: var(--bg-light, #efefef);
  border-color: var(--gold, #dfc787);
  box-shadow: var(--shadow, 0 4px 12px rgba(0, 0, 0, 0.08));
}

.gr-score-number {
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
}

.gr-stars {
  display: inline-flex;
  gap: 2px;
  color: var(--gr-star-filled);
  font-size: 1rem;
  line-height: 1;
}

.gr-star-empty {
  color: var(--gr-star-empty);
}

.gr-count {
  font-size: 0.875rem;
  color: var(--gr-text-muted);
}

.gr-google-logo {
  display: inline-flex;
  align-items: center;
  margin-left: 0.25rem;
}

/* Grid der Karten */
.gr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Einzelne Karte */
.gr-card {
  background: var(--gr-card-bg);
  border: 1px solid var(--gr-card-border);
  border-radius: var(--gr-card-radius);
  padding: 1.5rem;
  box-shadow: var(--gr-card-shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, border-color 0.2s;
  position: relative;
}

.gr-card:hover {
  border-color: var(--gold, #dfc787);
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.12));
}

/* User-Info Kopfzeile */
.gr-card-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 0.875rem;
}

.gr-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background-color: var(--bg-light, #efefef);
  border: 1px solid var(--gr-card-border);
}

.gr-author-meta {
  flex: 1;
  min-width: 0;
}

.gr-author-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gr-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

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

.gr-author-name a:hover {
  text-decoration: underline;
}

.gr-review-date {
  font-size: 0.75rem;
  color: var(--gr-text-date);
  margin-top: 2px;
}

.gr-card-stars {
  margin-bottom: 0.875rem;
}

/* Rezensionstext & Auslaufen / Fade-Out */
.gr-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.gr-text-wrapper {
  position: relative;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

/* Wenn Text abgeschnitten ist: feste max-height und sanfter Verlauf */
.gr-text-wrapper.is-collapsed {
  max-height: 5.5em; /* ca. 3–4 Textzeilen */
}

.gr-text-wrapper.is-collapsed::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2.75em;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--gr-card-bg));
  pointer-events: none;
}

.gr-text {
  font-size: 0.925rem;
  line-height: 1.55;
  color: var(--gr-text-main);
  margin: 0;
  white-space: pre-line;
  word-break: break-word;
}

/* "Mehr anzeigen" Toggle-Button */
.gr-toggle-btn {
  background: none;
  border: none;
  padding: 0.5rem 0 0 0;
  margin-top: 0.25rem;
  color: var(--gr-accent);
  font-family: var(--font-body, 'Figtree', system-ui, sans-serif);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius, 6px);
  align-self: flex-start;
  transition: opacity 0.15s ease;
}

.gr-toggle-btn:focus-visible {
  outline: 3px solid var(--gold-deep, #81602f);
  outline-offset: 2px;
}

.gr-toggle-btn:hover {
  text-decoration: underline;
  color: var(--gold-deep, #81602f);
}

/* Footer / Hinweis */
.gr-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--gr-text-muted);
}

.gr-footer a {
  color: var(--gr-accent);
  text-decoration: none;
}

.gr-footer a:hover {
  text-decoration: underline;
}

/* Lade- und Fehlerzustände */
.gr-loading,
.gr-error,
.gr-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gr-text-muted);
  font-size: 0.95rem;
}

.gr-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--gr-card-border);
  border-top-color: var(--gold-deep, #81602f);
  border-radius: 50%;
  animation: gr-spin 0.8s linear infinite;
  margin: 0 auto 1rem auto;
}

@keyframes gr-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .gr-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .gr-grid {
    grid-template-columns: 1fr;
  }
}


