.review-link {
  color: var(--text-black);
  font-size: 20px;
  font-weight: 400;
  text-decoration: underline;
  cursor: pointer;
}

.reviews-content {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: 100%;
  align-items: center;
  justify-content: center;
  column-gap: clamp(20px, 2.9vw, 42px);
  padding-top: var(--section-inner-gap);
} 

.card-wrapper {
  margin: clamp(50px, 5vw, 72px) 0;
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  height: var(--review-card-height);
  min-width: 0;
}

.review-author {
  color: #161616;
  font-size: 26px;
  font-weight: 400;
}

.review-country {
  color: #161616;
  font-size: 18px;
  font-weight: 300;
}

.review-text {
  color: #161616;
  font-size: 18px;
  font-weight: 300;
  line-height: 1.25;
}

.review-card {
  background: var(--main-bg-color-2);
  border-radius: var(--card-radius);
  overflow: hidden;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  display: flex;
  border: 1px var(--text-red) solid;
  padding: clamp(80px, 6.5vw, 125px) clamp(20px, 1.45vw, 28px) clamp(28px, 2vw, 38px);
  margin: 1px;
  width: 100%;
  height: 100%;
}

.content {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 25px;
  width: 100%;
  height: 100%;
}

.stars {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.review-details {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 16px;
  width: 100%;
  min-height: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 25px;
  width: 100%
}

.user-name-date {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.cards-container {
  display: flex;
  gap: 42px;
}

.read-more {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
  margin-top: auto;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.profile-pic-bg {
  position: absolute;
  width: clamp(104px, 6.7vw, 128px);
  height: clamp(104px, 6.7vw, 128px);
  background: var(--button-red);
  border-radius: 9999px;
  border: 0.50px var(--text-red) solid;
  z-index: 1000;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-pic {
  position: static;
  transform: none;
  width: clamp(52px, 3.35vw, 64px);
  height: clamp(52px, 3.35vw, 64px);
  z-index: 1000;
}

.profile-initials {
  font-family: 'e-UkraineHead Regular', Helvetica, sans-serif;
  font-weight: 700;
  font-size: clamp(32px, 2.4vw, 42px);
  line-height: 1;
  letter-spacing: 1px;
  color: var(--button-white);
  user-select: none;
}

.all-reviews-btn {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* The Modal (background) */
.modal {
  --modal-viewport-gap: 32px;
  --modal-top-padding: clamp(72px, 7vh, 80px);
  --modal-x-padding: clamp(20px, 4.5vw, 65px);
  --modal-bottom-padding: clamp(22px, 4vh, 40px);
  box-sizing: border-box;
  margin: auto;
  border: none !important;
  width: min(760px, calc(100vw - var(--layout-gutter) - var(--layout-gutter)));
  max-height: calc(100dvh - var(--modal-viewport-gap));
  background-color: rgba(0,0,0,0);
  padding: var(--modal-top-padding) var(--modal-x-padding) var(--modal-bottom-padding);
  outline: none;
  overflow: hidden;
}


dialog::backdrop {
  background: rgba(22, 22, 22, 0.42);
  backdrop-filter: blur(2px);
}

#closeBtn {
  position: absolute;
  top: clamp(20px, 5%, 38px);
  right: clamp(18px, 4%, 32px);
  border: 0;
  background: transparent;
  line-height: 0;
  padding: 11px;
  margin: -11px;
  cursor: pointer;
  z-index: 1001;
}

#closeBtn img {
  display: block;
}

#closeBtn:focus-visible {
  outline: 2px solid var(--text-red);
  outline-offset: 6px;
  border-radius: 50%;
}

.modal-content {
  display: flex;
  justify-content: center;
  position: relative;
  max-height: calc(100dvh - var(--modal-viewport-gap) - var(--modal-top-padding) - var(--modal-bottom-padding));
  min-height: 0;
}

.profile-pic-bg-modal {
  position: absolute;
  width: clamp(104px, 12vw, 128px);
  height: clamp(104px, 12vw, 128px);
  background: var(--button-red);
  border-radius: 9999px;
  border: 0.5px var(--text-red) solid;
  z-index: 1000;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal .review-card {
  height: auto;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.modal .content {
  height: auto;
  min-height: 0;
}

.modal .review-details {
  min-height: 0;
  overflow: hidden;
}

#modal-text {
  flex: 1 1 auto;
  line-height: 1.25;
  min-height: 0;
  max-height: clamp(260px, 48dvh, 560px);
  overflow-y: auto;
  outline: none;
  padding-right: 10px;
  scrollbar-gutter: stable;
}

.review-text {
  text-overflow: ellipsis;
  overflow: hidden;
  height: auto;
  flex-shrink: 0;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
}

@media (max-width: 670px) {

  #closeBtn {
    right: 20px;
  }

  .review-card {
    padding: 79px 20px 20px 20px;
  }

  .modal {
    margin: 0 auto;
    border: none !important;
    width: calc(100vw - var(--layout-gutter) - var(--layout-gutter));
    background-color: rgba(0,0,0,0);
    max-height: calc(100dvh - 20px);
    padding-top: 65px;
    padding-left: 0px;
    padding-right: 0px;
    padding-bottom: 0px;
    outline: none;
  }

  .modal-content {
    max-height: calc(100dvh - 85px);
  }

  #modal-text {
    max-height: clamp(260px, 50dvh, 520px);
  }

  .reviews-section {
    margin-top: 160px;
    flex-shrink: 0;
  }

  .reviews-content {
    position: relative;
    padding-top: 30px;
  }

  .all-reviews-btn {
    margin-top: 80px;
  }

  #reviews-prev {
    margin-top: 20px;
    margin-bottom: 40px;
    position: absolute;
    top: 90%;
    transform: translateX(-110%);
    z-index: 1000;
  }

  #reviews-next {
    margin-top: 20px;
    margin-bottom: 40px;
    position: absolute;
    top: 90%;
    transform: translateX(110%);
    z-index: 1000;
  }

  .card-wrapper {
    padding-left: 27px;
    padding-right: 27px;
  }
}
