/* Visitor reviews: the tour page (parts/reviews.php, review-card.php, review-form.php), the block at the end of a
   category page (parts/reviews-cat.php) and the rating pill under the tour's H1. Loaded after desktop.css, mobile.css
   and blog.css on tour and category pages (functions.php, handle "site-reviews"). Built on the site's own parts:
   tour-section, btn, chips, field, form-grid, consent, info-dlg, section-head. desktop.css and mobile.css are the
   owner's: the reviews' rules live only here. */

/* Stars: a grey row, and the orange row cut to the rating (--r from 0 to 5). --s = size of one star */
.stars { --s: 16px; position: relative; display: inline-block; flex: none; width: calc(var(--s) * 5); height: var(--s); vertical-align: middle;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23DDD9D2' d='M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z'/%3E%3C/svg%3E") left center / var(--s) var(--s) repeat-x; }
.stars::before { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--r, 0) / 5 * 100%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23F7701A' d='M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z'/%3E%3C/svg%3E") left center / var(--s) var(--s) repeat-x; }
.stars--lg { --s: 22px; }

/* Rating pill under the H1 */
.pill--rating .ico { color: var(--orange); }
.pill--rating b { font-weight: 700; }

/* Summary: the average, the bars 5★…1★, the button */
.reviews > h2 { margin-bottom: 16px; }
.rv-sent { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius-15); background: var(--green-tint); color: var(--green); font-weight: 500; }
.rv-sent .ico { flex: none; }
.rv-sum { display: grid; grid-template-columns: minmax(150px, auto) minmax(0, 1fr) minmax(220px, 260px); gap: 24px; align-items: center; padding: 22px 24px; border-radius: var(--radius-25); background: #fff; box-shadow: var(--shadow); }
.rv-sum__score { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.rv-sum__value { font-size: 44px; line-height: 1; font-weight: 700; color: var(--black); }
.rv-sum__count { font-weight: 600; color: var(--black); }
.rv-sum__ver { font-size: 13px; color: var(--green); font-weight: 500; }
.rv-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.rv-bars li { display: grid; grid-template-columns: 38px minmax(0, 1fr) 30px; gap: 10px; align-items: center; font-size: 13px; }
.rv-bars__label { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-weight: 500; }
.rv-bars__label .ico { color: var(--orange); }
.rv-bars__bar { height: 8px; border-radius: 8px; background: var(--line-soft); overflow: hidden; }
.rv-bars__bar span { display: block; height: 100%; border-radius: 8px; background: var(--orange); }
.rv-bars__n { text-align: right; color: var(--muted); }
.rv-hint { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.rv-sum__cta .rv-hint { text-align: center; }

/* No reviews yet: a cream bar with the button (no zeros, no empty stars) */
.rv-empty { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; padding: 20px 24px; border-radius: var(--radius-25); background: var(--cream); }
.rv-empty > p { margin: 0; font-weight: 500; color: var(--black); }
.rv-empty .rv-hint { text-align: center; }

/* How reviews are checked (EU Omnibus directive): always next to the reviews */
.rv-check { margin: 14px 0 18px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.rv-check a { color: var(--orange-text); font-weight: 500; }
.rv-check a:hover { color: var(--black); }
.rv-langs { margin-bottom: 16px; }
.info-dlg--wide { width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; }

/* One review */
.rv-list { display: flex; flex-direction: column; gap: 12px; }
.rv { padding: 18px 22px; border-radius: var(--radius-20); background: #fff; box-shadow: var(--shadow); }
.rv:focus { outline: none; }
.rv__head { display: flex; align-items: center; gap: 12px; }
.rv__ava { flex: none; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--peach); color: var(--orange-text); font-weight: 700; }
.rv__who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.rv__name { font-weight: 600; color: var(--black); overflow-wrap: anywhere; }
.rv__meta { font-size: 13px; color: var(--muted); }
.rv__tour { display: inline-block; margin-top: 10px; font-weight: 600; color: var(--black); text-decoration: none; }
.rv__tour:hover { color: var(--orange-text); }
.rv__text { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--text-2); overflow-wrap: anywhere; }
.rv__text p { margin: 0 0 8px; }
.rv__text p:last-child { margin-bottom: 0; }
.rv__text.is-clamped { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.rv__more { margin-top: 4px; padding: 0; border: 0; background: none; color: var(--orange-text); font: 500 14px var(--font); cursor: pointer; }
.rv__more:hover { color: var(--black); }
.rv__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.rv__tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: var(--gray); color: var(--text-2); font-weight: 500; }
.rv__tag--ok { background: var(--green-tint); color: var(--green); }
.rv__report { margin-left: auto; color: var(--muted); }
.rv__report:hover { color: var(--black); }
.rv__reply { margin-top: 14px; padding: 12px 16px; border-left: 3px solid var(--orange); border-radius: 0 var(--radius-12) var(--radius-12) 0; background: var(--cream); font-size: 14px; line-height: 1.55; }
.rv__reply strong { margin-right: 8px; color: var(--black); }
.rv__reply time { font-size: 13px; color: var(--muted); }
.rv__reply p { margin: 6px 0 0; }
.rv-more { display: flex; justify-content: center; margin-top: 16px; }
.rv-more .btn span { font-weight: 400; opacity: .65; }
.rv-more .btn.is-busy { opacity: .6; cursor: progress; }

/* The form: a block opened by "#write-review" without JavaScript, a window with it (assets/reviews.js) */
.rv-form { display: none; margin-top: 18px; padding: 22px 24px; border-radius: var(--radius-25); background: #fff; box-shadow: var(--shadow); }
.rv-form:target, .rv-form.is-open, .rv-dlg .rv-form { display: block; }
.rv-dlg .rv-form { margin: 0; box-shadow: none; }
.rv-form__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.rv-form__head h3 { margin: 0; font-size: 20px; line-height: 1.3; }
.rv-form__form > * + * { margin-top: 16px; }
.rv-form__form > input[type="hidden"] { margin: 0; }
.rv-form__alert { margin: 0; padding: 10px 14px; border-radius: var(--radius-12); background: #FBECE8; color: var(--red); font-size: 14px; font-weight: 500; line-height: 1.45; }
.rv-form__alert--info { background: var(--cream); color: var(--text); }
.rv-form__alert:focus { outline: none; }
.rv-form__booked { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 14px; border-radius: var(--radius-12); background: var(--green-tint); color: var(--green); font-size: 14px; font-weight: 500; }
.rv-form__booked .ico { flex: none; }
.rv-rate-field { margin: 0; padding: 0; border: 0; min-width: 0; }
.rv-rate { display: inline-flex; gap: 2px; margin-left: -4px; }
.rv-rate label { display: inline-flex; padding: 2px; border-radius: 8px; color: #DDD9D2; cursor: pointer; transition: color .1s, transform .1s; }
.rv-rate svg { display: block; fill: currentColor; }
.rv-rate label:has(~ input:checked), .rv-rate input:checked + label { color: var(--orange); }
.rv-rate:hover label { color: #DDD9D2; }
.rv-rate:hover label:hover, .rv-rate:hover label:has(~ label:hover) { color: var(--orange); }
.rv-rate label:active { transform: scale(.92); }
.rv-rate input:focus-visible + label { outline: 2px solid var(--orange); outline-offset: 1px; }
.rv-field textarea.field { min-height: 140px; }
.rv-form .form-grid { align-items: start; }
.rv-consent .consent { font-size: 14px; }
.rv-privacy { font-size: 12px; line-height: 1.5; color: var(--muted); margin-bottom: 0; }
.rv-privacy a { color: inherit; }
.rv-form__note { text-align: center; }
.rv-form [data-rv-send].is-busy { opacity: .6; cursor: progress; }
.rv-done { margin: 0; padding: 18px; border-radius: var(--radius-15); background: var(--green-tint); color: var(--green); font-weight: 500; text-align: center; }
.rv-done:focus { outline: none; }

/* The window */
.rv-dlg { width: min(680px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 24px; background: #fff; color: var(--text); box-shadow: 0 30px 90px rgba(0, 0, 0, .35); overflow: auto; overscroll-behavior: contain; }
.rv-dlg::backdrop { background: rgba(21, 18, 58, .55); backdrop-filter: blur(3px); }
.rv-dlg .rv-form__head { position: sticky; top: 0; z-index: 1; margin: -22px -24px 14px; padding: 18px 24px 12px; background: #fff; }

/* Booking status page: "After your trip" with the personal review link (booking-return.php) */
.rv-after { margin: 24px 0; }
.rv-after h2 { margin: 0 0 6px; font-size: 20px; }
.rv-after p { margin: 0; max-width: 560px; }

/* Category page: reviews of its tours */
.rv-cat { margin-top: 48px; }
.rv-cat__sum { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: -4px 0 18px; }
.rv-cat__sum .rv-sum__value { font-size: 32px; }
.rv-cat__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rv-cat .rv { display: flex; flex-direction: column; }
.rv-cat .rv__foot { margin-top: auto; padding-top: 12px; }

@media (max-width: 1000px) {
  .rv-sum { grid-template-columns: auto minmax(0, 1fr); }
  .rv-sum__cta { grid-column: 1 / -1; }
  .rv-cat__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .rv-sum { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 18px; }
  .rv-sum__score { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
  .rv-sum__value { font-size: 36px; }
  .rv-empty { padding: 18px; }
  .rv-empty > div, .rv-empty .btn { width: 100%; }
  .rv { padding: 16px; }
  .rv__report { margin-left: 0; }
  .rv-form { padding: 18px 16px; }
  .rv-form .form-grid { grid-template-columns: minmax(0, 1fr); }
  .rv-dlg { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .rv-dlg .rv-form__head { margin: -18px -16px 14px; padding: 14px 16px 10px; }
  .rv-cat__grid { grid-template-columns: minmax(0, 1fr); }
}
