/* =====================================================================
   Embark Homes — Testimonial Slider (complete stylesheet)
   Slider styles + "Read full review" link + full-review lightbox.
   ===================================================================== */

.testimonial-slider {
  --ts-ink: #0e0c0a;
  --ts-ink-dim: #6b6357;
  --ts-line: rgba(14, 12, 10, 0.14);
  --ts-page-bg: #fbf8ef;
  position: relative;
  font-family: 'Mona Sans', sans-serif;
  color: var(--ts-ink);
  -webkit-font-smoothing: antialiased;
}

.testimonial-slider *,
.testimonial-slider *::before,
.testimonial-slider *::after { box-sizing: border-box; }

.testimonial-slider .ts-wrap { position: relative; }

/* Slider strip */
.testimonial-slider .ts-slider {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  cursor: grab;
}
.testimonial-slider .ts-slider::-webkit-scrollbar { display: none; }
.testimonial-slider .ts-slider.dragging { cursor: grabbing; scroll-behavior: auto; }
.testimonial-slider .ts-slider.dragging .ts-slide { pointer-events: none; }

/* Each slide is one testimonial — image left, content right */
.testimonial-slider .ts-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 64px;
  align-items: center;
}

.testimonial-slider .ts-image {
  aspect-ratio: 5 / 4;
  background-size: cover;
  background-position: center;
  border-radius: 25px;
  width: 100%;
}

.testimonial-slider .ts-content {
  padding: 24px 0 36px; /* bottom padding leaves room for the nav arrows */
}

.testimonial-slider .ts-heading {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 10px 0 18px;
  color: var(--ts-ink);
}

.testimonial-slider .ts-body {
  font-size: 16px;
  line-height: 1.75;
  color: var(--ts-ink-dim);
  font-weight: 300;
  margin: 0 0 20px;
  max-width: 560px;
}

.testimonial-slider .ts-attribution {
  display: flex;
  align-items: center;
  gap: 16px;
}

.testimonial-slider .ts-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.testimonial-slider .ts-author {
  font-size: 15px;
  color: var(--ts-ink);
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Nav arrows — bottom-right, floating over the slide */
.testimonial-slider .ts-nav {
  position: absolute;
  bottom: 40px;
  right: 0;
  display: flex;
  gap: 12px;
  z-index: 10;
}
.testimonial-slider .ts-nav-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid var(--ts-line);
  background: transparent;
  color: var(--ts-ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.testimonial-slider .ts-nav-btn:hover {
  background: var(--ts-ink);
  color: var(--ts-page-bg);
  border-color: var(--ts-ink);
  transform: scale(1.05);
}
.testimonial-slider .ts-nav-btn svg { width: 16px; height: 16px; }

/* Mobile — stack image above content */
@media (max-width: 768px) {
  .testimonial-slider .ts-slide { grid-template-columns: 1fr; gap: 28px; }
  .testimonial-slider .ts-image { aspect-ratio: 4 / 3; border-radius: 22px; }
  .testimonial-slider .ts-content { padding: 4px 0 80px; }
  .testimonial-slider .ts-heading { font-size: 26px; margin-bottom: 20px; }
  .testimonial-slider .ts-body { font-size: 15px; line-height: 1.7; margin-bottom: 28px; }
  .testimonial-slider .ts-nav-btn { width: 46px; height: 46px; }
}

.star-rating { display: inline-flex; gap: 5px; }
.star-rating i { color: #000; font-size: 15px; }

/* ----- "Read full review" link ----- */
.testimonial-slider .ts-readmore {
  display: inline;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 500;
  color: var(--ts-ink);
  cursor: pointer;
  white-space: nowrap;
}
.testimonial-slider .ts-readmore .ts-readmore-tx {
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: opacity 0.3s ease;
}
.testimonial-slider .ts-readmore .ts-readmore-ic {
  width: 12px;
  height: 12px;
  vertical-align: middle;
  margin-left: 4px;
  position: relative;
  top: -1px;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.testimonial-slider .ts-readmore:hover .ts-readmore-tx { opacity: 0.55; }
.testimonial-slider .ts-readmore:hover .ts-readmore-ic { transform: translateX(3px); }

/* ----- Lightbox ----- */
.ts-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.ts-lightbox.is-open { display: flex; }

.ts-lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(14, 12, 10, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.ts-lightbox.is-open .ts-lightbox-overlay { opacity: 1; }

.ts-lightbox-dialog {
  position: relative;
  width: min(940px, 100%);
  max-height: min(86vh, 720px);
  background: #fbf8ef;
  color: #0e0c0a;
  font-family: 'Mona Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  grid-template-rows: 1fr; /* keep dialog to a single row on desktop so the close
                              button can never spawn a 2nd row on first paint */
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.ts-lightbox.is-open .ts-lightbox-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.ts-lightbox-image {
  /* Pinned to grid cell so layout is deterministic on first open
     (immune to when the close button's position:absolute resolves). */
  grid-column: 1;
  grid-row: 1;
  background-size: cover;
  background-position: center;
  min-height: 100%;
}

.ts-lightbox-content {
  /* Pinned to grid cell (see note on .ts-lightbox-image). */
  grid-column: 2;
  grid-row: 1;
  padding: 48px 46px;
  overflow-y: auto;
  max-height: min(86vh, 720px);
}

.ts-lightbox .star-rating { margin-bottom: 14px; }

.ts-lightbox-heading {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  color: #0e0c0a;
}

.ts-lightbox-body {
  font-size: 16px;
  line-height: 1.8;
  color: #6b6357;
  font-weight: 300;
}
.ts-lightbox-body p { margin: 0 0 16px; }
.ts-lightbox-body p:last-child { margin-bottom: 0; }

.ts-lightbox-attribution {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(14, 12, 10, 0.14);
}

.ts-lightbox-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.ts-lightbox-author {
  font-size: 15px;
  color: #0e0c0a;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.ts-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  /* Pin inside row 1 (spanning all columns) so the button can never create a
     2nd grid row on first paint before position:absolute resolves. */
  grid-column: 1 / -1;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: rgba(251, 248, 239, 0.92);
  color: #0e0c0a;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  transition: background 0.3s ease, transform 0.3s ease;
}
.ts-lightbox-close:hover { background: #fff; transform: scale(1.06); }

@media (max-width: 768px) {
  .ts-lightbox { padding: 0; }
  .ts-lightbox-dialog {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr; /* image row + content row */
    overflow-y: auto;
  }
  .ts-lightbox-image { grid-column: 1; grid-row: 1; min-height: 200px; max-height: 34vh; }
  .ts-lightbox-content { grid-column: 1; grid-row: 2; padding: 30px 24px 48px; max-height: none; overflow: visible; }
  .ts-lightbox-close { grid-column: 1; grid-row: 1; align-self: start; justify-self: end; }
  .ts-lightbox-heading { font-size: 25px; }
}