/**
 * Google reviews section.
 *
 * Every colour and font comes from a custom property with a fallback, so a
 * theme can restyle the whole thing without touching PHP - in Breakdance,
 * setting --ruxbo-reviews-accent to a Global Colour in the Section's custom
 * CSS is enough.
 *
 * Every class is prefixed ruxbo-. Generic names like .card or .stars collide
 * with theme utility classes, and that collision is invisible until a client
 * changes theme.
 */

.ruxbo-reviews {
  /* A theme that centres text in a wide section, or colours every link,
     would otherwise decide how this reads. The section states its own
     alignment rather than inheriting whatever it landed in. */
  text-align: left;
  /* Neutral by default. A plugin that ships one client's brand colour puts
     it on every other client's site until somebody notices. */
  --ruxbo-reviews-accent: #1f1f24;
  --ruxbo-reviews-bg: #fff;
  --ruxbo-reviews-panel: #f5f5f6;
  --ruxbo-reviews-border: #e6e6ea;
  --ruxbo-reviews-text: #17171a;
  --ruxbo-reviews-muted: #6b6b73;
  --ruxbo-reviews-radius: 16px;
  /* One width for a review card, and the summary derived from it. Setting
     the two independently is how the summary ended up narrower than the
     cards it introduces - and how it would drift apart again at the next
     change. Stated as a ratio, the relationship survives. */
  --ruxbo-reviews-card: clamp(240px, 24vw, 300px);
  --ruxbo-reviews-summary: calc(var(--ruxbo-reviews-card) * 1.22);
  --ruxbo-reviews-font: inherit;

  background: var(--ruxbo-reviews-bg);
  border: 1px solid var(--ruxbo-reviews-border);
  border-radius: var(--ruxbo-reviews-radius);
  padding: 30px 32px 18px;
  font-family: var(--ruxbo-reviews-font);
  color: var(--ruxbo-reviews-text);
}

