/* ============================================================================
   JI JEWELRY — CUSTOMER REVIEWS
   ----------------------------------------------------------------------------
   The section that shows real customer-submitted reviews, and the form that
   takes them. Loaded only by the pages that use it, and every rule is scoped
   to `.crv`, so nothing here can reach the shop, the builder or the curated
   testimonial carousel on the homepage, which is a different thing entirely
   and is untouched.

   A note on gold. The brief allowed "restrained gold accents if appropriate".
   The brand direction on file says no gold as a design colour, so this uses
   the site's own accent instead: the opal blue that already marks every call
   to action and every live value in the builder. Swapping it is one token.

   It is a list, not a grid of cards. A card grid with badges and bars is the
   Amazon look; an editorial column with hairlines between entries is what the
   rest of this site does.
   ========================================================================== */

.crv{
  --crv-rule:      rgba(242,241,238,.13);
  --crv-star:      var(--accent-lit);
  background:var(--ink);color:var(--on-ink);
  padding-block:clamp(48px,6vw,96px);
}

.crv-in{width:100%;max-width:900px;margin-inline:auto;padding-inline:var(--gut)}

/* ------------------------------------------------------------------- HEAD */
.crv-head{
  display:flex;justify-content:space-between;align-items:flex-end;
  gap:clamp(18px,3vw,40px);flex-wrap:wrap;
  padding-bottom:clamp(22px,3vw,32px);border-bottom:1px solid var(--crv-rule);
}
.crv-kick{
  font-family:var(--mono);font-size:10.5px;letter-spacing:.22em;text-transform:uppercase;
  color:var(--on-ink-faint);display:flex;align-items:center;gap:12px;margin:0 0 16px;
}
.crv-kick::before{content:"";width:26px;height:1px;background:currentColor;flex:none;opacity:.7}
.crv-score{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap}
.crv-avg{
  font-family:var(--display);font-weight:800;font-size:clamp(30px,3.6vw,46px);
  line-height:1;letter-spacing:-.03em;
}
.crv-count{
  font-family:var(--mono);font-size:11px;letter-spacing:.16em;text-transform:uppercase;
  color:var(--on-ink-soft);
}

/* ------------------------------------------------------------------ STARS */
.crv-stars{display:inline-flex;gap:3px;vertical-align:middle}
.crv-stars svg{width:15px;height:15px;fill:var(--crv-star);stroke:none;flex:none}
.crv-stars svg.off{fill:rgba(242,241,238,.22)}
.crv-score .crv-stars svg{width:18px;height:18px}

/* ------------------------------------------------------------------- LIST */
.crv-list{margin:0;padding:0;list-style:none}
.crv-item{
  padding-block:clamp(24px,3.2vw,38px);border-bottom:1px solid var(--crv-rule);
}
.crv-item:last-child{border-bottom:0}
.crv-top{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:12px}
.crv-title{
  font-family:var(--display);font-weight:700;font-size:clamp(17px,1.6vw,21px);
  line-height:1.2;letter-spacing:-.02em;margin:0;
}
.crv-badge{
  font-family:var(--mono);font-size:9.5px;letter-spacing:.18em;text-transform:uppercase;
  color:var(--accent-lit);border:1px solid rgba(var(--accent-lit-rgb),.36);
  padding:4px 9px;border-radius:100px;white-space:nowrap;
}
.crv-body{
  font-size:clamp(15px,1.15vw,16.5px);line-height:1.65;color:var(--on-ink-soft);
  margin:0;max-width:62ch;text-wrap:pretty;
}
.crv-by{
  font-family:var(--mono);font-size:10.5px;letter-spacing:.16em;text-transform:uppercase;
  color:var(--on-ink-faint);margin:14px 0 0;
}
.crv-photo{
  margin:16px 0 0;max-width:220px;border-radius:var(--radius);overflow:hidden;
  border:1px solid var(--crv-rule);
}
.crv-photo img{display:block;width:100%;height:auto}

/* The maker's answer, indented under the review it answers. */
.crv-reply{
  margin:18px 0 0;padding:16px 18px;border-left:2px solid rgba(var(--accent-lit-rgb),.5);
  background:var(--ink-2);border-radius:0 var(--radius) var(--radius) 0;
}
.crv-reply-who{
  font-family:var(--mono);font-size:9.5px;letter-spacing:.2em;text-transform:uppercase;
  color:var(--accent-lit);margin:0 0 8px;
}
.crv-reply p{font-size:14.5px;line-height:1.6;color:var(--on-ink-soft);margin:0;max-width:58ch}

/* ---------------------------------------------------------------- STATES */
.crv-empty{
  padding-block:clamp(26px,3.4vw,40px);
  font-size:clamp(15px,1.2vw,17px);line-height:1.6;color:var(--on-ink-soft);max-width:46ch;
}
.crv-note{
  margin-top:18px;font-family:var(--mono);font-size:10.5px;letter-spacing:.14em;
  text-transform:uppercase;color:var(--on-ink-faint);
}
/* Space held while the first fetch is in flight, so the footer does not jump
   when the reviews land. */
