/* =========================================================
   PROJECT REVIEW SECTION + REVIEWER CONTACT MODAL
   Shown on project detail pages when a matching testimonial exists
   ========================================================= */

/* ── Review Section ─────────────────────────────────────── */

.pr-section {
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-gray-200);
}

.pr-card {
  background: var(--surface-alt);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
  padding: 2rem;
}

.pr-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.pr-client {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.pr-portrait {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-gray-200);
}

.pr-client-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.pr-name {
  font-weight: 700;
  color: var(--color-gray-900);
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pr-name a {
  color: inherit;
  text-decoration: none;
}

.pr-name a:hover {
  text-decoration: underline;
}

.pr-linkedin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 4px;
  border-radius: 4px;
  background: #0a66c2;
  color: #fff;
  line-height: 0;
  vertical-align: middle;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}

.pr-linkedin:hover {
  background: #004182;
  color: #fff;
}

.pr-linkedin svg {
  width: 14px;
  height: 14px;
  display: block;
  fill: currentColor;
}

/* Source buttons — same look as the home page review badges */
.pr-review-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
}

.hp-review-badges.pr-review-badges {
  margin-bottom: 0;
}

.hp-review-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.hp-review-badge img {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
}

.hp-review-badge:hover,
.hp-review-badge:focus-visible {
  filter: brightness(1.15);
  transform: translateY(-1px);
  color: #ffffff;
  text-decoration: none;
}

.hp-review-badge--upwork {
  background: #14a800;
}

.hp-review-badge--clutch {
  background: #17313b;
}

.hp-review-badge--case {
  background: #5732fa;
}

.hp-review-badge--case svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.pr-company {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.pr-company a {
  color: var(--color-link);
  text-decoration: none;
}

.pr-company a:hover {
  text-decoration: underline;
}

.pr-rating {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.pr-star {
  width: 20px;
  height: 20px;
  color: var(--color-yellow, #f59e0b);
}

.pr-star--filled {
  color: var(--color-yellow, #f59e0b);
}

.pr-feedback {
  margin: 0 0 1.25rem;
  padding: 0;
  border: none;
}

.pr-feedback p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--color-gray-700);
  font-style: italic;
  margin: 0;
}

.pr-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.pr-source {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.pr-source:hover {
  color: var(--color-link);
}

.pr-source-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--surface-soft);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-gray-600);
}

.pr-talk-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--color-purple);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-purple);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.pr-talk-btn:hover {
  background: var(--color-purple);
  color: var(--color-white);
}

.pr-talk-btn:focus-visible {
  outline: 2px solid var(--color-purple);
  outline-offset: 2px;
}

/* ── Reviewer Contact Modal ─────────────────────────────── */

.rc-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
}

.rc-modal[hidden] {
  display: none;
}

.rc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(29, 17, 82, 0.55);
  backdrop-filter: blur(2px);
}

.rc-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2rem 2rem;
  box-shadow: 0 24px 60px rgba(45, 26, 127, 0.25);
  animation: rc-modal-in 0.22s ease;
}

@keyframes rc-modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.rc-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--surface-soft);
  color: var(--color-purple);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.rc-modal-close:hover {
  background: var(--surface-soft);
  color: var(--color-purple-darkest);
  transform: rotate(90deg);
}

.rc-modal-close svg {
  width: 18px;
  height: 18px;
}

.rc-modal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(124, 250, 195, 0.12);
  color: var(--color-purple-deep);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  border: 1px solid rgba(124, 250, 195, 0.4);
}

.rc-modal-eyebrow .rc-modal-dot {
  width: 6px;
  height: 6px;
  background: var(--color-mint);
  border-radius: 50%;
}

.rc-modal-dialog h2 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--color-gray-900);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.rc-modal-dialog p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.rc-modal-form {
  display: grid;
  gap: 0.9rem;
}

.rc-modal-field {
  display: grid;
  gap: 0.35rem;
}

.rc-modal-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-gray-700);
}

.rc-modal-field input,
.rc-modal-field textarea {
  width: 100%;
  background: var(--surface-soft);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--color-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  resize: vertical;
}

.rc-modal-field input:focus,
.rc-modal-field textarea:focus,
.rc-modal-field select:focus {
  outline: none;
  border-color: var(--color-purple);
  box-shadow: 0 0 0 3px rgba(79, 46, 222, 0.15);
}

.rc-modal-field select {
  width: 100%;
  background: var(--surface-soft);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--color-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

.rc-modal-availability {
  border-top: 1px solid var(--color-gray-200);
  padding-top: 1rem;
}

.rc-modal-availability-note {
  font-size: 0.85rem !important;
  color: var(--color-text-muted) !important;
  font-style: italic;
  margin-bottom: 0.9rem !important;
}

.rc-modal-field-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-gray-700);
  display: block;
  margin-bottom: 0.2rem;
}

.rc-modal-required {
  color: #ef4444;
  margin-left: 2px;
}

.rc-modal-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.rc-modal-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--color-gray-700);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  user-select: none;
}

.rc-modal-checkbox:hover {
  border-color: var(--color-purple);
  color: var(--color-purple);
}

.rc-modal-checkbox:has(input:checked) {
  border-color: var(--color-purple);
  background: rgba(79, 46, 222, 0.08);
  color: var(--color-purple);
  font-weight: 600;
}

.rc-modal-checkbox:has(input:focus-visible) {
  outline: 2px solid var(--color-purple);
  outline-offset: 2px;
}

.rc-modal-checkbox input {
  width: 0;
  height: 0;
  margin: 0;
  position: absolute;
  opacity: 0;
}

.rc-modal-submit {
  margin-top: 0.4rem;
}

.rc-modal-note {
  font-size: 0.78rem;
  color: var(--color-text-soft);
  margin: 0.25rem 0 0;
}

body.has-rc-modal {
  overflow: hidden;
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 600px) {
  .pr-card {
    padding: 1.25rem;
  }
  .pr-header {
    flex-direction: column;
  }
  .pr-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .rc-modal-dialog {
    padding: 1.75rem 1.25rem 1.5rem;
  }
  .rc-modal-checkbox-group {
    gap: 0.35rem;
  }
  .rc-modal-checkbox {
    padding: 0.35rem 0.55rem;
    font-size: 0.8rem;
  }
}