/* Reviews section and "Show all N reviews" popup (includes/reviews-section.php).
   Loaded by the component itself, so it styles the same on every host page. */

.htrv {
  --htrv-ink: #1a1a1a;
  --htrv-ink-2: #4a4a4a;
  --htrv-ink-3: #717171;
  --htrv-line: #e8e8ec;
  --htrv-track: #e9e9ed;
  --htrv-off: #d6d6da;
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--htrv-ink);
  text-align: left;
  -webkit-font-smoothing: antialiased;
}
.overallRating.htrv { container-type: inline-size; }
.htrv *, .htrv *::before, .htrv *::after { box-sizing: border-box; }
.htrv svg { display: block; flex: none; }
.htrv .htrv-sr {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- stars ---- */
.htrv .htrv-stars { display: inline-flex; gap: 1px; }
.htrv .htrv-star { display: block; color: var(--htrv-off); }
.htrv .htrv-star.is-on { color: var(--htrv-ink); }
.htrv .htrv-star svg { width: 12px; height: 12px; }
.htrv .htrv-star path { fill: currentColor; }

/* ---- summary: big number, star row, count, four score bars ---- */
.htrv .htrv-big { text-align: center; padding: 0 0 22px; }
.htrv .htrv-big-num { font-size: 60px; line-height: 1; font-weight: 700; letter-spacing: -0.03em; color: var(--htrv-ink); }
.htrv .htrv-rating-stars { position: relative; display: inline-flex; margin: 12px 0 6px; vertical-align: top; }
.htrv .htrv-rating-base,
.htrv .htrv-rating-fill { display: flex; gap: 2px; }
.htrv .htrv-rating-fill { position: absolute; top: 0; left: 0; overflow: hidden; }
.htrv .htrv-rating-fill .htrv-star { color: var(--htrv-ink); }
.htrv .htrv-rating-stars svg { width: 16px; height: 16px; }
.htrv .htrv-big-count { font-size: 14px; color: var(--htrv-ink-2); }

.htrv .htrv-bars { display: grid; gap: 13px; }
.htrv .htrv-bar { display: grid; grid-template-columns: 92px 1fr 28px; align-items: center; gap: 12px; font-size: 14px; color: var(--htrv-ink-2); }
.htrv .htrv-bar-track { display: block; height: 4px; border-radius: 9px; background: var(--htrv-track); overflow: hidden; }
.htrv .htrv-bar-fill { display: block; height: 100%; border-radius: 9px; background: var(--htrv-ink); }
.htrv .htrv-bar-num { font-size: 13px; font-weight: 600; color: var(--htrv-ink); text-align: right; }

/* plain heading: imported-only reviews, and the popup's title line */
.htrv .htrv-headline { display: flex; align-items: center; gap: 7px; font-size: 20px; font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; color: var(--htrv-ink); }
.htrv .htrv-headline-star svg { width: 17px; height: 17px; color: var(--htrv-ink); }
.htrv .htrv-headline-star path { fill: currentColor; }
.htrv .htrv-headline-count { font-size: 15px; font-weight: 400; color: var(--htrv-ink-2); letter-spacing: 0; }
.htrv .htrv-dot { color: #9a9a9a; font-weight: 400; }

/* ---- one review ---- */
.htrv .htrv-revs { margin-top: 26px; }
.htrv .htrv-revs .htrv-rv { padding: 20px 0; border-top: 1px solid var(--htrv-line); }
.htrv .htrv-revs .htrv-rv:last-child { padding-bottom: 0; }
.htrv .htrv-who { display: flex; align-items: center; gap: 12px; }
.htrv .htrv-av { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none; display: flex; align-items: center; justify-content: center; background: #f7880c; }
.htrv .htrv-av img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; margin: 0; }
.htrv .htrv-av .ht-initial-avatar { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #f7880c; color: #fff; font-size: 16px; font-weight: 600; line-height: 1; }
.htrv .htrv-av-imported,
.htrv .htrv-av-imported .ht-initial-avatar { background: #ececf0; color: var(--htrv-ink-2); }
.htrv .htrv-name { font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--htrv-ink); }
.htrv .htrv-badge { display: flex; align-items: center; gap: 4px; margin-top: 1px; font-size: 12px; font-weight: 500; line-height: 1.5; color: var(--htrv-ink-2); }
.htrv .htrv-badge svg { width: 12px; height: 12px; }
.htrv .htrv-badge-imported { color: #5b21b6; }
.htrv .htrv-badge-canceled { color: var(--htrv-ink-3); }
.htrv .htrv-meta { display: flex; align-items: center; gap: 6px; margin: 10px 0 6px; font-size: 13px; color: var(--htrv-ink-3); }
.htrv .htrv-text { margin: 0; padding: 0; font-size: 15px; font-weight: 400; line-height: 1.5; color: #222; overflow-wrap: anywhere; }
.htrv .htrv-text.is-clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.htrv .htrv-text img { max-width: 100%; height: auto; }
.htrv .htrv-more {
  display: inline-block; margin: 6px 0 0; padding: 0; border: 0; background: none;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--htrv-ink);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.htrv .htrv-more[hidden] { display: none !important; }
.htrv .htrv-btn[hidden] { display: none !important; }
.htrv .htrv-reply { margin-top: 12px; padding: 1px 0 1px 14px; border-left: 2px solid #dcdce1; font-size: 13px; color: var(--htrv-ink-3); }
.htrv .htrv-reply-head b { font-weight: 600; color: var(--htrv-ink); }
.htrv .htrv-reply-text { margin-top: 2px; font-size: 14px; line-height: 1.5; color: var(--htrv-ink-2); }

/* ---- buttons ---- */
.htrv .htrv-btn {
  display: block; width: 100%; margin: 22px 0 0; padding: 13px 22px;
  border: 1px solid #d5d5d9; border-radius: 10px; background: #fff;
  font: inherit; font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--htrv-ink);
  text-align: center; cursor: pointer;
}
.htrv .htrv-btn:hover, .htrv .htrv-btn:focus { background: #f6f6f8; color: var(--htrv-ink); }

/* ---- section width: phones and narrow panels stack; wider rows go side by side ---- */
@container (max-width: 559px) {
  .htrv .htrv-revs .htrv-rv:nth-child(n+3) { display: none; }
  .htrv .htrv-revs .htrv-rv:nth-child(2) { padding-bottom: 0; }
}
@container (min-width: 560px) {
  .htrv .htrv-sum { display: grid; grid-template-columns: 190px 1fr; gap: 44px; align-items: center; }
  .htrv .htrv-sum .htrv-big { padding: 0; border-right: 1px solid var(--htrv-line); }
  .htrv .htrv-sum.is-solo { display: block; }
  .htrv .htrv-sum.is-solo .htrv-big { border-right: 0; }
  .overallRating.htrv > .htrv-btn { display: inline-block; width: auto; }
}

/* ---- popup: a 600px window on computers ----
   The popup paints its own dim: on /search phones it is portaled above the
   profile overlay, which covers the body-level backdrop, so the stock backdrop
   is hidden while it is open (Bootstrap 3 marks it .in, Bootstrap 5 .show). */
/* Hidden until opened: Bootstrap's inline display:block opens it, or
   ht-reviews.js on a host with no Bootstrap (the listing builder preview). */
.htrv-modal.modal {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1055;
  display: none; padding: 0 !important; overflow: hidden; background: rgba(0, 0, 0, .5);
}
body:has(.htrv-modal.in) .modal-backdrop,
body:has(.htrv-modal.show) .modal-backdrop { opacity: 0 !important; pointer-events: none; }
.htrv-modal .modal-dialog {
  position: relative; width: 600px; max-width: calc(100% - 32px); height: auto;
  margin: 32px auto; transform: none; animation: htrv-in .22s ease-out;
}
.htrv-modal .modal-content.htrv {
  display: flex; flex-direction: column; max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px);
  padding: 0; border: 0; border-radius: 16px; background: #fff; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}
.htrv .htrv-grab { display: none; }
.htrv .htrv-top { flex: none; display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 12px 16px 8px 28px; }
.htrv .htrv-top-title { flex: 1; min-width: 0; }
.htrv .htrv-top .htrv-headline { font-size: 18px; }
.htrv .htrv-x {
  flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: none; color: var(--htrv-ink); cursor: pointer;
}
.htrv .htrv-x:hover, .htrv .htrv-x:focus { background: #f1f1f3; color: var(--htrv-ink); }
.htrv .htrv-x svg { width: 16px; height: 16px; }
.htrv .htrv-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 8px 28px 28px; }
.htrv .htrv-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 4px; }
.htrv .htrv-chip {
  padding: 7px 14px; border: 1px solid #d5d5d9; border-radius: 99px; background: #fff;
  font: inherit; font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--htrv-ink); cursor: pointer;
}
.htrv .htrv-chip[aria-pressed="true"] { background: var(--htrv-ink); border-color: var(--htrv-ink); color: #fff; }
.htrv .htrv-list .htrv-rv { padding: 22px 0; border-bottom: 1px solid var(--htrv-line); }
.htrv .htrv-list .htrv-rv:last-child { border-bottom: 0; }
.htrv .htrv-list .htrv-rv.is-later { display: none; }
.htrv .htrv-load { margin-top: 6px; }
@keyframes htrv-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---- popup: a sheet that slides up on phones ---- */
@media (max-width: 575px) {
  .htrv-modal .modal-dialog {
    position: fixed; top: calc(46px + env(safe-area-inset-top, 0px)); right: 0; bottom: 0; left: 0;
    width: auto; max-width: none; height: auto; margin: 0; animation: htrv-up .28s cubic-bezier(.2, .8, .2, 1);
  }
  .htrv-modal .modal-content.htrv { height: 100%; max-height: none; border-radius: 20px 20px 0 0; }
  .htrv .htrv-grab { display: block; flex: none; width: 36px; height: 4px; margin: 8px auto 0; border-radius: 9px; background: #d4d4d9; }
  .htrv .htrv-top { min-height: 50px; padding: 4px 10px 4px 20px; }
  .htrv .htrv-top .htrv-headline { font-size: 17px; }
  .htrv .htrv-body { padding: 4px 20px calc(28px + env(safe-area-inset-bottom, 0px)); }
}
@keyframes htrv-up { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .htrv-modal .modal-dialog { animation: none; }
}
