/* ============================================================
   Google Reviews — Glass + Material 3 Expressive
   ============================================================ */

/* --- Tokens --- */
.gr3 {
  --gr-font: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --gr-surface: rgba(255, 255, 255, 0.72);
  --gr-surface-card: rgba(255, 255, 255, 0.55);
  --gr-surface-hover: rgba(255, 255, 255, 0.82);
  --gr-on-surface: #1a1c1e;
  --gr-on-surface-sub: #5f6368;
  --gr-outline: rgba(0, 0, 0, 0.08);
  --gr-outline-strong: rgba(0, 0, 0, 0.14);
  --gr-star: #f9ab00;
  --gr-star-off: #dadce0;
  --gr-accent: #1a73e8;
  --gr-accent-container: rgba(26, 115, 232, 0.08);
  --gr-on-accent: #ffffff;
  --gr-blur: 20px;
  --gr-radius-xl: 24px;
  --gr-radius-lg: 16px;
  --gr-radius-md: 12px;
  --gr-shadow-ambient: 0 1px 3px rgba(0,0,0,0.04);
  --gr-shadow-key: 0 4px 16px rgba(0,0,0,0.06);
  --gr-shadow-elevated: 0 8px 32px rgba(0,0,0,0.10);
  --gr-ease: cubic-bezier(0.2, 0, 0, 1);
  --gr-duration: 0.35s;
  --gr-duration-short: 0.2s;

  font-family: var(--gr-font);
  color: var(--gr-on-surface);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  border-radius: var(--gr-radius-xl);
  background: var(--gr-surface);
  backdrop-filter: blur(var(--gr-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--gr-blur)) saturate(1.4);
  border: 1px solid var(--gr-outline);
  box-shadow: var(--gr-shadow-ambient), var(--gr-shadow-key);
  overflow: hidden;
}

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

/* --- Entrance animation --- */
.gr3 {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--gr-ease), transform 0.6s var(--gr-ease);
}
.gr3.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ============================================================
   Header
   ============================================================ */

.gr3-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gr-outline);
  flex-wrap: wrap;
}

.gr3-header-info { flex: 1; min-width: 0; }

.gr3-place {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.gr3-glogo { height: 22px; width: auto; }

.gr3-place-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gr3-score {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.gr3-score-num {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--gr-on-surface);
}

.gr3-score-count {
  font-size: 13px;
  color: var(--gr-on-surface-sub);
  margin-left: 2px;
}

/* --- CTA: Expressive prominence --- */
.gr3-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--gr-accent);
  color: var(--gr-on-accent);
  border: none;
  border-radius: 100px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(26, 115, 232, 0.3), 0 4px 12px rgba(26, 115, 232, 0.15);
  transition:
    transform var(--gr-duration-short) var(--gr-ease),
    box-shadow var(--gr-duration-short) var(--gr-ease),
    background var(--gr-duration-short);
}

.gr3-cta:hover, .gr3-cta:focus-visible {
  background: #1557b0;
  color: var(--gr-on-accent);
  text-decoration: none;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 2px 6px rgba(26, 115, 232, 0.35), 0 8px 24px rgba(26, 115, 232, 0.2);
}

.gr3-cta:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 1px 2px rgba(26, 115, 232, 0.3);
}

.gr3-cta:visited { color: var(--gr-on-accent); }

.gr3-cta i { font-size: 13px; }


/* ============================================================
   Stars
   ============================================================ */

.gr3-stars {
  display: inline-flex;
  gap: 1px;
  vertical-align: middle;
  line-height: 1;
}

.gr3-stars .fas,
.gr3-stars .far {
  font-size: 15px;
  color: var(--gr-star);
  filter: drop-shadow(0 1px 2px rgba(249, 171, 0, 0.3));
  transition: transform var(--gr-duration-short) var(--gr-ease);
}

.gr3-stars .far { color: var(--gr-star-off); filter: none; }

