/* Reviews Section Styles */

.rand-reviews {
  background-color: #ffffff;
  padding: 40px 16px 32px;
}

@media (min-width: 768px) {
  .rand-reviews {
    padding: 60px 32px;
  }
}

@media (min-width: 992px) {
  .rand-reviews {
    padding: 150px 60px 50px;
  }
}

/* Container */
.rand-reviews__container {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

@media (min-width: 992px) {
  .rand-reviews__container {
    gap: 80px;
  }
}

/* Title */
.rand-reviews__title {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 32px;
  line-height: 40px;
  letter-spacing: -1px;
  color: #222222;
  margin: 0;
}

@media (min-width: 768px) {
  .rand-reviews__title {
    font-size: 40px;
    line-height: 48px;
  }
}

@media (min-width: 992px) {
  .rand-reviews__title {
    font-size: 50px;
    line-height: normal;
  }
}

/* Cards Grid */
.rand-reviews__grid {
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .rand-reviews__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .rand-reviews__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Review Card */
.rand-reviews__card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 220px;
  padding: 24px 20px;
  border: 1px dashed #000000;
  border-radius: 0;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

/* Mobile: Only show first 3 cards */
.rand-reviews__card:nth-child(n+4) {
  display: none;
}

/* Mobile: collapsed borders and corner radius */
.rand-reviews__card:first-child {
  border-radius: 6px 6px 0 0;
}

.rand-reviews__card:nth-child(3) {
  border-radius: 0 0 6px 6px;
}

.rand-reviews__card:not(:first-child) {
  border-top: none;
}

@media (min-width: 768px) {
  .rand-reviews__card {
    height: 235px;
    padding: 28px 24px;
    border: 1px dashed #222222;
    border-radius: 6px;
  }

  /* Show all 6 cards on tablet and desktop */
  .rand-reviews__card:nth-child(n+4) {
    display: flex;
  }

  /* Reset 3rd card radius from mobile */
  .rand-reviews__card:nth-child(3) {
    border-radius: 6px;
  }

  .rand-reviews__card:first-child,
  .rand-reviews__card:last-child {
    border-radius: 6px;
  }

  .rand-reviews__card:not(:first-child) {
    border-top: 1px dashed #222222;
  }
}

@media (min-width: 992px) {
  .rand-reviews__card {
    height: 250px;
    padding: 32px;
    border-radius: 0;
  }

  /* Corner cards get rounded corners */
  .rand-reviews__card:nth-child(1) {
    border-radius: 6px 0 0 0;
  }
  .rand-reviews__card:nth-child(3) {
    border-radius: 0 6px 0 0;
  }
  .rand-reviews__card:nth-child(4) {
    border-radius: 0 0 0 6px;
  }
  .rand-reviews__card:nth-child(6) {
    border-radius: 0 0 6px 0;
  }

  /* Collapse borders on desktop grid */
  .rand-reviews__card:nth-child(2),
  .rand-reviews__card:nth-child(3) {
    border-left: none;
  }
  .rand-reviews__card:nth-child(4),
  .rand-reviews__card:nth-child(5),
  .rand-reviews__card:nth-child(6) {
    border-top: none;
  }
  .rand-reviews__card:nth-child(5),
  .rand-reviews__card:nth-child(6) {
    border-left: none;
  }
}

.rand-reviews__card:hover {
  background-color: #f5f5f5;
}

/* Review Text */
.rand-reviews__text {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: #000000;
  margin: 0;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}

@media (min-width: 992px) {
  .rand-reviews__text {
    font-family: 'Geist', sans-serif;
    font-size: 18px;
    color: #222222;
  }
}

/* Card Footer - Name and Stars */
.rand-reviews__footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: auto;
}

/* Reviewer Name */
.rand-reviews__name {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;
  color: #000000;
  margin: 0;
}

@media (min-width: 992px) {
  .rand-reviews__name {
    font-family: 'Geist', sans-serif;
    font-weight: 400;
    font-size: 18px;
    color: #222222;
  }
}

/* Stars Row */
.rand-reviews__stars {
  display: flex;
  gap: 4px;
}

.rand-reviews__star {
  width: 24px;
  height: 24px;
}

/* CTA Button - Desktop only */
.rand-reviews__cta {
  display: none;
}

@media (min-width: 992px) {
  .rand-reviews__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    padding: 8px 24px;
    background-color: #2c52f5;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 20px;
    text-decoration: none;
    border-radius: 999px;
    transition: background-color 0.2s ease;
    width: fit-content;
    align-self: center;
  }

  .rand-reviews__cta:hover {
    background-color: #1e3fd4;
  }
}
