*, *::before, *::after {
  box-sizing: border-box;
}

.rm-carousel-wrapper {
  display: grid;
  grid-template-columns: auto 2rem 1fr 2rem;
  align-items: center;
  column-gap: 0.5rem;
  width: 100%;
  max-width: 800px;
}

.rm-left-panel {
  grid-column: 1;
  background: #4f145b;
  color: #fff;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 256px;
  height: 240px;
  border-radius: 4px;
}

.rm-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.rm-left-stars {
  display: flex;
  margin-bottom: 1rem;
}

.rm-left-star {
  width: 1.25rem;
  height: auto;
  /* make every pixel black, then invert to white */
  filter: brightness(0) invert(1) !important;
}


.rm-average,
.rm-total {
  margin: 0.25rem 0;
}

.rm-logo {
  width: 140px;
  height: auto;
  margin-top: 0.75rem;
  filter: brightness(0) invert(1);
}

.rm-arrow {
  background: none !important;
  border: none;
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4f145b;
  font-size: 1.5rem;
  cursor: pointer;
}

.rm-arrow.left {
  grid-column: 2;
  justify-self: center;
}

.rm-arrow.right {
  grid-column: 4;
  justify-self: center;
}

.rm-carousel {
  grid-column: 3;
  overflow: hidden;
  height: 240px;
}

.rm-track {
  display: flex;
  gap: 1.5rem;
  transition: transform 0.5s ease-in-out;
}

.rm-slide {
  flex: 0 0 calc((100% - (2 * 1.5rem)) / 3);
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: #fff;
  border-radius: 4px;
  height: 240px;
}

.rm-slide-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.rm-slide-header .rm-reviewer {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rm-slide-header .rm-stars {
  flex: 0 0 80px;
  display: flex;
  justify-content: flex-end;
}

.rm-star {
  width: 1rem;
  height: auto;
  vertical-align: middle;
}

.rm-comments {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.25rem;

  /* multi-line clamp */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 7;

  overflow: hidden;
  white-space: normal;      /* ensure wrapping is allowed */
  word-break: break-word;   /* avoid overflow on long words */
  max-height: calc(1.25rem * 7); /* exactly four lines */
}


.rm-date {
  margin-top: auto;
  font-size: 0.75rem;
  color: #666;
  text-align: right;
}

.rm-excellent {
  font-weight: 500;
  margin-bottom: .75rem;
}

@media (min-width: 1024px) {
  .rm-slide {
    flex: 0 0 calc((100% - (2 * 1.5rem)) / 3);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .rm-slide {
    flex: 0 0 calc((100% - 1.5rem) / 2);
  }
}

@media (max-width: 767px) {
  .rm-carousel-wrapper {
    grid-template-columns: 2rem 1fr 2rem;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "panel panel panel"
      "left carousel right";
    row-gap: 0.5rem;
  }

  .rm-left-panel {
    grid-area: panel;
    width: calc(100% - 5rem);
    margin: 0 auto 1rem;
  }

  .rm-arrow.left {
    grid-area: left;
    justify-self: start;
  }

  .rm-carousel {
    grid-area: carousel;
  }

  .rm-arrow.right {
    grid-area: right;
    justify-self: end;
  }

  .rm-track {
    gap: 0.5rem;
  }

  .rm-slide {
    flex: 0 0 100%;
  }
}