.ruxbo-reviews-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.ruxbo-reviews-eyebrow {
  margin: 0 0 6px;
  color: var(--ruxbo-reviews-accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ruxbo-reviews-title { margin: 0; font-size: clamp(22px, 3vw, 32px); line-height: 1.2; }
.ruxbo-reviews-auto {
  margin: 0;
  color: var(--ruxbo-reviews-muted);
  font-size: 13px;
  text-align: right;
  flex: none;
}

.ruxbo-reviews-body { display: flex; gap: 16px; align-items: stretch; }

/* Summary: the vertical accent rule is the only place the brand colour sits
   as a block, which is what keeps the section calm. */
.ruxbo-reviews-summary {
  flex: 0 0 var(--ruxbo-reviews-summary);
  /* Same height as the cards it sits beside. It was hugging its own content,
     which left it visibly short next to a row of equal cards. Stretching it
     needs the note pushed to the foot, or the panel just grows a gap under
     the last line. overflow stays: nothing from the scrolling row beside it
     may spill in. */
  align-self: stretch;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--ruxbo-reviews-panel);
  border-left: 4px solid var(--ruxbo-reviews-accent);
  border-radius: 0 12px 12px 0;
  padding: 22px 22px 20px;
}
.ruxbo-reviews-score { margin: 0; line-height: 1; }
.ruxbo-reviews-score strong { font-size: 46px; font-weight: 800; letter-spacing: -1px; }
.ruxbo-reviews-outof { color: var(--ruxbo-reviews-muted); font-size: 17px; margin-left: 4px; }
.ruxbo-reviews-stars { margin: 12px 0 0; font-size: 21px; letter-spacing: 2px; line-height: 1; }
.ruxbo-reviews-star { color: var(--ruxbo-reviews-border); }
.ruxbo-reviews-star.is-full { color: var(--ruxbo-reviews-accent); }
/* Half: the same glyph filled from the left, so it needs no second asset and
   no icon font. */
.ruxbo-reviews-star.is-half {
  background: linear-gradient(90deg, var(--ruxbo-reviews-accent) 50%, var(--ruxbo-reviews-border) 50%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ruxbo-reviews-count { margin: 14px 0 0; font-size: 15px; }
.ruxbo-reviews .ruxbo-reviews-cta,
.ruxbo-reviews .ruxbo-reviews-cta:link,
.ruxbo-reviews .ruxbo-reviews-cta:visited {
  display: inline-block;
  margin-top: 16px;
  background: var(--ruxbo-reviews-accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 18px;
  border-radius: 10px;
}
.ruxbo-reviews .ruxbo-reviews-cta:hover,
.ruxbo-reviews .ruxbo-reviews-cta:focus { filter: brightness(0.94); color: #fff; text-decoration: none; }
.ruxbo-reviews-note {
  /* auto on top: the note sits at the bottom of the panel however tall the
     cards make it, rather than floating under the button. */
  margin: auto 0 0;
  padding-top: 18px;
  color: var(--ruxbo-reviews-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* The cards. A carousel that is a scroller needs no library, keeps keyboard
   and touch behaviour the browser already provides, and degrades to a plain
   scrollable row if the script never runs. */
.ruxbo-reviews-track {
  display: flex;
  gap: 16px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.ruxbo-reviews-track::-webkit-scrollbar { display: none; }
.ruxbo-reviews--grid .ruxbo-reviews-track { flex-wrap: wrap; overflow: visible; }

.ruxbo-reviews-card {
  flex: 0 0 var(--ruxbo-reviews-card);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  background: var(--ruxbo-reviews-bg);
  border: 1px solid var(--ruxbo-reviews-border);
  border-radius: 12px;
  padding: 20px 20px 18px;
}
.ruxbo-reviews-stars--card { margin: 0 0 14px; font-size: 17px; }
.ruxbo-reviews-text { font-size: 15.5px; line-height: 1.65; white-space: pre-line; text-align: left; }
.ruxbo-reviews-card.is-long .ruxbo-reviews-text {
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ruxbo-reviews-card.is-open .ruxbo-reviews-text { -webkit-line-clamp: unset; overflow: visible; }
.ruxbo-reviews-more {
  align-self: flex-start;
  margin-top: 6px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 15px;
  color: var(--ruxbo-reviews-accent);
  cursor: pointer;
}
.ruxbo-reviews-by { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 18px; }
.ruxbo-reviews-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: cover; }
.ruxbo-reviews-avatar--blank { background: var(--ruxbo-reviews-panel); display: block; }
.ruxbo-reviews-author { display: block; font-size: 15px; }
.ruxbo-reviews-when { display: block; color: var(--ruxbo-reviews-muted); font-size: 14px; }

.ruxbo-reviews-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--ruxbo-reviews-border);
}
.ruxbo-reviews-foot-note { margin: 0; color: var(--ruxbo-reviews-muted); font-size: 13.5px; line-height: 1.5; }
.ruxbo-reviews-dots { display: flex; gap: 7px; flex: none; }
.ruxbo-reviews-dot {
  width: 9px; height: 9px; border-radius: 99px; border: 0; padding: 0;
  background: var(--ruxbo-reviews-border); cursor: pointer;
}
.ruxbo-reviews-dot.is-on { width: 26px; background: var(--ruxbo-reviews-accent); }

@media (max-width: 860px) {
  .ruxbo-reviews { padding: 24px 18px 14px; }
  /* Summary above the cards: on a phone the score is the headline, and the
     cards are what you then swipe through. */
  .ruxbo-reviews-body { flex-direction: column; }
  /* Stacked, the panel is as tall as its own content again: there is no row
     of cards beside it to match. */
  .ruxbo-reviews-summary { flex: none; align-self: auto; border-left: 0; border-top: 4px solid var(--ruxbo-reviews-accent); border-radius: 0 0 12px 12px; }
  .ruxbo-reviews-note { margin-top: 18px; }
  .ruxbo-reviews-card { flex-basis: 78%; }
  .ruxbo-reviews-foot { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .ruxbo-reviews-track { scroll-behavior: auto; }
}
