/* ============================================================
   CV Builder reviews drawer. Builds on .cv-drawer (cv-builder.css):
   a fixed right-side slide-out. This widens it and styles the
   stats summary, submit form, and review cards. Uses site tokens.
   ============================================================ */

.cv-drawer-wide { width: min(540px, 94vw); overscroll-behavior: contain; }
/* Keep the header (and its close button) pinned while the list scrolls. */
#reviews-drawer .cv-drawer-head { position: sticky; top: 0; z-index: 2; background: var(--bg2); }

.cvr-d { padding: 18px 20px 28px; font-family: var(--font); color: var(--t1); }
.cvr-d-h {
  display: block; font-size: 12px; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--t3); margin: 22px 0 12px;
}

/* Rating summary */
.cvr-d-summary { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cvr-d-score { font-family: 'Playfair Display', Georgia, serif; font-size: 38px; line-height: 1; color: var(--t1); }
.cvr-d-score small { font-size: 16px; color: var(--t3); }
.cvr-d-avgstars svg, .cvr-d-cardstars svg, .cvr-picker svg { width: 18px; height: 18px; }
/* Empty stars need to read clearly as "empty" (not disabled); the lit colour
   must clear 3:1 on the cream cards -> #f5a623 didn't, #c2740a does. */
.cvr-d-avgstars svg path, .cvr-d-cardstars svg path { fill: #c4bbab; }
.cvr-d-avgstars svg.on path, .cvr-d-cardstars svg.on path { fill: #c2740a; }
.cvr-d-count { font-size: 13px; color: var(--t3); }
.cvr-d-empty { font-size: 14px; color: var(--t3); margin: 6px 0; }

/* Submit form */
.cvr-d-formcard { background: var(--bg); border: 1px solid var(--bd); border-radius: 14px; padding: 16px; margin-top: 8px; }
.cvr-d-formcard .cvr-d-h { margin-top: 0; }
.cvr-picker-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cvr-picker { display: flex; gap: 2px; }
/* 9px padding around a 26px star = 44px tap target (WCAG 2.5.5). */
.cvr-picker button { background: none; border: none; cursor: pointer; padding: 9px; line-height: 0; border-radius: 8px; }
.cvr-picker svg { width: 26px; height: 26px; }
/* Darker than the display stars so the un-rated picker reads as a live control, not disabled. */
.cvr-picker svg path { fill: #a99e8a; transition: fill 0.12s, transform 0.12s; }
.cvr-picker button.on svg path, .cvr-picker button:hover svg path { fill: #c2740a; }
.cvr-picker button:hover svg { transform: scale(1.12); }
.cvr-picker button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cvr-picker-hint { font-size: 12.5px; color: var(--t3); }
/* Reviews drawer close button -> comfortable 40px target (was a bare glyph). */
#reviews-drawer .cv-drawer-close { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; }
.cvr-d-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.cvr-input, .cvr-textarea {
  width: 100%; font-family: var(--font); font-size: 14px; color: var(--t1);
  background: var(--bg2); border: 1px solid var(--bd); border-radius: 9px; padding: 10px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cvr-input:focus, .cvr-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.cvr-textarea { resize: vertical; line-height: 1.5; }
.cvr-counter { display: block; text-align: right; font-size: 11px; color: var(--t3); margin-top: 4px; }
.cvr-honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cvr-submit {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px;
  background: var(--accent); /* fallback if color-mix is unsupported */
  /* The site accent is randomised per session; several hues (sky/emerald/amber/indigo)
     fail WCAG AA 4.5:1 with white. Darken it just for this button so the label always clears. */
  background: color-mix(in srgb, var(--accent) 76%, #000);
  color: #fff; font-family: var(--font); font-weight: 600; font-size: 14px;
  padding: 11px 22px; border: none; border-radius: 10px; cursor: pointer;
  transition: filter 0.15s, transform 0.1s, opacity 0.15s;
}
.cvr-submit:hover:not(:disabled) { filter: brightness(1.06); }
.cvr-submit:disabled { opacity: 0.7; cursor: default; }
.cvr-status { margin: 10px 0 0; font-size: 13px; color: var(--t3); min-height: 16px; }
.cvr-status.err { color: #dc2626; }
.cvr-status.ok { color: #1e7e46; }

/* Review cards */
.cvr-d-list { display: flex; flex-direction: column; gap: 10px; }
.cvr-d-loading { font-size: 14px; color: var(--t3); padding: 8px 0; }
.cvr-d-card { background: var(--bg); border: 1px solid var(--bd); border-radius: 12px; padding: 14px 16px; }
.cvr-d-cardtop { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.cvr-d-cardstars { line-height: 0; }
.cvr-d-cardtime { font-size: 11px; color: var(--t3); }
.cvr-d-cardbody { font-size: 14px; line-height: 1.55; color: var(--t2); margin: 0 0 8px; }
.cvr-d-who { font-size: 13px; font-weight: 700; color: var(--t1); }
.cvr-d-role { font-size: 12px; color: var(--t3); }
.cvr-d-note { font-size: 11.5px; line-height: 1.5; color: var(--t3); margin-top: 18px; }

@media (max-width: 560px) {
  .cvr-d-row { grid-template-columns: 1fr; }
  /* Cover the screen on phones so the builder doesn't show (and stay tappable)
     behind the drawer. */
  .cv-drawer-wide { width: 100vw; }
}
@media (prefers-reduced-motion: reduce) {
  .cvr-picker button:hover svg, .cvr-submit:hover:not(:disabled) { transform: none; }
}
