/* Reviews block (rv-). Tokens only. Structure: a ruled summary strip, then quote-first cards (a big soft quote mark behind the words,
   stars demoted to a small mark in the corner) in a snapping carousel, a masonry grid, or a tinted wall of short quotes. */
.rv { --rv-gap: 20px; --rv-per: 3; }

.rv-head { display: flex; flex-direction: column; gap: 12px; max-width: var(--w-prose); margin-bottom: 32px; }

/* summary strip: one ruled row, a sentence rather than a trophy; the review button sits at the far end */
.rv-sum { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding: 20px 0; margin-bottom: 32px; border-block: 1px solid var(--line); }
.rv-sum-main { margin: 0; display: grid; grid-template-columns: auto auto; grid-template-areas: "num stars" "num meta"; column-gap: 16px; row-gap: 2px; align-items: center; justify-items: start; }
.rv-num { grid-area: num; font-size: clamp(40px, 5vw, 56px); line-height: 1; font-weight: 700; letter-spacing: -.03em; }
.rv-sum-main .rv-stars { grid-area: stars; align-self: end; }
.rv-meta { grid-area: meta; align-self: start; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 6px; font-size: 14px; line-height: 1.4; font-weight: 500; color: var(--muted); }
.rv-via { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); font-weight: 600; }
.rv-g { flex: none; }

/* stars: outlines underneath, solid ones on top clipped to the rating */
.rv-stars { position: relative; display: inline-flex; flex: none; color: var(--brand); line-height: 0; }
.rv-off, .rv-on { display: inline-flex; }
.rv-off { color: var(--field); }
.rv-on { position: absolute; inset: 0 auto 0 0; width: var(--rv-fill); overflow: hidden; }
.rv-on svg { flex: none; fill: currentColor; }

/* the list, shared */
.rv-list { list-style: none; margin: 0; padding: 0; }
.rv-item { min-width: 0; }

/* the card */
.rv-card { position: relative; margin: 0; height: 100%; display: flex; flex-direction: column; gap: 20px; padding: 88px 24px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.rv-q { position: absolute; top: 6px; left: 14px; line-height: 0; color: var(--brand-soft); pointer-events: none; transform-origin: 22% 78%; }
.rv-q svg { width: 96px; height: 96px; fill: currentColor; }
.rv-rate { position: absolute; top: 26px; right: 24px; margin: 0; line-height: 0; }
.rv-quote { margin: 0; flex: 1; }
.rv-text { margin: 0; font-size: clamp(17px, 1.5vw, 19px); line-height: 1.55; letter-spacing: -.005em; text-wrap: pretty; overflow-wrap: anywhere; white-space: pre-line; }
.rv-more { align-self: flex-start; min-height: 44px; margin: -14px 0 -10px; padding: 0 6px 0 0; border: 0; background: none; color: var(--brand); font-size: 15px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; border-radius: var(--radius-sm); }
.rv-by { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.rv-av { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--placeholder); font-size: 15px; font-weight: 600; letter-spacing: .02em; }
.rv-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.rv-name { font-weight: 600; overflow-wrap: anywhere; }
.rv-name a { color: var(--ink); text-decoration-color: var(--field); text-decoration-thickness: 1px; }
.rv-sub { font-size: 14px; font-weight: 500; color: var(--muted); overflow-wrap: anywhere; }
.rv-src { margin-left: auto; flex: none; line-height: 0; }

/* carousel: native scroll-snap does the moving; mount adds the arrows, the dots and the keys */
.rv[data-variant="carousel"] .rv-track { position: relative; display: flex; gap: var(--rv-gap); overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; border-radius: var(--radius); }
.rv-track::-webkit-scrollbar { display: none; }
.rv-track > .rv-item { flex: 0 0 calc((100% - (var(--rv-per) - 1) * var(--rv-gap)) / var(--rv-per)); scroll-snap-align: start; display: flex; }
.rv-track > .rv-item > .rv-card { width: 100%; }
.rv-track[data-n="1"] { --rv-per: 1; max-width: 760px; }
.rv-track[data-n="2"] { --rv-per: 2; }
.rv-ctl { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; }
.rv-dots { display: flex; align-items: center; min-height: 48px; }
.rv-dot { width: 28px; height: 44px; padding: 0; border: 0; background: none; display: grid; place-items: center; border-radius: var(--radius-sm); }
.rv-dot::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--field); transition: width var(--d) var(--ease), background-color var(--d) var(--ease); }
.rv-dot[aria-current="true"]::before { width: 24px; background: var(--brand); }
.rv-count { font-size: 15px; font-weight: 600; color: var(--muted); }
.rv-arrows { display: flex; gap: 8px; }
.rv-arrow { width: 48px; height: 48px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--field); background: var(--surface); color: var(--ink); transition: border-color var(--d-fast) ease, color var(--d-fast) ease, opacity var(--d-fast) ease, transform .12s var(--ease); }
.rv-arrow:first-child svg { transform: rotate(180deg); }
.rv-arrow:disabled { opacity: .35; cursor: not-allowed; }
.rv-arrow:active:not(:disabled) { transform: scale(.94); }

/* grid: columns give the masonry feel; each card keeps its natural height */
.rv[data-variant="grid"] .rv-list { columns: 3; column-gap: var(--rv-gap); }
.rv[data-variant="grid"] .rv-item { break-inside: avoid; margin-bottom: var(--rv-gap); }
.rv[data-variant="grid"] .rv-card { height: auto; }

