/* Onyx Web Fix — /review and /reviews only.
   Loaded AFTER style.css and adds nothing to the homepage's critical path. Every colour
   resolves from the existing tokens, so dark/light and the bronze identity come for free
   and cannot drift from the rest of the site. */

/* The hidden attribute is how every state on these two pages is switched off, and its UA
   default (display:none) loses to any display rule set on a class. Without this, hiding the
   empty rating summary or a form state silently does nothing. */
[hidden] { display: none !important; }

/* ---------- /review : the rating page ---------- */
.rv-section { border-top: none; padding-top: 44px; }
.rv-wrap { max-width: 640px; }
.rv-section h1 { font-size: clamp(28px, 4vw, 38px); margin: 10px 0 0; }
.rv-lede { color: var(--muted); font-size: 15.5px; margin-top: 12px; max-width: 56ch; }
.rv-biz { margin-top: 10px; font-size: 15.5px; }
.rv-biz strong { color: var(--bronze-ink); }
.rv-loading-text { color: var(--muted); font-size: 15px; }

.rv-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 28px 26px 26px;
  margin-top: 28px;
}

.rv-stars-field { border: 0; padding: 0; margin: 0 0 22px; }
.rv-legend {
  /* Visible to screen readers, not on screen — the stars and the scale line below already
     say this to a sighted visitor, and repeating it looks like clutter. */
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.rv-stars {
  display: flex;
  justify-content: center;
  gap: 2px;
}
/* The radio itself is hidden visually but NOT display:none — it must keep receiving focus
   and arrow-key navigation, which is what makes this widget keyboard-usable at all. */
.rv-radio {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  margin: 0;
}
.rv-star {
  font-size: 44px;
  line-height: 1;
  /* 56px tap target on a phone — bigger than the glyph, which is the whole point. */
  padding: 6px 8px;
  min-width: 56px;
  text-align: center;
  color: var(--line);
  cursor: pointer;
  user-select: none;
  transition: color 0.12s ease, transform 0.12s ease;
}
.rv-star:hover { color: var(--bronze-ink); transform: translateY(-1px); }

/* Fill this star and every star before it. :has() is supported everywhere this site is
   used; where it is not, the checked star alone still lights up via the sibling rule. */
.rv-radio:checked + .rv-star { color: var(--bronze); }
.rv-stars:has(#rv-r1:checked) label[for="rv-r1"],
.rv-stars:has(#rv-r2:checked) label[for="rv-r1"],
.rv-stars:has(#rv-r2:checked) label[for="rv-r2"],
.rv-stars:has(#rv-r3:checked) label[for="rv-r1"],
.rv-stars:has(#rv-r3:checked) label[for="rv-r2"],
.rv-stars:has(#rv-r3:checked) label[for="rv-r3"],
.rv-stars:has(#rv-r4:checked) label[for="rv-r1"],
.rv-stars:has(#rv-r4:checked) label[for="rv-r2"],
.rv-stars:has(#rv-r4:checked) label[for="rv-r3"],
.rv-stars:has(#rv-r4:checked) label[for="rv-r4"],
.rv-stars:has(#rv-r5:checked) label[for="rv-r1"],
.rv-stars:has(#rv-r5:checked) label[for="rv-r2"],
.rv-stars:has(#rv-r5:checked) label[for="rv-r3"],
.rv-stars:has(#rv-r5:checked) label[for="rv-r4"],
.rv-stars:has(#rv-r5:checked) label[for="rv-r5"] { color: var(--bronze); }

.rv-radio:focus-visible + .rv-star {
  outline: 2px solid var(--bronze);
  outline-offset: 2px;
  border-radius: 6px;
}

.rv-scale {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.rv-consent {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin: 4px 0 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rv-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  cursor: pointer;
}
.rv-consent-label input {
  width: 18px; height: 18px;
  margin: 2px 0 0;
  accent-color: var(--bronze);
  flex-shrink: 0;
}

#rv-submit { width: 100%; }

.rv-status { margin-top: 12px; font-size: 14.5px; min-height: 1em; }
.rv-status.error { color: var(--danger); }

/* ---------- /reviews : the public page ---------- */
.rs-head { border-top: none; padding-top: 44px; padding-bottom: 8px; }
.rs-head h1 { font-size: clamp(28px, 4vw, 40px); margin: 10px 0 0; }

.rs-summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
  padding: 18px 22px;
  background: var(--bronze-dim);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.rs-avg { font-family: var(--serif); font-size: 34px; font-weight: 600; color: var(--bronze-ink); }
.rs-avg-stars { font-size: 18px; color: var(--bronze); letter-spacing: 1px; }
.rs-avg-meta { font-family: var(--mono); font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.rs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.rs-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 22px 24px 20px;
}
.rs-stars { color: var(--bronze); font-size: 17px; letter-spacing: 2px; }
.rs-quote {
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  border-left: 3px solid var(--bronze);
  padding-left: 14px;
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.5;
}
.rs-who { margin-top: 14px; font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Disclosure. Deliberately readable — same size as the body copy it qualifies, not shrunk
   into the small print. If it is worth disclosing it is worth being able to read. */
.rs-disclosure {
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--bronze-dim);
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--ink);
}

.rs-empty { margin-top: 24px; color: var(--muted); font-size: 15px; max-width: 60ch; }

#rs-work .portfolio-body p:last-of-type { margin-bottom: 0; }
#rs-work .portfolio-link { display: inline-block; margin-top: 14px; }

@media (max-width: 480px) {
  .rv-star { font-size: 38px; min-width: 48px; padding: 6px 4px; }
  .rv-card { padding: 22px 18px 20px; }
}
