/* ==========================================================================
   Guest reviews
   Loaded on single properties and single reviews (tvo_reviews_enqueue_styles
   in functions.php). Used by:
     - property page carousel  wp-realestate-manager/single-property/property-view2.php
     - villa review list       villa-reviews.php  (?all-reviews=1)
     - single review           single-wp_rem_reviews.php
   ========================================================================== */

:root {
  --tvo-reviews-blue: var(--theme-blue, #000077);
  --tvo-reviews-navy: var(--theme-blue-New, #262258);
  --tvo-reviews-yellow: var(--theme-yellow-New, #edcd4b);
  --tvo-reviews-text: #454554;
  --tvo-reviews-muted: #6b6b78;
  --tvo-reviews-line: #e8e8eb;
  --tvo-reviews-tint: #f6f7fb;
}

/* --- shared pieces ------------------------------------------------------ */

.tvo-review-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--tvo-reviews-muted);
  white-space: nowrap;
}

.tvo-review-date svg {
  flex: 0 0 auto;
  opacity: .75;
}

.tvo-review-stars {
  color: var(--tvo-reviews-yellow);
  letter-spacing: 2px;
  font-size: 16px;
  line-height: 1;
}

.tvo-review-stars .is-empty {
  color: #d9d9e0;
}

.tvo-review-item__quote {
  height: 30px;
  font-size: 56px;
}

.tvo-review-card__quote,
.tvo-review-item__quote {
  display: block;
  height: 40px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 72px;
  line-height: 1;
  color: var(--tvo-reviews-yellow);
}

.tvo-btn-outline {
  display: inline-block;
  padding: 10px 26px;
  border: 2px solid var(--tvo-reviews-blue);
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tvo-reviews-blue) !important;
  text-decoration: none !important;
  transition: background-color .2s, color .2s;
}

.tvo-btn-outline:hover,
.tvo-btn-outline:focus {
  background: var(--tvo-reviews-blue);
  color: #fff !important;
}

.tvo-reviews-page__back {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--tvo-reviews-blue);
}

/* --- property page carousel -------------------------------------------- */

/* The "Write new review" button comes from the plugin's own markup in the
   block above this section (.reviwes-property-holder - the plugin's typo),
   where it floats left. Centre it so it sits with the section heading. */
.reviwes-property-holder .element-title {
  text-align: center;
}

.reviwes-property-holder .post-reviews-btn {
  float: none;
  display: inline-block;
  margin-bottom: 4px;
}

.tvo-property-reviews {
  background: #fff;
  padding: 40px 25px 36px;
  margin-bottom: 20px;
}

.tvo-property-reviews__head {
  text-align: center;
  margin-bottom: 24px;
}

.tvo-property-reviews__title {
  margin: 0;
  color: var(--tvo-reviews-blue) !important;
}

/* The theme styles every .carousel globally (fixed min-height, centred grey
   text, hidden indicators), so these overrides are deliberately specific. */
#myCarousel.tvo-reviews-carousel {
  position: relative;
  width: 100%;
  margin: 0 !important;
  padding: 0 44px !important;
}

/* Let the browser handle vertical scrolling; horizontal swipes change slide (reviews.js). */
#myCarousel.tvo-reviews-carousel .carousel-inner {
  touch-action: pan-y;
}

#myCarousel.tvo-reviews-carousel .item {
  min-height: 0;
  color: var(--tvo-reviews-text);
  text-align: left;
  font-size: 16px;
}

/* Every card gets the height of the tallest one (assets/js/reviews.js) so the
   carousel doesn't jump on next/previous; the meta row sits at the bottom. */
.tvo-review-card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 26px 36px 24px;
  background: #fff;
  border: 0;
  border-radius: 10px;
}

