/* =========================================================
   Google-Bewertungen block (Bewertungen / Otzyvy pages)
   Scoped under .gr-section. Uses the global Premium Anthracite
   tokens (--pa-*) defined in design-system.css.
   ========================================================= */

.gr-section {
  padding: 48px 0 32px;
  background: var(--pa-bg, #ffffff);
}

.gr-card {
  background:    var(--pa-bg, #ffffff);
  border:        1px solid var(--pa-border, #e5e7eb);
  border-radius: var(--pa-radius-card, 8px);
  box-shadow:    var(--pa-shadow-card, 0 1px 6px rgba(0,0,0,.07));
  padding:       28px;
}

/* Centered variant — used on /de/bewertungen + /ru/otzyvy.
   Block is centered as a whole; inner rows (cards, summary, read-link,
   CTA) stack vertically and align to the centre on every breakpoint.
   Width raised to 880px so 3 review cards fit comfortably on desktop. */
.gr-card--centered {
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* ── Header ──────────────────────────────────────────────── */
.gr-header {
  display:        flex;
  align-items:    center;
  gap:            16px;
  margin-bottom:  20px;
}

.gr-card--centered .gr-header {
  flex-direction: column;
  text-align:     center;
  gap:            10px;
}

.gr-header__icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gr-header__icon svg {
  width: 40px;
  height: 40px;
  display: block;
}

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

.gr-title {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.2;
  color: var(--pa-text, #1f2937);
}

.gr-subline {
  margin: 0;
  color: var(--pa-text-muted, #6b7280);
  font-size: 14px;
  line-height: 1.45;
}

/* ── Summary line ────────────────────────────────────────── */
.gr-summary {
  display:        flex;
  flex-wrap:      wrap;
  align-items:    center;
  gap:            16px 22px;
  padding:        16px 0 20px;
  border-bottom:  1px solid var(--pa-border, #e5e7eb);
  margin-bottom:  24px;
}

.gr-card--centered .gr-summary {
  flex-direction:  column;
  justify-content: center;
  gap:             10px;
}

.gr-summary__rating { display: inline-flex; align-items: baseline; }

.gr-rating-num {
  font-size: 36px;
  font-weight: 700;
  color: var(--pa-text, #1f2937);
  line-height: 1;
}

/* Star bar (uses overlaid mask to allow half-star display) */
.gr-stars {
  position: relative;
  display: inline-block;
  font-size: 26px;
  line-height: 1;
  letter-spacing: 2px;
  color: var(--pa-border, #e5e7eb);
}
.gr-stars__base { color: var(--pa-border, #e5e7eb); }
.gr-stars__fill {
  position: absolute;
  inset: 0;
  color: var(--pa-accent, #c9a666);
  overflow: hidden;
  white-space: nowrap;
}

.gr-count {
  margin: 0;
  color: var(--pa-text-muted, #6b7280);
  font-size: 14px;
}

.gr-fallback {
  margin: 0;
  color: var(--pa-text-muted, #6b7280);
  font-size: 15px;
}

/* ── Read-reviews link (centered card) ──────────────────────
   Opens the Google Business profile / reviews. Distinct from the
   "leave a review" CTA below. Underlined link → not a button. */
.gr-card--centered .gr-readlink {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  gap:             6px;
  margin:          -8px auto 18px;
  color:           var(--pa-primary, #374151);
  font-size:       14px;
  font-weight:     600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition:      color .15s ease;
}
.gr-card--centered .gr-readlink:hover,
.gr-card--centered .gr-readlink:focus-visible {
  color:           var(--pa-accent-text, #8a6a2f);
  text-decoration: underline;
}
.gr-card--centered .gr-readlink__arrow { line-height: 1; }

/* ── CTA — "leave a review on Google" ─────────────────────── */
.gr-cta {
  display: inline-block;
  background: var(--pa-accent, #c9a666);
  color: #fff !important;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: var(--pa-radius-btn, 6px);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  border: 1px solid var(--pa-accent, #c9a666);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.gr-cta:hover,
.gr-cta:focus-visible {
  background: var(--pa-accent-dark, #b8935a);
  border-color: var(--pa-accent-dark, #b8935a);
  color: #fff !important;
  text-decoration: none;
}

/* Bottom-centered CTA row (centered card only). */
.gr-card--centered .gr-cta-row {
  display:         flex;
  justify-content: center;
  margin-top:      4px;
}
.gr-card--centered .gr-cta-row .gr-cta {
  min-width: 240px;
  text-align: center;
}

/* ── Reviews carousel — seamless CSS marquee ──────────────
   Cards sit ABOVE the rating/count summary in the centered card.
   No visible scrollbar; no JS; horizontal motion bounded inside
   .gr-reviews (page itself never gets a horizontal scrollbar).
   The track contains two copies of the cards; CSS animates
   translateX from 0 to -50% so the loop is seamless.
   Pauses on hover / focus-within. prefers-reduced-motion: reduce
   replaces the animation with a static wrapped grid (see below). */
.gr-reviews {
  position: relative;
  overflow: hidden;                     /* hides any track overflow + native scrollbar */
  margin: 0 -8px 24px;
  /* Subtle fade at the left/right edges to hint motion. */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}

.gr-track {
  list-style: none;
  margin: 0;
  padding: 4px 0 8px;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 16px;
  width: max-content;
  animation: gr-marquee 60s linear infinite;
  will-change: transform;
}

/* Pause on user intent — hover OR keyboard focus inside the carousel. */
.gr-reviews:hover .gr-track,
.gr-reviews:focus-within .gr-track {
  animation-play-state: paused;
}

.gr-card-item {
  flex: 0 0 264px;                       /* fixed card width on desktop */
  min-width: 0;
  display: flex;                          /* stretch link/review to full height */
}

/* Marquee keyframes — list is doubled, so -50% snaps back to a
   visually identical position (first card of mirror copy aligns
   with first card of original copy). */
@keyframes gr-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Clickable card wrapper. Whole card is a link to
   GOOGLE_REVIEW_READ_URL when configured. */
.gr-review-link {
  display: flex;
  flex: 1;
  width: 100%;
  color: inherit;
  text-decoration: none;
  border-radius: var(--pa-radius-card, 8px);
  transition: transform .15s ease, box-shadow .15s ease;
}
.gr-review-link:hover,
.gr-review-link:focus-visible {
  color: inherit;
  text-decoration: none;
}
.gr-review-link:hover .gr-review,
.gr-review-link:focus-visible .gr-review {
  border-color: var(--pa-accent, #c9a666);
  box-shadow: var(--pa-shadow-card, 0 1px 6px rgba(0,0,0,.07));
}
.gr-review-link:focus-visible {
  outline: 2px solid var(--pa-accent, #c9a666);
  outline-offset: 2px;
}

.gr-review {
  flex: 1;
  width: 100%;
  text-align: left;
  background: var(--pa-bg-alt, #f9f8f6);
  border: 1px solid var(--pa-border, #e5e7eb);
  border-radius: var(--pa-radius-card, 8px);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.gr-review__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.gr-review__author { display: flex; flex-direction: column; min-width: 0; }

.gr-review__name {
  font-weight: 600;
  color: var(--pa-text, #1f2937);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.gr-review__date {
  font-size: 12px;
  color: var(--pa-text-muted, #6b7280);
}

.gr-review__stars {
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--pa-border, #e5e7eb);
  white-space: nowrap;
}
.gr-star--gold { color: var(--pa-accent, #c9a666); }

.gr-review__text {
  margin: 0;
  color: var(--pa-text, #1f2937);
  font-size: 14px;
  line-height: 1.55;
  /* Cap visual height on desktop to keep grid rows even */
  display: -webkit-box;
  -webkit-line-clamp: 7;
  line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gr-review__link {
  margin-top: auto;
  font-size: 13px;
  color: var(--pa-primary, #374151);
  text-decoration: none;
}
.gr-review__link:hover { color: var(--pa-accent, #c9a666); text-decoration: underline; }

/* Accessibility helper */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Tablet (≤ 900px) ─────────────────────────────────────── */
@media (max-width: 900px) {
  .gr-card { padding: 22px 18px; }

  .gr-summary { gap: 12px 16px; }
  .gr-rating-num { font-size: 30px; }
  .gr-stars { font-size: 22px; }

  /* Centered card: CTA full-width-but-bounded — no horizontal scroll. */
  .gr-card--centered .gr-cta-row .gr-cta {
    width: 100%;
    max-width: 320px;
    min-width: 0;
    box-sizing: border-box;
  }
  .gr-card--centered .gr-readlink { font-size: 13.5px; }

  .gr-card-item { flex: 0 0 260px; }
}

/* ── Mobile (≤ 600px) ─────────────────────────────────────── */
@media (max-width: 600px) {
  .gr-card-item { flex: 0 0 250px; }
  .gr-review__text {
    -webkit-line-clamp: 8;
    line-clamp: 8;
  }
}

@media (max-width: 480px) {
  .gr-header { gap: 12px; }
  .gr-title  { font-size: 20px; }
  .gr-card-item { flex: 0 0 240px; }
}

/* ── Reduced-motion fallback ──────────────────────────────────
   No auto-marquee; cards wrap into a static grid and the
   duplicate mirror copies are hidden so screen readers see only
   the original 6 cards. */
@media (prefers-reduced-motion: reduce) {
  .gr-reviews {
    overflow: visible;
    -webkit-mask-image: none;
            mask-image: none;
  }
  .gr-track {
    animation: none !important;
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }
  .gr-card-item {
    flex: 1 1 240px;
    max-width: 280px;
  }
  .gr-card-item--mirror { display: none !important; }
}
