/*
 * google-reviews.css — Google Business Profile reviews trust card (DEFAULT theme).
 * Owned sheet, BEM root `.google-reviews` (unprefixed — matches this theme's home-team.css
 * convention, not CBS's `.cbs-*` prefixing). Two composed variants: `--band` (homepage,
 * full-width, side-by-side at desktop) and `--compact` (services listing + areas asides,
 * boxed, single-column centred at every width). Tokens with literal fallbacks (tokens.css).
 *
 * Split plan: docs/theme-audits/stitch/SPLIT-PLAN-google-reviews-DEFAULT.md
 * Brief:      docs/theme-audits/stitch/STITCH-BRIEF-google-reviews-DEFAULT.md
 *
 * DEFAULT has no motion-programme JS grammar yet (cbs-motion.js does not exist on this
 * theme) — motion here is CSS-only and self-contained. Reduced-motion reset lives at the
 * head of the sheet, per house rule: final state instantly, not merely faster.
 */

@media (prefers-reduced-motion: reduce) {
  .google-reviews__panel,
  .google-reviews__title,
  .google-reviews__cta {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

.google-reviews {
  background: #ffffff;
  padding: clamp(2rem, 5vw, 3rem) 0;
}

.google-reviews__panel {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--bg-light, #f5f5f5);
  border: 1px solid var(--border-color, #e6e6e6);
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.google-reviews__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.google-reviews__heading-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.google-reviews__heading-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: var(--text-primary, #1a1a1a);
}

.google-reviews__title {
  margin: 0;
  font-family: 'Montserrat', var(--font-heading, sans-serif);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--text-primary, #1a1a1a);
}

.google-reviews__support {
  margin: 0;
  font-family: 'Open Sans', var(--font-body, sans-serif);
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  line-height: 1.6;
  color: var(--text-secondary, #4a5568);
  max-width: 48rem;
}

.google-reviews__rating {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.google-reviews__numeral {
  font-family: 'Montserrat', var(--font-heading, sans-serif);
  font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  line-height: 1;
  color: var(--text-primary, #1a1a1a);
}

.google-reviews__rating-detail {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.google-reviews__stars {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  /* Fixed height regardless of fill percentage — no layout shift (brief section 5). */
  height: 20px;
}

.google-reviews__star {
  position: relative;
  display: inline-flex;
  width: 20px;
  height: 20px;
}

.google-reviews__star-outline,
.google-reviews__star-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  display: inline-flex;
  align-items: center;
}

.google-reviews__star-outline {
  width: 100%;
  /* Light-canvas track — dark tint, NOT CBS's white-alpha (that would be invisible here). */
  color: #dcdcdc;
}

.google-reviews__star-fill {
  overflow: hidden;
  white-space: nowrap;
  color: var(--testimonial-star, #ffb74d);
}

.google-reviews__star-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.google-reviews__count {
  font-family: 'Open Sans', var(--font-body, sans-serif);
  font-size: 0.8125rem;
  /* NOT --text-muted (#718096) — measured live at 3.68:1 on this component's --bg-light
     panel (4.02:1 even on plain white), both fail 4.5:1 (the exact risk the brief flagged
     for this caption). #616f84 is a scoped-local darkening of the same hue, measured
     4.68:1 on --bg-light #f5f5f5 — clears the gate without touching the shared token. */
  color: #616f84;
}

.google-reviews__cta-wrap {
  flex-shrink: 0;
  display: flex;
}

.google-reviews__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.9rem 1.5rem;
  background: var(--green-600, #b33f00);
  color: #ffffff;
  font-family: 'Open Sans', var(--font-body, sans-serif);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border-radius: 0.375rem;
  border: none;
  transition: background-color 180ms ease;
  outline-offset: 2px;
}

.google-reviews__cta:hover,
.google-reviews__cta:focus-visible {
  background: var(--green-500, #d45400);
}

.google-reviews__cta:active {
  background: var(--green-700, #8f3200);
}

.google-reviews__cta:focus-visible {
  outline: 2px solid var(--green-700, #8f3200);
}

.google-reviews__cta-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .google-reviews__cta {
    transition: background-color 180ms ease, transform 180ms ease;
  }
  .google-reviews__cta:hover {
    transform: translateY(-0.15rem);
  }
}

/* ===== Band variant (homepage): side-by-side at desktop ===== */

.google-reviews--band .google-reviews__panel {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.google-reviews--band .google-reviews__body {
  flex: 1 1 auto;
}

@media (max-width: 991px) {
  .google-reviews--band .google-reviews__panel {
    flex-direction: column;
    align-items: stretch;
  }
  .google-reviews--band .google-reviews__cta-wrap {
    justify-content: stretch;
  }
  .google-reviews--band .google-reviews__cta {
    width: 100%;
  }
}

/* ===== Compact variant (services listing + areas asides): boxed, centred, tighter ===== */

.google-reviews--compact {
  padding: clamp(1.25rem, 3vw, 2rem) 0;
}

.google-reviews--compact .google-reviews__panel {
  max-width: 42rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.google-reviews--compact .google-reviews__body {
  align-items: center;
}

.google-reviews--compact .google-reviews__heading-row,
.google-reviews--compact .google-reviews__support {
  justify-content: center;
  text-align: center;
}

.google-reviews--compact .google-reviews__title {
  font-size: clamp(1.375rem, 3vw, 1.75rem);
}

.google-reviews--compact .google-reviews__rating {
  flex-direction: column;
  gap: 0.5rem;
}

.google-reviews--compact .google-reviews__rating-detail {
  align-items: center;
}

.google-reviews--compact .google-reviews__cta {
  width: 100%;
  max-width: 22rem;
}

@media (min-width: 480px) {
  .google-reviews--compact .google-reviews__rating {
    flex-direction: row;
    justify-content: center;
  }
}

/* ===== Entrance — CSS-only scroll-driven fade-up, section wrapper + heading only.
   Self-contained precedent (DEFAULT has no motion-programme JS grammar yet — see split
   plan "Motion hooks" section for the open integration decision this leaves for the
   theme's future motion-programme lane). ===== */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .google-reviews__panel,
    .google-reviews__title {
      animation: google-reviews-fade-up linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 30%;
    }
  }
}

@keyframes google-reviews-fade-up {
  from {
    opacity: 0;
    transform: translateY(2.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
