.ta-review-hub {
  --rh-ink: var(--ta-ink, #18211c);
  --rh-muted: var(--ta-muted, #667069);
  --rh-line: var(--ta-line, #d9ded9);
  --rh-paper: var(--ta-surface, #fffdfa);
  --rh-green: var(--ta-forest, #16483a);
  --rh-tripadvisor: #08784f;
  --rh-trustpilot: #08784f;
  position: relative;
  width: 100%;
  color: var(--rh-ink);
}

/* Integrate into the existing Trustindex section without clipping a growing feed.
   Scoped to Review Hub so the fallback layout is unchanged when it is inactive. */
.ta-testimonials__stage:has(.ta-review-hub) {
  height: auto;
  min-width: 0;
  overflow: visible;
}

.ta-bricks-reviews:has(.ta-review-hub) {
  display: block;
  min-width: 0;
}

.ta-home-testimonials .ta-review-hub__intro {
  display: none;
}

.ta-home-testimonials .ta-review-hub__head {
  justify-content: flex-start;
}

.ta-home-testimonials .ta-review-hub__summary {
  max-width: none;
  border: 0;
  padding: 0;
}

.ta-review-hub__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(1.25rem, 3vw, 2.25rem);
}

.ta-review-hub__head h2 {
  margin: 0 0 0.45rem;
  font-family: var(--ta-font-display, inherit);
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.ta-review-hub__head p {
  max-width: 52ch;
  margin: 0;
  color: var(--rh-muted);
  line-height: 1.55;
}

.ta-review-hub__summary {
  flex: 0 0 auto;
  min-width: 118px;
  padding-left: 1.2rem;
  border-left: 1px solid var(--rh-line);
  color: var(--rh-muted);
  font-size: 0.85rem;
}

.ta-review-hub__summary strong {
  display: block;
  color: var(--rh-ink);
  font-family: var(--ta-font-display, inherit);
  font-size: 2.1rem;
  line-height: 1;
}

.ta-review-hub__tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.ta-review-hub__filters,
.ta-review-hub__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ta-review-hub__filter,
.ta-review-hub__nav button {
  display: inline-grid;
  place-items: center;
  min-height: 40px;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--rh-line);
  border-radius: 999px;
  background: transparent;
  color: var(--rh-muted);
  font: 600 0.76rem/1 var(--ta-font-nav, inherit);
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.ta-review-hub__nav button {
  width: 42px;
  padding: 0;
  font-size: 1rem;
}

.ta-review-hub__filter:hover,
.ta-review-hub__filter.is-active,
.ta-review-hub__nav button:hover {
  border-color: var(--rh-green);
  background: var(--rh-green);
  color: #fff;
}

.ta-review-hub__filter:active,
.ta-review-hub__nav button:active,
.ta-review-card__more:active,
.ta-review-dialog__original:active {
  transform: translateY(1px);
}

.ta-review-hub__status {
  min-height: 1.4rem;
  color: var(--rh-muted);
  font-size: 0.9rem;
}

.ta-review-hub__feed {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.ta-review-hub--slider .ta-review-hub__feed {
  grid-auto-columns: minmax(290px, 31.5%);
  grid-auto-flow: column;
  grid-template-columns: none;
  overflow-x: auto;
  padding: 0.25rem 0 1.25rem;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.ta-review-card {
  position: relative;
  display: flex;
  min-height: 340px;
  flex-direction: column;
  padding: clamp(1.25rem, 2.4vw, 1.75rem);
  overflow: hidden;
  border: 1px solid var(--rh-line);
  border-radius: 14px;
  background: var(--rh-paper);
  scroll-snap-align: start;
}

.ta-review-card__source {
  align-self: flex-start;
  margin-bottom: 1rem;
  padding: 0;
  color: var(--rh-muted);
  font: 700 0.68rem/1 var(--ta-font-nav, inherit);
  letter-spacing: 0.035em;
}

.ta-review-card__source[data-source="tripadvisor"] {
  color: var(--rh-tripadvisor);
}

.ta-review-card__source[data-source="trustpilot"] {
  color: var(--rh-trustpilot);
}

.ta-review-card__rating {
  min-height: 22px;
  margin-bottom: 0.8rem;
  color: var(--rh-green);
}

.ta-review-card__rating img {
  display: block;
  width: auto;
  height: 18px;
}

.ta-review-card__numeric-rating {
  color: var(--rh-tripadvisor);
  font: 700 0.82rem/1 var(--ta-font-nav, inherit);
}

.ta-review-card__title {
  margin: 0 0 0.55rem;
  font-family: var(--ta-font-display, inherit);
  font-size: 1.25rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.ta-review-card__text {
  margin: 0;
  color: var(--rh-ink);
  font-size: 0.98rem;
  line-height: 1.62;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.ta-review-card__original {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 1.3rem;
  color: var(--rh-muted);
  font-size: 0.78rem;
  text-underline-offset: 0.2em;
}

.ta-review-hub__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.4rem;
}

.ta-review-hub__load {
  min-height: 44px;
  padding: 0.8rem 1.4rem;
  border: 1px solid var(--rh-green);
  border-radius: 12px;
  background: var(--rh-green);
  color: var(--rh-paper);
  font: inherit;
  cursor: pointer;
}

.ta-review-hub__load:hover { background: var(--rh-ink); }
.ta-review-hub__load[hidden] { display: none; }
.ta-review-hub__filters[hidden] { display: none; }
.ta-review-hub__write { color: var(--rh-green); font-size: 0.9rem; text-underline-offset: 0.25em; }
.ta-review-hub :is(button, a):focus-visible { outline: 2px solid var(--rh-green); outline-offset: 4px; }
.ta-review-hub button:disabled { opacity: 0.45; cursor: default; }

@media (max-width: 600px) {
  .ta-review-hub__head { align-items: start; }
  .ta-review-hub__head h2 { font-size: 2rem; }
  .ta-review-hub__summary { min-width: 86px; max-width: 100px; }
  .ta-review-hub__footer { align-items: stretch; flex-direction: column; }
  .ta-review-hub__load { width: 100%; }
}

.ta-review-card__photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin-top: 1rem;
}

.ta-review-card__photos img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
}

.ta-review-card__more {
  align-self: flex-start;
  margin-top: 0.9rem;
  padding: 0 0 0.2rem;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--rh-green);
  font: 700 0.78rem/1.2 var(--ta-font-nav, inherit);
  cursor: pointer;
}

.ta-review-card__foot {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.1rem;
  padding: 0;
}

.ta-review-card__avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--rh-green);
  color: #fff;
  font: 700 0.78rem/1 var(--ta-font-nav, inherit);
}

.ta-review-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ta-review-card__identity {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.ta-review-card__identity strong {
  overflow: hidden;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ta-review-card__identity small {
  color: var(--rh-muted);
  font-size: 0.72rem;
}

.ta-review-card--skeleton {
  gap: 0.85rem;
  border-color: transparent;
  background: #ecefeb;
  animation: ta-review-pulse 1.2s ease-in-out infinite alternate;
}

.ta-review-card--skeleton span {
  display: block;
  height: 15px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.72);
}

.ta-review-card--skeleton span:nth-child(1) { width: 31%; }
.ta-review-card--skeleton span:nth-child(2) { width: 45%; }
.ta-review-card--skeleton span:nth-child(3) { width: 100%; height: 84px; }
.ta-review-card--skeleton span:nth-child(4) { width: 62%; margin-top: auto; }

@keyframes ta-review-pulse {
  to { opacity: 0.58; }
}

.ta-review-dialog {
  width: min(720px, calc(100vw - 2rem));
  max-height: min(820px, calc(100dvh - 2rem));
  padding: clamp(1.4rem, 4vw, 2.6rem);
  overflow: auto;
  border: 0;
  border-radius: 14px;
  background: var(--rh-paper);
  color: var(--rh-ink);
  box-shadow: 0 28px 90px rgba(14, 28, 21, 0.28);
}

.ta-review-dialog::backdrop {
  background: rgba(8, 18, 13, 0.68);
  backdrop-filter: blur(4px);
}

.ta-review-dialog__close {
  position: sticky;
  z-index: 2;
  top: 0;
  float: right;
  display: grid;
  width: 42px;
  height: 42px;
  margin: -0.4rem -0.4rem 0.5rem 1rem;
  place-items: center;
  border: 1px solid var(--rh-line);
  border-radius: 50%;
  background: var(--rh-paper);
  color: var(--rh-ink);
  font-size: 1.4rem;
  cursor: pointer;
}

.ta-review-dialog__title {
  max-width: 18ch;
  margin: 0 0 1.25rem;
  clear: both;
  font-family: var(--ta-font-display, inherit);
  font-size: clamp(1.8rem, 5vw, 3.1rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.ta-review-dialog__text {
  margin: 0;
  white-space: pre-line;
  font-size: clamp(1rem, 2vw, 1.14rem);
  line-height: 1.72;
}

.ta-review-dialog .ta-review-card__photos {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 1.5rem;
}

.ta-review-dialog__meta {
  margin: 1.5rem 0 0;
  color: var(--rh-muted);
  font-size: 0.82rem;
}

.ta-review-dialog__original {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: var(--rh-green);
  color: #fff;
  font: 700 0.78rem/1 var(--ta-font-nav, inherit);
  text-decoration: none;
}

.ta-review-dialog-open {
  overflow: hidden;
}

.ta-recaptcha {
  width: 100%;
  margin: 0.75rem 0;
  overflow: hidden;
}

.ta-news__status--error {
  color: #9d2c21;
}

@media (max-width: 900px) {
  .ta-review-hub__feed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ta-review-hub--slider .ta-review-hub__feed { grid-auto-columns: minmax(280px, 47%); }
}

@media (max-width: 640px) {
  .ta-review-hub__head { align-items: start; }
  .ta-review-hub__summary { min-width: 82px; }
  .ta-review-hub__head p { font-size: 0.9rem; }
  .ta-review-hub__tools { align-items: end; }
  .ta-review-hub__feed { grid-template-columns: 1fr; }
  .ta-review-hub--slider .ta-review-hub__feed { grid-auto-columns: 90%; }
  .ta-review-card { min-height: 330px; }
  .ta-review-dialog .ta-review-card__photos { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .ta-review-hub *, .ta-review-dialog * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* The feed does not display totals or a redundant home heading. */
.ta-review-hub__summary,
.ta-home-testimonials .ta-review-hub__head,
.ta-review-hub--grid .ta-review-hub__tools:has(.ta-review-hub__filters[hidden]) { display: none; }
.ta-review-hub [hidden] { display: none !important; }

/* Reuse each host section's own heading and maintain contrast on dark campaigns. */
.ta-tour-reviews .ta-review-hub__head,
.ta-2027-proof .ta-review-hub__head { display: none; }
.ta-2027-proof .ta-review-hub__write,
.ta-2027-proof .ta-review-hub__status { color: var(--ta-bone, #fffdfa); }
.ta-2027-proof .ta-review-hub__load {
  color: var(--ta-green-black, #18211c);
  background: var(--ta-bone, #fffdfa);
  border-color: var(--ta-bone, #fffdfa);
}
.ta-2027-proof .ta-review-hub__load:hover {
  color: var(--ta-bone, #fffdfa);
  background: transparent;
}
