/* ==========================================================================
   Reviews page (/yorumlar/, /en/reviews/, /de/bewertungen/) + the home page teaser.
   Tokens only (see style.css): light and dark themes work automatically.
   ========================================================================== */

/* ---------- List head + average ---------- */
.rv-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: clamp(24px, 4vw, 40px);
}
.rv-list-head h2 { font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.6rem); }
.rv-summary { margin: 0; }
.rv-summary-visual {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.rv-summary-avg { font-family: var(--serif); font-size: 1.9rem; line-height: 1; font-variant-numeric: tabular-nums; }
.rv-summary-of { color: var(--ink-3); font-weight: 600; margin-left: -6px; }
.rv-summary-stars { display: inline-flex; gap: 2px; }
.rv-summary-stars .rv-star { width: 20px; height: 20px; }
.rv-summary-count { color: var(--ink-2); font-weight: 600; font-size: .95rem; }

/* ---------- Stars (display) ---------- */
.rv-star { width: 18px; height: 18px; color: var(--line-2); }
.rv-star.is-on { color: var(--accent); fill: var(--accent); }
.rv-star.is-half { color: var(--accent); fill: color-mix(in srgb, var(--accent) 45%, transparent); }

/* ---------- Cards ---------- */
.rv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: clamp(14px, 2vw, 20px);
  align-items: start;
}
.rv-grid.is-collapsible .rv-more { display: none; }
.rv-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: clamp(20px, 2.6vw, 26px);
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.rv-card:focus { outline: none; }
.rv-card:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 3px; }
.rv-card-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rv-avatar {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
}
.rv-card-who { min-width: 0; }
.rv-name { font-family: var(--sans); font-size: 1.02rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.rv-meta { margin: 2px 0 0; color: var(--ink-3); font-size: .85rem; line-height: 1.4; }
.rv-rating { display: flex; gap: 2px; margin: 0; }
.rv-text { margin: 0; color: var(--ink-2); font-size: .98rem; line-height: 1.65; overflow-wrap: anywhere; }
.rv-text p { margin: 0; }
.rv-text p + p { margin-top: .8em; }
.rv-card-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.rv-subject, .rv-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.35;
}
.rv-subject { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.rv-source { background: var(--bg-soft); color: var(--ink-3); }
.rv-subject .icon, .rv-source .icon { width: 14px; height: 14px; }

/* Teaser on the home page: same cards, long texts clamped (the full text is on the reviews page). */
.rv-card--compact .rv-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 7;
  line-clamp: 7;
  overflow: hidden;
}

/* ---------- Show more + language note ---------- */
.rv-more-wrap { display: flex; justify-content: center; margin-top: 26px; }
.rv-more-wrap .btn { white-space: normal; }
.rv-more-left { color: var(--ink-3); font-weight: 600; }
.rv-lang-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 22px 0 0;
  color: var(--ink-3);
  font-size: .88rem;
  text-align: center;
}
.rv-lang-note .icon { width: 16px; height: 16px; }

/* ---------- Empty state ---------- */
.rv-empty {
  max-width: 640px;
  margin-inline: auto;
  padding: clamp(28px, 5vw, 48px) clamp(20px, 4vw, 40px);
  border-radius: 24px;
  border: 1px dashed var(--line-2);
  background: var(--bg-elev);
  text-align: center;
}
.rv-empty-icon {
  display: inline-grid;
  place-items: center;
  width: 56px; height: 56px;
  margin-bottom: 16px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.rv-empty-icon .icon { width: 26px; height: 26px; }
.rv-empty h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); margin-bottom: 10px; }
.rv-empty p { color: var(--ink-2); margin: 0 auto 22px; max-width: 34em; }
.rv-empty .btn { white-space: normal; }

/* ---------- Form section ---------- */
.rv-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
.rv-how-title { font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); margin-bottom: 22px; }
.rv-steps { display: grid; gap: 18px; counter-reset: none; }
.rv-steps li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; align-items: start; }
.rv-step-num {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  font-size: .92rem;
}
.rv-steps strong { display: block; margin: 5px 0 2px; }
.rv-steps p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.rv-privacy {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 26px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: .92rem;
  line-height: 1.5;
}
.rv-privacy .icon { width: 18px; height: 18px; margin-top: 2px; color: var(--ok); }
@media (min-width: 961px) and (min-height: 760px) {
  .rv-how { position: sticky; top: calc(var(--header-h) + 24px); }
}

