/* Reviews: the card (DESIGN §6.6), /reviews/, the /review/ form, the product rating line. Loaded by inc/reviews.php. */

/* ---------- review card ---------- */
.sm-rvs { columns: 1; column-gap: 16px; }
@media (min-width: 768px) { .sm-rvs { columns: 2; } }
@media (min-width: 1100px) { .sm-rvs { columns: 3; } }
.sm-rv { display: grid; gap: 12px; margin: 0 0 16px; padding: 20px; break-inside: avoid; background: var(--paper); border-radius: var(--r); box-shadow: var(--lift); }
.sm-rv__stars { display: inline-flex; gap: 2px; color: var(--ink); }
.sm-rv__stars svg { width: 16px; height: 16px; fill: currentColor; }
.sm-rv__stars .is-off { color: var(--frost-2); }
.sm-rv__q { margin: 0; font-size: 17px; line-height: 1.55; overflow-wrap: anywhere; }
.sm-rv__q p { margin: 0; }
.sm-rv__ph img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-sm); background: var(--frost-2); }
.sm-rv__by { display: grid; gap: 2px; font-size: var(--fs-ui); color: var(--ink-2); }
.sm-rv__by b { color: var(--ink); font-size: var(--fs-md); }
.sm-rv__by a { color: var(--laser-deep); text-decoration: underline; text-underline-offset: 2px; }
.sm-rv__by small { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--ink-3); }
.sm-rv__by small .sm-i { color: var(--ok); }

/* home: a row of three (a scroll rail on phone) */
.sm-rvs--row { columns: auto; display: grid; grid-auto-flow: column; grid-auto-columns: 82%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 4px 16px 12px; scrollbar-width: none; }
.sm-rvs--row .sm-rv { margin: 0; scroll-snap-align: start; }
@media (min-width: 768px) { .sm-rvs--row { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 0; overflow: visible; } }

/* product page */
.sm-rvs--pd { columns: auto; }
.sm-rvs--pd .sm-rv { box-shadow: inset 0 0 0 1px var(--edge); }
.sm-rv__write { margin: 4px 0 0; }
.sm-rv__write .sm-btn, .sm-rv__by a.sm-btn { text-decoration: none; }
.sm-rv-line { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: var(--fs-ui); color: var(--ink-2); }
.sm-rv-line:hover span { text-decoration: underline; }
.sm-rv-ask { margin: 24px 0 0; font-size: var(--fs-ui); color: var(--ink-3); }
.sm-rv-ask a { color: var(--laser-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- /reviews/ ---------- */
.sm-rvp__head { display: grid; gap: 16px; margin-bottom: 24px; }
@media (min-width: 768px) { .sm-rvp__head { grid-template-columns: 1fr auto; align-items: end; } }
.sm-rvp__head .sm-lead { margin: 0; color: var(--ink-2); }
.sm-rvp__side { display: grid; gap: 12px; justify-items: start; }
@media (min-width: 768px) { .sm-rvp__side { justify-items: end; } }
.sm-rvp__avg { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-ui); color: var(--ink-2); }
.sm-rvp__avg b { font-size: 28px; color: var(--ink); }
.sm-rvp__empty { padding: 24px; max-width: 560px; }

/* ---------- /review/ form ---------- */
.sm-rvf { max-width: 600px; }
.sm-rvf__head { margin-bottom: 16px; }
.sm-rvf__head .sm-lead { margin: 0; color: var(--ink-2); }
.sm-rvf__form, .sm-rvf__done { display: grid; gap: 8px; padding: 20px; }
@media (min-width: 768px) { .sm-rvf__form, .sm-rvf__done { padding: 28px; } }
.sm-rvf__form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.sm-rvf__lb { display: block; margin: 12px 0 4px; padding: 0; font-weight: 600; font-size: var(--fs-ui); }
.sm-stars .sm-rvf__lb { margin-top: 0; }
.sm-rvf__hint, .sm-rvf__fine { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--ink-3); }
.sm-rvf__fine { margin-top: 16px; }
.sm-rvf__form textarea { min-height: 120px; resize: vertical; }