.gr3-card:hover .gr3-stars .fas {
  transform: scale(1.1);
}


/* ============================================================
   Slider / Track
   ============================================================ */

.gr3-track-wrap {
  position: relative;
  overflow: hidden;
  padding: 16px 48px;
}

.gr3-track {
  display: flex;
  transition: transform var(--gr-duration) var(--gr-ease);
  will-change: transform;
}


/* ============================================================
   Card — Glassmorphism
   ============================================================ */

.gr3-card {
  flex: 0 0 calc(33.333% - 12px);
  margin: 0 6px;
  padding: 20px;
  background: var(--gr-surface-card);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid var(--gr-outline);
  border-radius: var(--gr-radius-lg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  position: relative;
  box-shadow: var(--gr-shadow-ambient);
  transition:
    transform var(--gr-duration) var(--gr-ease),
    box-shadow var(--gr-duration) var(--gr-ease),
    background var(--gr-duration) var(--gr-ease),
    border-color var(--gr-duration-short);
  /* stagger entrance */
  opacity: 0;
  animation: gr3CardIn 0.5s var(--gr-ease) forwards;
  animation-delay: calc(var(--i, 0) * 0.07s);
}

@keyframes gr3CardIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.gr3-card:hover {
  background: var(--gr-surface-hover);
  border-color: var(--gr-outline-strong);
  box-shadow: var(--gr-shadow-ambient), var(--gr-shadow-key);
  transform: translateY(-4px);
}

.gr3-card:focus-within {
  outline: 2px solid var(--gr-accent);
  outline-offset: 2px;
}

/* --- User --- */
.gr3-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gr3-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.7);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.gr3-avatar--init {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--gr-on-accent);
  background: linear-gradient(135deg, #4285f4, #34a853);
  border: none;
}

.gr3-user-meta { flex: 1; min-width: 0; }

.gr3-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--gr-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gr3-name a { color: inherit; text-decoration: none; }
.gr3-name a:hover { color: var(--gr-accent); }

.gr3-time {
  font-size: 12px;
  color: var(--gr-on-surface-sub);
  display: block;
  margin-top: 1px;
}

/* --- Rating row --- */
.gr3-rating { line-height: 1; }

/* --- Text --- */
.gr3-text {
  font-size: 14px;
  line-height: 1.65;
  color: #3c4043;
  max-height: 5em;
  overflow: hidden;
  position: relative;
  transition: max-height var(--gr-duration) var(--gr-ease);
  flex: 1;
}

.gr3-text.is-expanded { max-height: 600px; }

.gr3-read-more {
  background: none;
  border: none;
  padding: 2px 0;
  font-size: 13px;
  color: var(--gr-accent);
  cursor: pointer;
  font-weight: 500;
  transition: color var(--gr-duration-short);
}

.gr3-read-more:hover { text-decoration: underline; }
.gr3-read-more:focus-visible { outline: 2px solid var(--gr-accent); outline-offset: 2px; border-radius: 3px; }

/* --- Source badge --- */
.gr3-source {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--gr-on-surface-sub);
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--gr-outline);
}

.gr3-g-icon { flex-shrink: 0; }


/* ============================================================
   Navigation
   ============================================================ */

.gr3-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gr-surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--gr-outline-strong);
  box-shadow: var(--gr-shadow-ambient), var(--gr-shadow-key);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gr-on-surface);
  padding: 0;
  transition:
    transform var(--gr-duration-short) var(--gr-ease),
    box-shadow var(--gr-duration-short) var(--gr-ease),
    background var(--gr-duration-short);
}

.gr3-nav:hover {
  background: var(--gr-surface-hover);
  box-shadow: var(--gr-shadow-elevated);
  transform: translateY(-50%) scale(1.08);
}

.gr3-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.gr3-nav:focus-visible {
  outline: 2px solid var(--gr-accent);
  outline-offset: 2px;
}