.tvo-review-card__text {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 16px;
  font-style: normal;
  line-height: 1.7;
  color: var(--tvo-reviews-text);
  /* Long reviews are cut at 7 lines; "Read full review" opens the rest. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 7;
  overflow: hidden;
  flex: 0 0 auto;
  margin-bottom: 18px;
}

.tvo-review-card__text p {
  margin: 0 0 10px;
  font-size: inherit;
  line-height: inherit;
  color: inherit !important;
}

.tvo-review-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: auto;
}

.tvo-review-card__author {
  font-weight: 600;
  color: var(--tvo-reviews-navy);
}

.tvo-review-card__more {
  margin-left: auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--tvo-reviews-blue);
}

.tvo-reviews-carousel__nav {
  position: absolute;
  top: 50%;
  width: 42px;
  height: 42px;
  margin-top: -40px;
  border: 1px solid var(--tvo-reviews-line);
  border-radius: 50%;
  background: #fff;
  color: var(--tvo-reviews-blue) !important;
  font-size: 26px;
  line-height: 38px;
  text-align: center;
  text-decoration: none !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
  transition: background-color .2s, color .2s;
}

.tvo-reviews-carousel__nav:hover,
.tvo-reviews-carousel__nav:focus {
  background: var(--tvo-reviews-blue);
  color: #fff !important;
}

.tvo-reviews-carousel__nav.is-prev { left: 0; }
.tvo-reviews-carousel__nav.is-next { right: 0; }

#myCarousel.tvo-reviews-carousel .tvo-reviews-carousel__dots {
  display: block !important;
  position: static;
  width: auto;
  margin: 18px 0 0;
  padding: 0;
  text-align: center;
}

#myCarousel.tvo-reviews-carousel .tvo-reviews-carousel__dots li {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin: 0 4px;
  border: 0;
  border-radius: 50%;
  background: #d0d0dc;
  box-shadow: none;
  cursor: pointer;
  transition: background-color .2s, transform .2s;
}

#myCarousel.tvo-reviews-carousel .tvo-reviews-carousel__dots li.active {
  background: var(--tvo-reviews-blue);
  transform: scale(1.25);
}

/* --- villa review list (?all-reviews=1) -------------------------------- */

.tvo-reviews-page {
  padding: 36px 0 60px;
}

.tvo-reviews-page__head {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 30px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--tvo-reviews-line);
  border-radius: 8px;
}

.tvo-reviews-page__image {
  flex: 0 0 200px;
}

.tvo-reviews-page__image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.tvo-reviews-page__title {
  margin: 0 0 6px;
  font-size: 26px;
  line-height: 1.3;
}

.tvo-reviews-page__title a {
  color: var(--tvo-reviews-blue);
  text-decoration: none;
}

.tvo-reviews-page__count {
  margin: 0 0 14px;
  color: var(--tvo-reviews-muted);
}

.tvo-reviews-list {
  margin: 0;
  padding: 0;
}

.tvo-review-item {
  margin-bottom: 16px;
  padding: 24px 28px 20px;
  background: var(--tvo-reviews-tint);
  border-radius: 10px;
}

.tvo-review-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--tvo-reviews-line);
}

.tvo-review-item__author {
  font-weight: 600;
  color: var(--tvo-reviews-navy);
}

.tvo-review-item__text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--tvo-reviews-text);
  word-wrap: break-word;
}

.tvo-review-item__text p:last-child {
  margin-bottom: 0;
}

.tvo-reviews-pagination ul.page-numbers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.tvo-reviews-pagination .page-numbers li {
  margin: 0;
}

.tvo-reviews-pagination a.page-numbers,
.tvo-reviews-pagination span.page-numbers {
  display: inline-block;
  min-width: 38px;
  padding: 8px 12px;
  border: 1px solid var(--tvo-reviews-line);
  border-radius: 4px;
  background: #fff;
  color: var(--tvo-reviews-blue);
  text-align: center;
  text-decoration: none;
}

.tvo-reviews-pagination a.page-numbers:hover {
  border-color: var(--tvo-reviews-blue);
}

.tvo-reviews-pagination span.page-numbers.current {
  border-color: var(--tvo-reviews-blue);
  background: var(--tvo-reviews-blue);
  color: #fff;
}

.tvo-reviews-page__empty {
  padding: 30px;
  background: #fff;
  border: 1px solid var(--tvo-reviews-line);
  border-radius: 6px;
  text-align: center;
  color: var(--tvo-reviews-muted);
}

/* --- all reviews page (/reviews/, reviews_template.php) ---------------- */

/* The theme prints an empty grey sub-header band here; the page has its own heading. */
.page-template-reviews_template .sub-header { display: none; }

