/* mm-reviews.css — the reviews block for the plan pages and the free tier.
 *
 * WHY A SEPARATE FILE
 * Four pages need this (three plan pages plus La Soglia) and they do not share
 * a build step, so it is one stylesheet they all link rather than four copies
 * of the same rules drifting apart.
 *
 * PALETTE NOTE, and it is the reason this file exists in the shape it does:
 * the owner's brief is "less of the brown and the terracotta". So every surface
 * here is --white, --wash or --sand, and --clay appears on exactly one thing:
 * the submit button. The stars get their own warm token rather than borrowing
 * --terracotta, which la-soglia.css marks NON-TEXT ONLY because it fails AA as
 * text. Stars are non-text marks here AND they are never the only carrier of
 * the rating -- the number is always written out beside them -- so the fill can
 * be chosen for warmth instead of contrast.
 */

.rev {
  --star: #B8894A;        /* muted ochre. warm without being brown */
  --star-off: #DCD2C4;
}

/* An author `display` beats the UA's [hidden]{display:none}, so .rev-head's
   display:flex kept it on screen after JS set el.hidden = true — a "0.0 out of
   5" header above an empty list. One guard for the whole block rather than a
   per-rule fix, so the next element that gets a display and a hidden state
   cannot reintroduce it. */
.rev [hidden] { display: none !important; }

/* ── header: the average, and the count ───────────────────────────────── */
.rev-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 6px;
}
.rev-avg {
  font-family: var(--display);
  font-size: clamp(30px, 4.4vw, 42px);
  line-height: 1;
  color: var(--ink);
}
.rev-of { font-size: var(--t-small); color: var(--muted); }
.rev-count { font-size: var(--t-small); color: var(--muted); }

/* ── stars ────────────────────────────────────────────────────────────── */
.rev-stars { display: inline-flex; gap: 2px; vertical-align: middle; }
.rev-stars svg { width: 17px; height: 17px; display: block; }
.rev-stars .s-on  { fill: var(--star); }
.rev-stars .s-off { fill: var(--star-off); }

/* ── the list ─────────────────────────────────────────────────────────── */
.rev-list { list-style: none; margin: 0; padding: 0; }
.rev-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.rev-item:last-child { border-bottom: 0; }
.rev-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-bottom: 8px;
}
.rev-who { font-weight: 600; color: var(--ink); font-size: 15px; }
.rev-when { font-size: var(--t-fine); color: var(--muted); }
.rev-title {
  font-family: var(--display);
  font-size: var(--t-h3);
  color: var(--ink);
  margin: 0 0 6px;
}
.rev-body { color: var(--body); margin: 0; }

/* Donna's reply, when she leaves one */
.rev-reply {
  margin: 12px 0 0;
  padding: 12px 14px;
  background: var(--wash);
  border-left: 2px solid var(--rule);
  border-radius: 2px;
}
.rev-reply .lbl {
  display: block;
  font-family: var(--sans);
  font-size: var(--t-label);
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.rev-reply p { margin: 0; color: var(--body); font-size: 15px; }

/* ── empty state. The owner asked to ship this empty for now ──────────── */
.rev-empty {
  padding: 26px 0 6px;
  color: var(--muted);
}
.rev-empty strong { display: block; color: var(--ink); font-size: var(--t-lead); margin-bottom: 4px; font-family: var(--display); }

/* ── the form ─────────────────────────────────────────────────────────── */
.rev-open { margin-top: 22px; }

.rev-form {
  margin-top: 22px;
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.rev-form[hidden] { display: none !important; }
.rev-form fieldset { border: 0; margin: 0 0 18px; padding: 0; }
.rev-form legend,
.rev-l {
  font-family: var(--sans);
  font-size: var(--t-label);
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0;
  margin-bottom: 8px;
  display: block;
}

/* Rating: real radios, so it is keyboard reachable and announces itself.
   The visible star is the label; the input is visually hidden but focusable. */
.rev-rate { display: flex; gap: 4px; }
.rev-rate input {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.rev-rate label {
  cursor: pointer;
  padding: 8px 3px;                 /* 44px tall with the svg, for coarse pointers */
  line-height: 0;
  border-radius: 2px;
}
.rev-rate svg { width: 28px; height: 28px; fill: var(--star-off); transition: fill .12s var(--ease); }
.rev-rate input:checked ~ svg,
.rev-rate label.on svg { fill: var(--star); }
.rev-rate input:focus-visible + svg { outline: 2px solid var(--clay); outline-offset: 2px; }
@media (hover: hover) {
  .rev-rate label:hover svg { fill: var(--star); }
}

.rev-form input[type="text"],
.rev-form textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;                  /* 16px stops iOS zooming the page on focus */
  color: var(--ink);
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 11px 12px;
  margin-bottom: 16px;
}
.rev-form textarea { min-height: 120px; resize: vertical; }
.rev-form input[type="text"]:focus,
.rev-form textarea:focus {
  outline: 2px solid var(--clay);
  outline-offset: 1px;
  border-color: var(--clay);
}

.rev-fine { font-size: var(--t-fine); color: var(--muted); margin: 0 0 16px; }

/* Status line. aria-live, so a screen reader hears the outcome. */
.rev-status { margin: 14px 0 0; font-size: var(--t-small); }
.rev-status:empty { margin: 0; }
.rev-status[data-tone="ok"]   { color: var(--ok); }
.rev-status[data-tone="bad"]  { color: var(--warn); }

.rev-fallback { margin: 10px 0 0; font-size: var(--t-small); color: var(--body); }
.rev-fallback[hidden] { display: none !important; }

/* ── narrow ───────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .rev-form { padding: 18px 16px; }
  .rev-rate svg { width: 32px; height: 32px; }
}

/* Every interactive thing reaches 44px on a touch screen. */
@media (pointer: coarse) {
  .rev-rate label { padding: 10px 4px; }
  .rev-open .btn, .rev-form .btn { min-height: 44px; }
}
