.student-reviews {
  padding-block: clamp(2.75rem, 6vw, 5rem);
}

.hero + .student-reviews {
  padding-top: 0;
  scroll-margin-top: 90px;
}

.student-reviews-heading,
.student-review-controls {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.student-reviews-heading {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

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

.student-review-controls button {
  width: 44px;
  height: 44px;
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 50%;
  color: var(--fg0);
  font: 1.25rem/1 system-ui, sans-serif;
  cursor: pointer;
}

.student-review-controls button:hover:enabled {
  border-color: var(--fg2);
}

.student-review-controls button:disabled {
  opacity: .4;
  cursor: default;
}

.student-review-position {
  margin-right: .4rem;
  color: var(--fg2);
  font: .8rem/1.2 'Fira Code', monospace;
}

.student-review-list {
  --review-gap: 1.1rem;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - var(--review-gap)) / 2);
  gap: var(--review-gap);
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--bg3) var(--bg-hard);
}

.student-reviews:has(.student-review-controls:not([hidden])) .student-review-list {
  scrollbar-width: none;
}

.student-review-list:has(details[open]) {
  align-items: start;
}

.student-review-list:focus-visible,
.student-review-controls button:focus-visible,
.student-review-more summary:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.student-review-card {
  --review-accent: var(--orange);
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(1.25rem, 2.6vw, 2.2rem);
  border: 1px solid var(--bg2);
  border-radius: var(--radius);
  background: var(--bg);
  scroll-snap-align: start;
  overflow-wrap: anywhere;
}

.student-review-card.is-rcai {
  --review-accent: var(--aqua);
}

.student-review-card figure {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.student-review-course {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: 1rem;
  color: var(--review-accent);
  font: 600 .8rem/1.4 'Fira Code', monospace;
  letter-spacing: .055em;
}

.student-review-course::before {
  content: '';
  width: 1.5rem;
  height: 2px;
  background: currentColor;
}

.student-review-card figure blockquote {
  flex: 1;
  min-height: 4.4em;
  color: var(--fg0);
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  line-height: 1.46;
}

.student-review-card figcaption,
.course-review-excerpt figcaption {
  margin-top: .85rem;
  color: var(--fg2);
  font-size: .93rem;
  font-weight: 600;
}

.student-review-more {
  margin-top: .85rem;
  border-top: 1px solid var(--bg1);
}

.student-review-more summary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  color: var(--review-accent);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.student-review-more summary::-webkit-details-marker {
  display: none;
}

.student-review-more summary::after {
  content: '';
  width: .45rem;
  height: .45rem;
  border-right: 1.5px solid;
  border-bottom: 1.5px solid;
  transform: translateY(-2px) rotate(45deg);
}

.student-review-more[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.student-review-more .review-when-open,
.student-review-more[open] .review-when-closed {
  display: none;
}

.student-review-more[open] .review-when-open {
  display: inline;
}

.student-review-more blockquote {
  color: var(--fg);
  line-height: 1.65;
  white-space: pre-line;
}

.review-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.course-review-excerpt {
  position: relative;
  margin-top: 1.25rem;
  border-left: 2px solid var(--cc);
  padding: .2rem 0 .2rem 1rem;
  color: var(--fg0);
  font-size: 1rem;
  line-height: 1.5;
}

.course-review-excerpt figcaption {
  margin-top: .45rem;
}

@media (max-width: 700px) {
  .student-review-list {
    --review-gap: .7rem;
    grid-auto-columns: 92%;
  }

  .student-review-card figure blockquote {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .hero + .student-reviews {
    scroll-margin-top: 145px;
  }
}