.tvo-all-reviews__head {
  margin-bottom: 26px;
  text-align: center;
}

.tvo-all-reviews__title {
  margin: 0 0 6px;
  color: var(--tvo-reviews-blue) !important;
}

.tvo-all-reviews .tvo-review-item.has-villa {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 22px;
  align-items: start;
}

.tvo-review-item__villa {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--tvo-reviews-blue);
  text-decoration: none;
}

.tvo-review-item__villa img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin-bottom: 8px;
  border-radius: 6px;
}

.tvo-review-item__villa:hover .tvo-review-item__villa-name {
  text-decoration: underline;
}

.tvo-review-item__body {
  min-width: 0;
}

.tvo-review-item__link {
  display: inline-block;
  margin-left: auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--tvo-reviews-blue);
}

/* --- single review ------------------------------------------------------ */

/* Hide the theme's sub-header band (page title + breadcrumbs) on review pages.
   include/frontend/cs-header.php prints it for every post type except
   "properties" and stamps an inline "height: NNNpx !important" on it taken from
   the banner image, so it has to be hidden rather than restyled. Delete this
   rule if you want the band back. */
.single-wp_rem_reviews .sub-header { display: none; }

.single-review-section { padding: 36px 0 60px; }
.single-review-card { background: #fff; border: 1px solid var(--tvo-reviews-line); border-radius: 8px; padding: 30px; }
.single-review-card__head { border-bottom: 1px solid var(--tvo-reviews-line); padding-bottom: 16px; margin-bottom: 18px; }
.single-review-card__title { font-size: 24px; line-height: 1.3; margin: 0 0 10px; }
.single-review-card__title a { color: var(--tvo-reviews-blue); text-decoration: none; }
.single-review-card__title a:hover { text-decoration: underline; }
.single-review-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.single-review-card__author { font-weight: 600; color: var(--tvo-reviews-navy); }
.single-review-card__body { font-size: 16px; line-height: 1.75; color: var(--tvo-reviews-text); word-wrap: break-word; }
.single-review-card__body p:last-child { margin-bottom: 0; }

.review-property-card { display: flex; align-items: center; gap: 18px; margin-top: 24px; padding: 18px; border: 1px solid var(--tvo-reviews-line); border-radius: 8px; background: var(--tvo-reviews-tint); }
.review-property-card__image { flex: 0 0 140px; max-width: 140px; }
.review-property-card__image img { width: 100%; height: auto; border-radius: 4px; display: block; }
.review-property-card__label { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--tvo-reviews-muted); margin-bottom: 4px; }
.review-property-card__name { font-size: 18px; margin: 0 0 10px; }
.review-property-card__name a { color: var(--tvo-reviews-blue); text-decoration: none; }

/* --- small screens ------------------------------------------------------ */

@media (max-width: 767px) {
  .tvo-property-reviews { padding: 30px 10px; }

  #myCarousel.tvo-reviews-carousel { padding: 0 !important; }
  .tvo-review-card { padding: 20px 20px 18px; }
  .tvo-review-card__text { -webkit-line-clamp: 10; font-size: 15px; }
  .tvo-review-card__more { margin-left: 0; }

  /* Arrows sit beside the dots under the card instead of over the text. */
  .tvo-reviews-carousel__nav { top: auto; bottom: -8px; margin-top: 0; width: 36px; height: 36px; font-size: 22px; line-height: 32px; }
  #myCarousel.tvo-reviews-carousel .tvo-reviews-carousel__dots { margin-top: 22px; padding: 0 44px; }

  .tvo-reviews-page__head { display: block; padding: 16px; }
  .tvo-reviews-page__image { display: block; margin-bottom: 14px; }
  .tvo-reviews-page__title { font-size: 22px; }
  .tvo-review-item { padding: 18px; }

  /* Villa becomes a small thumbnail + name row above the review. */
  .tvo-all-reviews .tvo-review-item.has-villa { display: block; }
  .tvo-review-item__villa { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
  .tvo-review-item__villa img { flex: 0 0 56px; width: 56px; margin-bottom: 0; }

  .single-review-card { padding: 18px; }
  .review-property-card { display: block; }
  .review-property-card__image { max-width: 100%; margin-bottom: 14px; }
}
