/* Reviews: the section on product pages, the review form at /review/<token>
   and the /reviews page. Uses the site tokens from styles.css, so it follows
   the page's light or dark theme. Loaded only where reviews appear. */

/* ---------- Stars ---------- */
.rv-stars {
  position: relative;
  display: inline-block;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 2px;
  color: var(--line);
  white-space: nowrap;
}
.rv-stars::before { content: "\2605\2605\2605\2605\2605"; }
.rv-stars-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  overflow: hidden;
  color: var(--accent);
}
.rv-stars-fill::before { content: "\2605\2605\2605\2605\2605"; }
.rv-stars-lg { font-size: 26px; letter-spacing: 3px; }

/* ---------- Summary strip (data-sheet style, like .specs-table) ---------- */
.rv-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin: 32px 0 24px;
  padding: 18px 22px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--radius-lg);
}
.rv-avg {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
}
.rv-avg-of { font-size: 18px; color: var(--ink-mute); font-weight: 500; }
.rv-count, .rv-how {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.rv-how { margin-left: auto; color: var(--accent); border-bottom: 1px solid transparent; }
.rv-how:hover { border-bottom-color: var(--accent); }

/* ---------- List ---------- */
.rv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.rv-item article {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.rv-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.rv-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
}
.rv-badge-purchase { border-color: var(--accent); color: var(--accent); }
.rv-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.rv-body p {
  margin: 0 0 10px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.rv-body p:last-child { margin-bottom: 0; }
.rv-meta {
  margin: auto 0 0;
  padding-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  overflow-wrap: anywhere;
}
.rv-name { color: var(--ink); }
.rv-reply {
  margin-top: 4px;
  padding: 12px 14px;
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--bg-2) 60%, transparent);
}
.rv-reply-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.rv-reply p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); white-space: pre-line; overflow-wrap: anywhere; }
.rv-reply p:last-child { margin-bottom: 0; }

.rv-more { margin-top: 16px; }
.rv-more > summary {
  cursor: pointer;
  display: inline-block;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.rv-more > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 760px) {
  .rv-list { grid-template-columns: 1fr; }
  .rv-summary { padding: 16px; }
  .rv-how { margin-left: 0; flex-basis: 100%; }
  .rv-item article { padding: 18px 16px; }
}

/* ---------- Review form (/review/<token>) ---------- */
.rv-form { max-width: 720px; margin: 8px 0 72px; }
.rv-form .contact-form { padding-top: 0; }
.rv-form .form-head .mono-tag { color: var(--ink-soft); }
.rv-lead { max-width: 720px; color: var(--ink-soft); font-size: 16px; line-height: 1.6; margin: 0 0 24px; }
.rv-lead strong { color: var(--ink); }
.rv-note {
  padding: 10px 14px;
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--bg-2) 60%, transparent);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.rv-hint { font-size: 12.5px; color: var(--ink-mute); }

/* Star input: five native radio buttons, so it is a real radio group (arrow
   keys move and select, Tab enters and leaves it). The inputs are visually
   hidden but stay focusable; the labels draw the stars. */
.rv-rate { border: 0; padding: 0; min-width: 0; }  /* side margins come from .contact-form > * */
.rv-rate legend { padding: 0; margin-bottom: 8px; }
.rv-rate-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.rv-rate-input {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.rv-rate-star {
  cursor: pointer;
  font-size: 34px;
  line-height: 1;
  padding: 2px 3px;
  color: var(--line);
  border-radius: var(--radius);
  transition: color .15s;
}
/* Fill every star up to the chosen one. */
.rv-rate-row:has(.rv-rate-input:checked) .rv-rate-star { color: var(--accent); }
.rv-rate-row .rv-rate-input:checked + .rv-rate-star ~ .rv-rate-star { color: var(--line); }
/* While hovering, preview up to the hovered star. */
@media (hover: hover) {
  .rv-rate-row:hover .rv-rate-star { color: var(--accent); }
  .rv-rate-row .rv-rate-star:hover ~ .rv-rate-star { color: var(--line); }
}
.rv-rate-input:focus-visible + .rv-rate-star { outline: 2px solid var(--accent); outline-offset: 1px; }
.rv-rate-say {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.rv-sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.rv-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); cursor: pointer; }
.rv-consent input { margin-top: 3px; width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
.rv-consent a { color: var(--accent); }
.rv-errors {
  padding: 12px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 14px;
}
.rv-errors ul { margin: 6px 0 0; padding-left: 18px; }
.rv-form .form-footer { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.rv-form .h-captcha { min-height: 78px; }
@media (max-width: 760px) {
  .rv-rate-star { font-size: 30px; }
  .rv-form .h-captcha { transform-origin: 0 0; }
}