/* wall: small tiles, no outline, every third one tinted; stars lead, the words run at reading size, the author is one line */
.rv[data-variant="wall"] { --rv-gap: 12px; }
.rv[data-variant="wall"] .rv-list { columns: 4; column-gap: var(--rv-gap); }
.rv[data-variant="wall"] .rv-item { break-inside: avoid; margin-bottom: var(--rv-gap); }
.rv[data-variant="wall"] .rv-card { height: auto; gap: 12px; padding: 18px; border: 0; border-radius: var(--radius-sm); }
.rv[data-variant="wall"] .rv-item:nth-child(3n+2) .rv-card { background: var(--brand-soft); }
.rv[data-variant="wall"] .rv-q { display: none; }
.rv[data-variant="wall"] .rv-rate { position: static; order: -1; }
.rv[data-variant="wall"] .rv-text { font-size: 15px; line-height: 1.5; }
.rv[data-variant="wall"] .rv-more { font-size: 14px; margin: -12px 0 -8px; }
.rv[data-variant="wall"] .rv-av { width: 32px; height: 32px; font-size: 12px; }
.rv[data-variant="wall"] .rv-by { gap: 10px; }
.rv[data-variant="wall"] .rv-name { font-size: 14px; }
.rv[data-variant="wall"] .rv-sub { font-size: 13px; }

/* google loading, empty and attribution */
.rv-sk { display: block; height: 12px; border-radius: 6px; background: var(--placeholder); }
.rv-item[data-skeleton] .rv-card { gap: 14px; }
.rv-item[data-skeleton] .rv-av { width: 44px; }
.rv-empty { margin: 0; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 1px dashed var(--field); border-radius: var(--radius-sm); text-align: center; color: var(--muted); }
.rv-empty p { margin: 0; }
.rv-empty-h { font-size: var(--t-h3); line-height: 1.2; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.rv-empty .k-btn { margin-top: 14px; }
.rv-foot:not(:empty) { margin-top: 20px; }
.rv-attrib { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14px; font-weight: 500; color: var(--muted); }
.rv-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; color: var(--brand); }

/* motion: the one authored moment (carousel). mount sets data-motion only when it will play, so nothing is ever hidden without script */
@keyframes rv-quote { from { transform: scale(.5) rotate(-6deg); opacity: 0; } }
@keyframes rv-line { from { opacity: 0; transform: translateY(8px); } }
.rv[data-motion] .rv-item:not([data-seen]) .rv-q { opacity: 0; transform: scale(.5); }
.rv[data-motion] .rv-item:not([data-seen]) :is(.rv-rate, .rv-quote, .rv-more, .rv-by) { opacity: 0; }
.rv[data-motion] .rv-item[data-seen] .rv-q { animation: rv-quote var(--d-spring) calc(var(--rv-i, 0) * 70ms) var(--spring) backwards; }
.rv[data-motion] .rv-item[data-seen] :is(.rv-rate, .rv-quote, .rv-more, .rv-by) { animation: rv-line var(--d-enter) calc(80ms + var(--rv-i, 0) * 70ms) var(--ease) backwards; }

@media (hover: hover) and (pointer: fine) {
  .rv-arrow:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
  .rv-dot:hover::before { background: var(--muted); }
  .rv-dot[aria-current="true"]:hover::before { background: var(--brand); }
  .rv-name a:hover, .rv-link:hover { color: var(--brand); text-decoration-color: currentColor; }
  .rv-more:hover { text-decoration-thickness: 2px; }
}

@media (max-width: 1000px) {
  .rv[data-variant="grid"] .rv-list { columns: 2; }
  .rv[data-variant="wall"] .rv-list { columns: 3; }
  .rv-track { --rv-per: 2; }
  .rv-track[data-n="1"] { --rv-per: 1; }
}
@media (max-width: 720px) {
  .rv { --rv-gap: 12px; }
  .rv-head { margin-bottom: 24px; }
  .rv-sum { margin-bottom: 24px; }
  .rv-sum .rv-us { width: 100%; }
  .rv[data-variant="grid"] .rv-list { columns: 1; }
  .rv[data-variant="wall"] .rv-list { columns: 2; }
  .rv[data-variant="wall"] .rv-card { padding: 16px; }
  /* one review at a time: the track runs to the screen edges and the next card peeks in */
  .rv[data-variant="carousel"] .rv-track { margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); scroll-padding-inline: var(--pad); border-radius: 0; --rv-per: 1; }
  .rv-track > .rv-item { flex-basis: calc(100% - 28px); }
  .rv-track[data-n="1"] > .rv-item { flex-basis: 100%; }
  .rv-card { padding: 84px 20px 20px; }
  .rv-rate { right: 20px; }
}

/* reduced motion: no spring, no rise, no scrolling animation; the dots change without easing */
@media (prefers-reduced-motion: reduce) {
  .rv[data-motion] .rv-item .rv-q, .rv[data-motion] .rv-item :is(.rv-rate, .rv-quote, .rv-more, .rv-by) { animation: none; opacity: 1; transform: none; }
  .rv-track { scroll-behavior: auto; }
  .rv-dot::before, .rv-arrow { transition: none; }
}