.gr3-nav--prev { left: 6px; }
.gr3-nav--next { right: 6px; }

/* --- Dots (pagination indicator) --- */
.gr3-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding-top: 12px;
}

.gr3-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gr-star-off);
  border: none;
  padding: 0;
  cursor: pointer;
  transition:
    background var(--gr-duration-short) var(--gr-ease),
    transform var(--gr-duration-short) var(--gr-ease),
    width var(--gr-duration-short) var(--gr-ease);
}

.gr3-dot:hover { background: var(--gr-on-surface-sub); }

.gr3-dot.is-active {
  background: var(--gr-accent);
  width: 20px;
  border-radius: 4px;
}

.gr3-dot:focus-visible {
  outline: 2px solid var(--gr-accent);
  outline-offset: 2px;
}


/* ============================================================
   Footer
   ============================================================ */

.gr3-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid var(--gr-outline);
  font-size: 13px;
}

.gr3-more {
  color: var(--gr-accent);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--gr-duration-short) var(--gr-ease);
}

.gr3-more:hover { gap: 8px; text-decoration: none; }
.gr3-more:focus-visible { outline: 2px solid var(--gr-accent); outline-offset: 2px; border-radius: 3px; }

.gr3-powered {
  font-size: 11px;
  color: var(--gr-on-surface-sub);
}

.gr3-powered a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--gr-duration-short);
}

.gr3-powered a:hover { color: var(--gr-on-surface); }

.gr3-hiidel { height: 14px; width: auto; vertical-align: middle; }


/* ============================================================
   Notice / Error
   ============================================================ */

.gr3-notice {
  padding: 16px 20px;
  background: var(--gr-accent-container);
  color: var(--gr-accent);
  border: 1px solid rgba(26, 115, 232, 0.2);
  border-radius: var(--gr-radius-md);
  font-size: 14px;
  line-height: 1.5;
}


/* ============================================================
   Accessibility: Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .gr3,
  .gr3-card,
  .gr3-cta,
  .gr3-nav,
  .gr3-dot,
  .gr3-stars .fas,
  .gr3-track,
  .gr3-text,
  .gr3-more {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .gr3 { opacity: 1; transform: none; }
  .gr3-card { opacity: 1; animation: none; }
}


/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 992px) {
  .gr3-card {
    flex: 0 0 calc(50% - 12px);
  }
}

@media (max-width: 768px) {
  .gr3-header {
    padding: 16px 20px;
    gap: 12px;
  }

  .gr3-place-name { font-size: 15px; }
  .gr3-score-num { font-size: 24px; }

  .gr3-cta {
    padding: 10px 18px;
    font-size: 13px;
  }

  .gr3-card {
    flex: 0 0 calc(50% - 12px);
  }

  .gr3-track-wrap {
    padding: 12px 44px;
  }

  .gr3-nav {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 480px) {
  .gr3 { border-radius: var(--gr-radius-lg); }

  .gr3-header {
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .gr3-cta {
    width: 100%;
    justify-content: center;
  }

  .gr3-card {
    flex: 0 0 calc(50% - 10px);
    margin: 0 5px;
    padding: 14px;
    font-size: 13px;
  }

  .gr3-card .gr3-avatar { width: 32px; height: 32px; }
  .gr3-card .gr3-name { font-size: 12px; }
  .gr3-card .gr3-time { font-size: 11px; }
  .gr3-card .gr3-text { font-size: 12px; }
  .gr3-card .gr3-source { font-size: 10px; }

  .gr3-track-wrap { padding: 10px 40px; }

  .gr3-footer {
    padding: 12px 16px;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
}


/* ============================================================
   High Contrast mode
   ============================================================ */

@media (forced-colors: active) {
  .gr3-card { border: 2px solid CanvasText; }
  .gr3-nav { border: 2px solid CanvasText; }
  .gr3-cta { border: 2px solid LinkText; }
  .gr3-dot.is-active { background: LinkText; }
}