/* stars: five radios, filled up to the chosen one (and the hovered one on desktop) */
.sm-stars__row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.sm-stars input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sm-stars label { display: grid; place-items: center; width: 52px; height: 52px; margin: 0; border-radius: var(--r-sm); color: var(--frost-2); cursor: pointer; }
.sm-stars label svg { width: 42px; height: 42px; fill: currentColor; stroke: rgba(12,31,61,.12); stroke-width: .8; transition: scale var(--dur-press) var(--ease-out), color var(--dur-1) ease; }
.sm-stars label:active svg { scale: .9; }
.sm-stars input:focus-visible + label { outline: 2.5px solid var(--focus); outline-offset: -2px; }
.sm-stars__row:has(#rs1:checked) label:nth-of-type(-n+1),
.sm-stars__row:has(#rs2:checked) label:nth-of-type(-n+2),
.sm-stars__row:has(#rs3:checked) label:nth-of-type(-n+3),
.sm-stars__row:has(#rs4:checked) label:nth-of-type(-n+4),
.sm-stars__row:has(#rs5:checked) label:nth-of-type(-n+5) { color: var(--laser); }
@media (hover: hover) {
  .sm-stars__row:has(label:nth-of-type(1):hover) label:nth-of-type(-n+1),
  .sm-stars__row:has(label:nth-of-type(2):hover) label:nth-of-type(-n+2),
  .sm-stars__row:has(label:nth-of-type(3):hover) label:nth-of-type(-n+3),
  .sm-stars__row:has(label:nth-of-type(4):hover) label:nth-of-type(-n+4),
  .sm-stars__row:has(label:nth-of-type(5):hover) label:nth-of-type(-n+5) { color: var(--laser-2); }
}
.sm-stars__word { margin-left: 8px; font-size: var(--fs-ui); font-weight: 600; color: var(--ink-2); }
.sm-stars__word i { display: none; font-style: normal; }
.sm-stars__word i:first-child { display: inline; color: var(--ink-3); font-weight: 500; }
.sm-stars__row:has(input:checked) .sm-stars__word i:first-child { display: none; }
.sm-stars__row:has(#rs1:checked) .sm-stars__word i:nth-child(2),
.sm-stars__row:has(#rs2:checked) .sm-stars__word i:nth-child(3),
.sm-stars__row:has(#rs3:checked) .sm-stars__word i:nth-child(4),
.sm-stars__row:has(#rs4:checked) .sm-stars__word i:nth-child(5),
.sm-stars__row:has(#rs5:checked) .sm-stars__word i:nth-child(6) { display: inline; }

/* which piece: radio chips that wrap (few items) */
.sm-rvf__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sm-rvf__chip { position: relative; margin: 0; }
.sm-rvf__chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sm-rvf__chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: var(--pill); background: var(--paper); box-shadow: inset 0 0 0 1px var(--edge-2); font-weight: 600; font-size: var(--fs-ui); cursor: pointer; transition: background-color var(--dur-1) ease, color var(--dur-1) ease; }
.sm-rvf__chip input:checked + span { background: var(--ink); color: #fff; box-shadow: none; }
.sm-rvf__chip input:focus-visible + span { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.sm-rvf__chip:active span { scale: .97; }

/* photos: the whole row is the file button */
.sm-rvf__photos { position: relative; display: block; margin: 12px 0 0; }
.sm-rvf__photos input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.sm-rvf__photos span { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-sm); background: var(--frost); box-shadow: inset 0 0 0 1.5px var(--edge); }
.sm-rvf__photos .sm-i { grid-row: span 2; color: var(--ink-2); }
.sm-rvf__photos b { font-size: var(--fs-md); }
.sm-rvf__photos small { font-size: var(--fs-sm); font-weight: 400; color: var(--ink-3); }
.sm-rvf__photos input:focus-visible + span { outline: 2.5px solid var(--focus); outline-offset: 2px; }

.sm-rvf__err { margin: 8px 0 0; padding: 12px 14px; border-radius: var(--r-sm); background: #fdecec; color: var(--err); font-weight: 600; font-size: var(--fs-ui); }
.sm-rvf__form .sm-btn { margin-top: 12px; }

/* thank you */
.sm-rvf__done p { margin: 0; color: var(--ink-2); }
.sm-rvf__share { display: grid; gap: 12px; margin-top: 16px; padding-top: 20px; border-top: 1px solid var(--edge); }
.sm-rvf__share .sm-h3 { margin: 0; }
.sm-rvf__copied { font-size: var(--fs-sm); color: var(--ok) !important; font-weight: 600; }
.sm-rvf__back { margin-top: 12px !important; }
.sm-rvf__back a { color: var(--laser-deep); font-weight: 600; text-decoration: underline; }
