/**
 * The course page's reviews — the average, the articles and the form.
 *
 * Linked by `src/pages/course/[slug].astro`, after the course's own captured
 * stylesheet, so the captured page keeps its design and only this block gets one
 * that was drawn for it rather than left at the browser's defaults.
 *
 * Every value below is a token the site already declares — the `:root` block the
 * course stylesheets carry (surface, page, border, radius, spacing, type steps,
 * shadow) and the accent (`--primary`) the stars and the button are drawn in.
 * Nothing here invents a colour, a radius or a size: it names the site's.
 *
 * Everything is scoped under `#old_reviews`, the captured block's own id, because
 * the page it sits in is a captured WordPress page whose rules are written for
 * `.llms_review` and for the article's typography. An id plus a class wins that
 * comparison without `!important`, so the capture's stylesheet is not edited and
 * is not fought with.
 */

/* The average, as a pill under the block's own heading. */
#old_reviews .eva-reviews-average {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-3xs);
  margin: var(--space-2xs) 0 var(--space-s);
  padding: 0.15rem var(--space-2xs) 0.2rem;
  font-family: "Cormorant", Georgia, serif;
  font-size: var(--text-m);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--primary-d-3);
  background: var(--primary-10);
  border: 1px solid var(--primary-20);
  border-radius: var(--radius-full);
}

/* The rows, stacked with the site's spacing step between them. */
#old_reviews .eva-reviews-list {
  display: grid;
  gap: var(--space-s);
  margin: 0 0 var(--space-m);
}

#old_reviews .eva-review {
  display: grid;
  gap: var(--space-2xs);
  margin: 0;
  padding: var(--space-s);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
}

#old_reviews .eva-review__rating {
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
  margin: 0;
  line-height: 1;
}

#old_reviews .eva-review__stars {
  font-size: var(--text-s);
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--primary);
}

#old_reviews .eva-review__stars--empty {
  color: var(--dark-20);
}

#old_reviews .eva-review__body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--text-s);
  line-height: 1.6;
  color: var(--text-body);
  white-space: pre-line;
  overflow-wrap: break-word;
}

#old_reviews .eva-review__author {
  margin: 0;
  padding-top: var(--space-2xs);
  border-top: 1px solid var(--border-primary);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-title);
}

/* The form: the same surface and radius as an article, because it edits one. */
#old_reviews .eva-review-form,
.lv-review .eva-review-form,
.lc-review .eva-review-form {
  display: grid;
  gap: var(--space-xs);
  margin: 0;
  padding: var(--space-s);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
}

#old_reviews .eva-review-form__field,
.lv-review .eva-review-form__field,
.lc-review .eva-review-form__field {
  display: grid;
  gap: 0.3rem;
  margin: 0;
}

#old_reviews .eva-review-form label,
.lv-review .eva-review-form label,
.lc-review .eva-review-form label {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-body);
}

#old_reviews .eva-review-form select,
#old_reviews .eva-review-form textarea,
.lv-review .eva-review-form select,
.lv-review .eva-review-form textarea,
.lc-review .eva-review-form select,
.lc-review .eva-review-form textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.8rem;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--text-s);
  line-height: 1.6;
  color: var(--text-title);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-s);
}

#old_reviews .eva-review-form select,
.lv-review .eva-review-form select,
.lc-review .eva-review-form select {
  cursor: pointer;
}

#old_reviews .eva-review-form textarea,
.lv-review .eva-review-form textarea,
.lc-review .eva-review-form textarea {
  min-height: 6rem;
  resize: vertical;
}

#old_reviews .eva-review-form select:focus,
#old_reviews .eva-review-form textarea:focus,
.lv-review .eva-review-form select:focus,
.lv-review .eva-review-form textarea:focus,
.lc-review .eva-review-form select:focus,
.lc-review .eva-review-form textarea:focus {
  outline: 2px solid var(--primary-20);
  outline-offset: 1px;
  border-color: var(--primary);
}

#old_reviews .eva-review-form__actions,
.lv-review .eva-review-form__actions,
.lc-review .eva-review-form__actions {
  margin: 0;
}

#old_reviews .eva-review-form button,
.lv-review .eva-review-form button,
.lc-review .eva-review-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem var(--space-m);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-d-4);
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#old_reviews .eva-review-form button:hover,
.lv-review .eva-review-form button:hover,
.lc-review .eva-review-form button:hover {
  color: var(--bg-surface);
  background: var(--primary-d-1);
  border-color: var(--primary-d-1);
}

#old_reviews .eva-review-form button:focus-visible,
.lv-review .eva-review-form button:focus-visible,
.lc-review .eva-review-form button:focus-visible {
  outline: 2px solid var(--primary-d-3);
  outline-offset: 2px;
}

#old_reviews .eva-review-form__note,
.lv-review .eva-review-form__note,
.lc-review .eva-review-form__note {
  margin: 0;
  padding: var(--space-2xs) var(--space-xs);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--text-body);
  background: var(--primary-5);
  border: 1px solid var(--border-primary);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-s);
}

/*
 * The dashboard instances. Both are ordinary sections next to the dashboard's
 * cards, so they use the same surface, spacing and radius rather than borrowing
 * the captured block's id. Nothing here changes the public page's rules above.
 */
.lv-review,
.lc-review {
  display: grid;
  gap: var(--space-s);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 0 var(--space-m);
  padding: var(--space-s);
  box-sizing: border-box;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
}

.lv-review > h2,
.lc-review > h2 {
  margin: 0;
  font-family: "Cormorant", Georgia, serif;
  font-size: var(--text-m);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-title);
}

/* At 390px the form's fields must never push the section wider than the page. */
@media (max-width: 390px) {
  .lv-review,
  .lc-review,
  .lv-review .eva-review-form,
  .lc-review .eva-review-form {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}
