/* Panda Exteriors — review carousel ("prc", see README.md in this folder). Every rule is
   scoped to .prc / .prc-card, so nothing else on the site is affected.

   Without JavaScript the reviews are a row that scrolls sideways (with snap points);
   reviews.js adds .is-ready and takes over: endless loop, gliding, dragging, autoplay. */

.prc {
  --prc-per-view: 1;
  --prc-gap: 24px;
  --prc-lines: 7;
  --prc-interval: 6500ms;
  --prc-green: var(--primary, #9acd32);
  --prc-orange: var(--seconday, #f26924);
  --prc-ink: #111111;
  --prc-text: #1f2937;
  --prc-card: #ffffff;
  --prc-card-border: rgba(17, 24, 39, 0.08);
  /* shadows stay inside the viewport's padding (12px sides, 28px below) */
  --prc-card-shadow: 0 1px 2px rgba(17, 24, 39, 0.05), 0 12px 28px -18px rgba(17, 24, 39, 0.3);
  --prc-btn: #ffffff;
  --prc-btn-ink: var(--prc-ink);
  --prc-btn-border: rgba(17, 24, 39, 0.14);
  --prc-dot: rgba(17, 24, 39, 0.22);
  --prc-dot-fill: var(--prc-ink);
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0;
  font-family: var(--robboto, 'Roboto'), system-ui, sans-serif;
  color: var(--prc-ink);
  text-align: left;
}
.prc *,
.prc *::before,
.prc *::after {
  box-sizing: border-box;
}

/* Full-width "Testimonials" sections: 1, 2 or 3 reviews in view. */
@media (min-width: 700px) {
  .prc--section {
    --prc-per-view: 2;
  }
}
@media (min-width: 1100px) {
  .prc--section {
    --prc-per-view: 3;
  }
}

/* Beside the video, on the green band: one review in view (centred, and no wider than
   reads well, where it sits under the video on tablets). */
.prc--column {
  max-width: 720px;
  margin-right: auto;
  margin-left: auto;
  --prc-lines: 6;
  --prc-card-border: transparent;
  --prc-card-shadow: 0 14px 28px -18px rgba(17, 24, 39, 0.5);
  --prc-btn-border: transparent;
  --prc-dot: rgba(17, 24, 39, 0.28);
}
@media (max-width: 575.98px) {
  .prc {
    --prc-lines: 8;
    --prc-gap: 16px;
  }
}

/* ------------------------------------------------------------------ viewport */
.prc__viewport {
  position: relative;
  /* room for the card shadows, without moving the cards */
  margin: -12px -12px -28px;
  padding: 12px 12px 28px;
  overflow: hidden;
}
.prc__track {
  display: flex;
  align-items: flex-start;
  gap: var(--prc-gap);
}
.prc__slide {
  flex: 0 0 calc((100% - (var(--prc-per-view) - 1) * var(--prc-gap)) / var(--prc-per-view));
  min-width: 0;
}

/* No JavaScript (or not yet): a native sideways-scrolling row. */
.prc:not(.is-ready) .prc__viewport {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 12px;
  scrollbar-width: none;
}
.prc:not(.is-ready) .prc__viewport::-webkit-scrollbar {
  display: none;
}
.prc:not(.is-ready) .prc__slide {
  scroll-snap-align: start;
}
.prc:not(.is-ready) .prc__controls {
  visibility: hidden;
}

/* Carousel mode. */
.prc.is-ready .prc__viewport {
  touch-action: pan-y pinch-zoom;
  cursor: grab;
}
.prc.is-ready .prc__track {
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}
.prc.is-dragging .prc__viewport {
  cursor: grabbing;
}
.prc.is-dragging .prc__track {
  user-select: none;
  -webkit-user-select: none;
}
/* Every review fits: no motion, no controls. */
.prc.is-static .prc__track {
  justify-content: center;
}
.prc.is-static .prc__viewport {
  cursor: auto;
}
.prc.is-static .prc__slide.is-clone {
  display: none;
}
.prc.is-static .prc__controls {
  display: none;
}

/* ---------------------------------------------------------------------- card */
.prc-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 28px 28px 24px;
  border: 1px solid var(--prc-card-border);
  border-radius: 20px;
  background: var(--prc-card);
  box-shadow: var(--prc-card-shadow);
  color: var(--prc-ink);
}
@media (max-width: 575.98px) {
  .prc-card {
    padding: 22px 20px 20px;
    border-radius: 16px;
  }
}
.prc-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.prc-card__stars {
  display: inline-flex;
  gap: 3px;
  color: var(--prc-orange);
  line-height: 0;
}
.prc-card__stars svg {
  display: block;
  width: 19px;
  height: 19px;
  fill: currentColor;
}
.prc-card__stars svg.is-empty {
  fill: rgba(17, 24, 39, 0.16);
}
.prc-card__mark {
  flex: none;
  width: 34px;
  height: 34px;
  fill: var(--prc-green);
}
.prc .prc-card__quote {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  quotes: none;
}
.prc .prc-card__quote::before,
.prc .prc-card__quote::after {
  content: none;
}
.prc .prc-card__text {
  margin: 0;
  padding: 0;
  color: var(--prc-text);
  font-size: 16px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.6;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
/* Long reviews show a few lines and a "Read more" button (not without JavaScript: the
   whole review shows then). */
.prc.is-ready .prc-card__text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--prc-lines);
  line-clamp: var(--prc-lines);
  /* every card as tall as a shortened one, so the row lines up */
  min-height: calc(var(--prc-lines) * 1.6em);
}
.prc.is-ready .prc-card.is-expanded .prc-card__text {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  line-clamp: none;
}
.prc .prc-card__more {
  align-self: flex-start;
  margin: 8px 0 0;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--prc-ink);
  font: 600 15px/1.4 var(--robboto, 'Roboto'), system-ui, sans-serif;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