.crv-list:empty{min-height:120px}

/* ------------------------------------------------------------------- FORM */
.crv-dialog{
  border:1px solid var(--ink-3);border-radius:var(--radius-lg);
  background:var(--ink-2);color:var(--on-ink);
  width:min(560px,92vw);padding:0;max-height:88vh;
}
.crv-dialog::backdrop{background:rgba(8,8,10,.72);backdrop-filter:blur(3px)}
.crv-form{padding:clamp(22px,3vw,34px);overflow-y:auto;max-height:88vh}
.crv-form h3{
  font-size:clamp(22px,2.4vw,30px);line-height:1.06;letter-spacing:-.028em;margin:0 0 6px;
}
.crv-form .crv-sub{font-size:14px;line-height:1.55;color:var(--on-ink-soft);margin:0 0 22px}

.crv-field{margin-bottom:16px}
.crv-field label,.crv-legend{
  display:block;font-family:var(--mono);font-size:10.5px;letter-spacing:.16em;
  text-transform:uppercase;color:var(--on-ink-soft);margin-bottom:8px;
}
.crv-opt{color:var(--on-ink-faint);text-transform:none;letter-spacing:.04em}
.crv-field input[type=text],
.crv-field input[type=email],
.crv-field select,
.crv-field textarea{
  width:100%;padding:12px 14px;font:inherit;font-size:15px;
  color:var(--on-ink);background:var(--ink);
  border:1px solid var(--ink-3);border-radius:var(--radius);
  transition:border-color var(--t-fast) var(--ease);
}
.crv-field textarea{min-height:120px;resize:vertical;line-height:1.55}
.crv-field input:focus,.crv-field select:focus,.crv-field textarea:focus{
  border-color:var(--accent-lit);
}
.crv-field input[aria-invalid=true],
.crv-field textarea[aria-invalid=true]{border-color:#E2705A}
.crv-err{
  display:block;margin-top:7px;font-size:12.5px;color:#F0907C;
  font-family:var(--body);letter-spacing:0;text-transform:none;
}

/* The rating. Real radios, so arrow keys work and a screen reader reads it as
   one group of five choices rather than five mystery buttons. */
.crv-rate{border:0;padding:0;margin:0 0 18px}
.crv-rate-row{display:flex;gap:4px;align-items:center}
.crv-rate input{position:absolute;opacity:0;width:1px;height:1px}
.crv-rate label{
  margin:0;padding:3px;cursor:pointer;line-height:0;border-radius:3px;
  color:rgba(242,241,238,.24);transition:color var(--t-fast) var(--ease);
}
.crv-rate label svg{width:26px;height:26px;fill:currentColor;stroke:none;display:block}
/* The chosen rating. `.on` is put on by script, so what is lit is always what
   is selected. */
.crv-rate label.on{color:var(--crv-star)}

/* The hover preview exists only where hovering is a real thing. On a
   touchscreen :hover sticks after a tap, which would leave four stars lit
   beside the words "5 out of 5" until something else was touched. */
@media (hover: hover) and (pointer: fine){
  .crv-rate-row:hover label{color:var(--crv-star)}
  .crv-rate-row label:hover ~ label{color:rgba(242,241,238,.24)}
}
.crv-rate input:focus-visible + label{outline:2px solid var(--accent-lit);outline-offset:2px}
.crv-rate-val{
  margin-left:10px;font-family:var(--mono);font-size:11px;letter-spacing:.16em;
  text-transform:uppercase;color:var(--on-ink-faint);
}

.crv-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:24px}
.crv-actions .btn{min-height:48px}

/* The confirmation, in place of the form. */
.crv-done{padding:clamp(28px,4vw,44px);text-align:center}
.crv-done-mark{
  width:52px;height:52px;margin:0 auto 20px;border-radius:50%;
  border:1px solid rgba(var(--accent-lit-rgb),.5);display:grid;place-items:center;
}
.crv-done-mark svg{width:24px;height:24px;stroke:var(--accent-lit);fill:none;stroke-width:1.6}
.crv-done h3{font-size:clamp(20px,2.2vw,26px);margin:0 0 12px;letter-spacing:-.02em}
.crv-done p{font-size:15px;line-height:1.6;color:var(--on-ink-soft);margin:0 auto;max-width:38ch}

/* A submission that could not be sent says so rather than pretending. */
.crv-fail{
  margin-top:16px;padding:12px 14px;border:1px solid rgba(226,112,90,.45);
  border-radius:var(--radius);background:rgba(226,112,90,.1);
  font-size:14px;line-height:1.5;color:#F0A594;
}

@media (max-width:620px){
  .crv-head{align-items:flex-start}
  .crv-head .btn{width:100%}
  .crv-dialog{width:100vw;max-width:100vw;max-height:100vh;height:100vh;
              border-radius:0;border:0}
  .crv-form{max-height:100vh}
  .crv-rate label svg{width:30px;height:30px}    /* thumb-sized */
  .crv-photo{max-width:100%}
}
