:root {
  --kgl-rm-navy: #254273;
  --kgl-rm-bronze: #c57f48;
  --kgl-rm-teal: #46a0b2;
  --kgl-rm-cloud: #f7fbfc;
}

.kgl-review-shell {
  position: relative;
  left: 50%;
  width: 100vw;
  max-width: none !important;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
  overflow: hidden;
  padding: 10px 12px 18px;
  box-sizing: border-box;
}

.kgl-review-shell::before,
.kgl-review-shell::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  width: clamp(12px, 2.5vw, 34px);
  pointer-events: none;
}

.kgl-review-shell::before {
  left: 0;
  background: linear-gradient(90deg, #fff 0%, rgba(255,255,255,.82) 34%, rgba(255,255,255,0) 100%);
}

.kgl-review-shell::after {
  right: 0;
  background: linear-gradient(270deg, #fff 0%, rgba(255,255,255,.82) 34%, rgba(255,255,255,0) 100%);
}

.kgl-review-viewport {
  width: 100%;
  max-width: none !important;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y pinch-zoom;
}

.kgl-review-viewport:active { cursor: grabbing; }

.kgl-review-track {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.kgl-review-card {
  flex: 0 0 clamp(205px, 15vw, 235px);
  min-width: 0;
  min-height: 258px;
  border: 1px solid #dce6eb;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(17, 41, 71, .045);
  padding: 24px 15px 18px;
  display: flex;
  flex-direction: column;
  text-align: center;
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}

.kgl-review-card:hover,
.kgl-review-card:focus-within {
  transform: translateY(-3px);
  border-color: rgba(197, 127, 72, .48);
  box-shadow: 0 16px 38px rgba(17, 41, 71, .09);
}

.kgl-review-stars {
  color: var(--kgl-rm-bronze);
  font-size: 13px;
  letter-spacing: 2px;
  line-height: 1;
  margin-bottom: 14px;
  text-align: center;
}

.kgl-review-copy {
  margin: 0;
  color: #111827;
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kgl-review-person {
  margin-top: auto;
  padding-top: 18px;
  text-align: center;
}

.kgl-review-author {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 700;
  text-align: center;
}

.kgl-review-date {
  display: block;
  margin-top: 14px;
  color: var(--kgl-rm-navy);
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
}

/* Static Gutenberg review cards: center the flex items themselves, not only their text. */
.kgl-review-section .kgl-review-footer {
  width: 100% !important;
  max-width: none !important;
  align-items: stretch !important;
}

.kgl-review-section .kgl-review-footer > p {
  width: 100% !important;
  max-width: none !important;
  align-self: stretch !important;
  text-align: center !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Safety net for the original six Gutenberg review cards. */
.kgl-legacy-review-card,
.kgl-legacy-review-card * {
  text-align: center !important;
}

.kgl-legacy-review-author,
.kgl-legacy-review-date {
  display: block;
  width: 100%;
  text-align: center !important;
}

.kgl-review-shell.kgl-marquee-fallback .kgl-review-track {
  width: max-content;
  animation: kglReviewFallback 70s linear infinite;
}

.kgl-review-shell.kgl-marquee-fallback:hover .kgl-review-track,
.kgl-review-shell.kgl-marquee-fallback:focus-within .kgl-review-track {
  animation-play-state: paused;
}

@keyframes kglReviewFallback {
  to { transform: translate3d(-50%, 0, 0); }
}

.kgl-apartment-motion-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  will-change: transform;
  transform: translateZ(0);
  transition:
    transform .30s cubic-bezier(.2,.65,.3,1),
    box-shadow .30s ease,
    border-color .30s ease;
}

.kgl-apartment-motion-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 0 1px rgba(70,160,178,.34);
  transition: opacity .30s ease;
}

.kgl-apartment-motion-card img {
  transform: scale(1.001);
  transform-origin: 50% 50%;
  transition: transform .56s cubic-bezier(.2,.65,.3,1), filter .35s ease;
}

.kgl-apartment-motion-link {
  display: inline-block;
  transition: transform .24s ease, color .24s ease;
}

.kgl-apartment-motion-link::after {
  content: " →";
  display: inline-block;
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity .22s ease, transform .22s ease;
}

@media (hover: hover) and (pointer: fine) {
  .kgl-apartment-motion-card:hover {
    transform: translateY(-9px) scale(1.008);
    box-shadow: 0 22px 52px rgba(17, 41, 71, .16);
    border-color: rgba(70, 160, 178, .42) !important;
  }

  .kgl-apartment-motion-card:hover::after {
    opacity: 1;
  }

  .kgl-apartment-motion-card:hover img {
    transform: scale(1.065);
    filter: saturate(1.035) contrast(1.015);
  }

  .kgl-apartment-motion-card:hover .kgl-apartment-motion-link {
    transform: translateX(3px);
    color: var(--kgl-rm-navy);
  }

  .kgl-apartment-motion-card:hover .kgl-apartment-motion-link::after {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 1023px) {
  .kgl-review-shell {
    padding-inline: 8px;
  }

  .kgl-review-card {
    flex-basis: clamp(210px, 31vw, 255px);
  }
}

@media (max-width: 640px) {
  .kgl-review-shell {
    padding-inline: 6px;
  }

  .kgl-review-shell::before,
  .kgl-review-shell::after {
    width: 16px;
  }

  .kgl-review-card {
    flex-basis: min(76vw, 280px);
    min-height: 250px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kgl-review-track,
  .kgl-review-shell.kgl-marquee-fallback .kgl-review-track,
  .kgl-review-card,
  .kgl-apartment-motion-card,
  .kgl-apartment-motion-card::after,
  .kgl-apartment-motion-card img,
  .kgl-apartment-motion-link,
  .kgl-apartment-motion-link::after {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  .kgl-review-viewport {
    overflow-x: auto;
    scrollbar-width: thin;
  }
}
