/* Reviews: cards, star ratings and the review form.
   Shared by the home page and reviews.html; uses the brand tokens on :root. */

#reviews {
  background-color: var(--light-bg);
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Summary line and buttons */
.reviews-summary {
  text-align: center;
  margin-bottom: 2rem;
}

.reviews-summary .google-rating {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.reviews-summary .google-rating a {
  color: var(--accent-dark);
}

.reviews-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.review-btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 5px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid var(--secondary-color);
  background-color: var(--secondary-color);
  color: white;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.review-btn:hover,
.review-btn:focus-visible {
  background-color: var(--accent-dark);
  border-color: var(--accent-dark);
}

.review-btn.outline {
  background-color: transparent;
  color: var(--accent-dark);
}

.review-btn.outline:hover,
.review-btn.outline:focus-visible {
  background-color: var(--accent-dark);
  color: white;
}

.review-btn[hidden] {
  display: none;
}

/* Cards */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.review-card {
  display: flex;
  flex-direction: column;
  background: white;
  padding: 1.5rem 2rem;
  border-left: 8px solid var(--secondary-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.review-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.review-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.review-source {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-dark);
  border: 1px solid var(--secondary-color);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  white-space: nowrap;
  text-decoration: none;
}

a.review-source:hover {
  background-color: var(--secondary-color);
  color: white;
}

.review-text {
  white-space: pre-line;
  font-weight: 300;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  overflow: hidden;
}

.review-card.expanded .review-text {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: none;
}

.review-more {
  align-self: flex-start;
  margin-top: 0.25rem;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-dark);
  text-decoration: underline;
  cursor: pointer;
}

.review-meta {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.9rem;
  color: #666;
}

.review-meta strong {
  color: var(--accent-dark);
}

.reviews-empty,
.reviews-error {
  text-align: center;
  font-weight: 300;
  font-size: 1.1rem;
}

/* Stars shown on cards */
.stars {
  display: inline-flex;
  gap: 2px;
  line-height: 0;
}

.stars svg {
  width: 20px;
  height: 20px;
}

.stars .on {
  fill: var(--primary-color);
  stroke: var(--accent-dark);
  stroke-width: 1.2;
}

.stars .off {
  fill: none;
  stroke: #c5cbbf;
  stroke-width: 1.2;
}

/* Home page: swipeable row of cards on phones */
@media (max-width: 768px) {
  .reviews-grid.carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.5rem 0.25rem 1rem;
    -webkit-overflow-scrolling: touch;
  }

  .reviews-grid.carousel .review-card {
    flex: 0 0 85%;
    scroll-snap-align: center;
  }

  .reviews-grid.carousel .review-card:hover {
    transform: none;
  }
}

/* Review form */
.review-form {
  background-color: var(--secondary-color);
  color: #333;
  padding: 2rem;
  border-radius: 10px;
  max-width: 500px;
  margin: 2.5rem auto 0;
  position: relative;
}

.review-form h3 {
  font-family: 'Playfair Display', serif;
  color: white;
  font-size: 1.6rem;
  text-align: center;
}

.review-form label,
.review-form legend {
  display: block;
  margin: 1rem 0 0.25rem;
  text-align: left;
  font-weight: 600;
}

.review-form input[type=text],
.review-form input[type=email],
.review-form textarea {
  width: 100%;
  padding: 0.5rem;
  border-radius: 5px;
  border: none;
  font-family: inherit;
  font-size: 1rem;
}

.review-form .char-count {
  font-size: 0.8rem;
  text-align: right;
}

.review-form .consent {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-weight: 400;
  font-size: 0.9rem;
}

.review-form .consent input {
  margin-top: 0.3rem;
  flex: 0 0 auto;
}

.review-form button[type=submit] {
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background-color: white;
  color: var(--accent-dark);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  font-weight: bold;
  font-size: 1rem;
}

.review-form button[type=submit]:disabled {
  opacity: 0.6;
  cursor: wait;
}

.review-form .form-note {
  margin-top: 1rem;
  font-size: 0.85rem;
  text-align: left;
}

.review-form .form-status {
  margin-top: 1rem;
  font-weight: 600;
}

.review-form .form-status:empty {
  display: none;
}

.review-form .hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Star picker: five radio buttons shown as stars, lit up to the chosen one */
.star-input {
  border: none;
  padding: 0;
  margin: 0;
}

.star-input .star-row {
  display: flex;
  gap: 0.25rem;
}

.star-input label {
  margin: 0;
  cursor: pointer;
  line-height: 0;
  border-radius: 4px;
  transition: transform 0.15s ease;
}

.star-input label svg {
  width: 36px;
  height: 36px;
  fill: white;
  stroke: var(--accent-dark);
  stroke-width: 1.2;
}

.star-input label:hover {
  transform: scale(1.15);
}

.star-input:has(input:checked) label svg {
  fill: var(--primary-color);
}

.star-input input:checked + label ~ label svg {
  fill: white;
}

.star-input input:focus-visible + label {
  outline: 3px solid white;
  outline-offset: 2px;
}