/* Reviews short enough to show whole keep the button's space (the cards line up). */
.prc .prc-card__more.is-hidden {
  visibility: hidden;
}
.prc:not(.is-ready) .prc-card__more {
  display: none;
}
.prc .prc-card__more:hover {
  color: var(--prc-orange);
}
.prc-card__author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
}
.prc .prc-card__avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 50%;
  background: var(--prc-green);
  color: var(--prc-ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  object-fit: cover;
  -webkit-user-drag: none;
}
.prc-card__name {
  min-width: 0;
  color: var(--prc-ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

/* ------------------------------------------------------------------ controls */
.prc__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}
.prc__status {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.prc__arrows {
  display: flex;
  flex: none;
  gap: 10px;
}
.prc .prc__btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--prc-btn-border);
  border-radius: 50%;
  background: var(--prc-btn);
  color: var(--prc-btn-ink);
  box-shadow: 0 6px 16px -10px rgba(17, 24, 39, 0.35);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.prc .prc__btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.prc .prc__btn:hover {
  border-color: var(--prc-ink);
  background: var(--prc-ink);
  color: #ffffff;
}
.prc .prc__btn:active {
  transform: scale(0.94);
}
.prc .prc__btn:focus-visible,
.prc .prc-card__more:focus-visible,
.prc__viewport:focus-visible {
  outline: 3px solid var(--prc-orange);
  outline-offset: 3px;
}
.prc .prc__btn--play {
  width: 34px;
  height: 34px;
  box-shadow: none;
}
.prc .prc__btn--play svg {
  width: 16px;
  height: 16px;
}
.prc__icon-play,
.prc.is-stopped .prc__icon-pause {
  display: none;
}
.prc.is-stopped .prc__icon-play {
  display: inline;
}

.prc__dots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.prc .prc__dot {
  position: relative;
  flex: none;
  width: 8px;
  height: 8px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--prc-dot);
  cursor: pointer;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s ease;
}
.prc .prc__dot:hover {
  background: rgba(17, 24, 39, 0.45);
}
.prc .prc__dot.is-active {
  width: 30px;
  background: var(--prc-dot);
}
/* The active dot fills up while a review waits for the next one. */
.prc .prc__dot.is-active::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--prc-dot-fill);
  transform-origin: left center;
}
.prc.is-playing .prc__dot.is-active::after {
  animation: prc-progress var(--prc-interval) linear both;
}
.prc.is-playing.is-held .prc__dot.is-active::after {
  animation-play-state: paused;
}
@keyframes prc-progress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* On the green band: white buttons. */
.prc--column .prc__btn {
  box-shadow: 0 8px 20px -12px rgba(17, 24, 39, 0.55);
}

@media (max-width: 575.98px) {
  .prc__controls {
    gap: 10px;
    margin-top: 16px;
  }
  .prc__status {
    gap: 10px;
  }
  .prc__dots {
    gap: 6px;
  }
  .prc .prc__dot {
    width: 6px;
    height: 6px;
  }
  .prc .prc__dot.is-active {
    width: 22px;
  }
  .prc .prc__btn {
    width: 42px;
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .prc .prc__dot,
  .prc .prc__btn {
    transition: none;
  }
}