.rv-box {
  min-width: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(20px, 3.4vw, 36px);
  box-shadow: var(--shadow);
}
.rv-form-head { margin-bottom: 22px; }
.rv-form-head h2 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); margin-bottom: 8px; }
.rv-form-head p { margin: 0; color: var(--ink-2); }
.rv-form .field { margin-bottom: 20px; }
.rv-form .field label, .rv-rating-field legend { color: var(--ink-2); }
.rv-form .field textarea { min-height: 160px; line-height: 1.55; }
.rv-form [aria-invalid="true"] { border-color: var(--red); }
.rv-hint { margin: 6px 0 0; font-size: .86rem; color: var(--ink-3); line-height: 1.5; }
.rv-req { color: var(--red); }
.rv-optional { font-weight: 500; color: var(--ink-3); }
.rv-label-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.rv-label-row label { margin-bottom: 6px; }
.rv-counter { font-size: .8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rv-counter.is-short { color: var(--accent-ink); }
.rv-counter.is-over { color: var(--red); font-weight: 700; }

/* Star rating input: radios stay in the tab order (arrow keys move between stars). */
.rv-rating-field { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.rv-rating-field legend { display: block; margin-bottom: 4px; padding: 0; font-size: .88rem; font-weight: 600; }
.rv-stars-input { display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; }
.rv-stars-input input {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.rv-stars-input label {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  cursor: pointer;
}
.rv-stars-input .rv-star { width: 30px; height: 30px; color: var(--field-line); transition: color .15s ease, fill .15s ease, transform .15s ease; }
.rv-stars-input input:focus-visible + label { outline: 2.5px solid var(--focus); outline-offset: 1px; }
.rv-stars-input input[aria-invalid="true"] + label .rv-star { color: var(--red); }
/* Hover preview: the hovered star and every star before it (kept in separate rules: an unsupported :has() would drop a whole list). */
.rv-stars-input label:hover .rv-star { color: var(--accent); transform: scale(1.06); }
.rv-stars-input label:has(~ label:hover) .rv-star { color: var(--accent); }
/* Selected value: filled up to the checked star (reviews.js sets .is-on; :has() covers pages without JS). */
.rv-stars-input label.is-on .rv-star,
.rv-stars-input input:checked + label .rv-star { color: var(--accent); fill: var(--accent); }
.rv-stars-input:has(#rv-rating-2:checked) label:nth-of-type(-n+2) .rv-star,
.rv-stars-input:has(#rv-rating-3:checked) label:nth-of-type(-n+3) .rv-star,
.rv-stars-input:has(#rv-rating-4:checked) label:nth-of-type(-n+4) .rv-star,
.rv-stars-input:has(#rv-rating-5:checked) label:nth-of-type(-n+5) .rv-star { color: var(--accent); fill: var(--accent); }
.rv-stars-text { margin-left: 8px; color: var(--ink-2); font-size: .92rem; font-weight: 600; }

/* Errors */
.rv-alert {
  margin-bottom: 22px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--red) 50%, transparent);
  background: color-mix(in srgb, var(--red) 9%, var(--bg-elev));
  color: var(--ink);
}
.rv-alert:focus { outline: 2.5px solid var(--focus); outline-offset: 3px; }
.rv-alert p { margin: 0 0 6px; }
.rv-alert p:last-child { margin-bottom: 0; }
.rv-alert ul { list-style: disc; padding-left: 1.2em; }
.rv-alert li + li { margin-top: 4px; }
.rv-alert a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.rv-error {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin: 8px 0 0;
  color: var(--red);
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.45;
}
.rv-error .icon { width: 16px; height: 16px; margin-top: 2px; flex: none; }

/* Consent + submit */
.rv-submit { padding-top: 22px; border-top: 1px dashed var(--line-2); }
.rv-consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}
.rv-consent input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--primary); cursor: pointer; }
.rv-consent input[aria-invalid="true"] { outline: 2px solid var(--red); outline-offset: 2px; }
.rv-consent label { font-size: .93rem; color: var(--ink-2); line-height: 1.5; cursor: pointer; }
.rv-consent a { color: var(--primary); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.rv-submit .btn { margin-top: 18px; white-space: normal; text-align: center; }
.rv-submit .btn[aria-disabled="true"] { opacity: .7; cursor: progress; transform: none; }
.rv-form .form-note { display: flex; justify-content: center; align-items: center; gap: 6px; }
.rv-form .form-note .icon { width: 14px; height: 14px; flex: none; }

/* Honeypot: off-screen, never visible */
.rv-hp {
  position: absolute !important;
  left: -10000px;
  top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* Thank-you note (after a submission) */
.rv-thanks { text-align: center; }
.rv-thanks:focus { outline: none; }
.rv-thanks:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 3px; }
.rv-thanks-icon {
  display: inline-grid;
  place-items: center;
  width: 60px; height: 60px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
}
.rv-thanks-icon .icon { width: 30px; height: 30px; }
.rv-thanks h2 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); margin-bottom: 10px; }
.rv-thanks p { color: var(--ink-2); max-width: 30em; margin: 0 auto 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .rv-form-layout { grid-template-columns: minmax(0, 1fr); }
  .rv-how { max-width: 640px; }
}
@media (max-width: 640px) {
  .rv-list-head { align-items: flex-start; }
  .rv-summary-visual { border-radius: 18px; padding: 10px 14px; }
  .rv-box { border-radius: 20px; padding: 20px 16px; }
  .rv-consent { padding: 12px; }
  .rv-stars-input label { width: 42px; height: 44px; }
  .rv-stars-text { flex-basis: 100%; margin: 4px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .rv-stars-input .rv-star { transition: none; }
  .rv-stars-input label:hover .rv-star { transform: none; }
}
