.references .references-heading {
  margin-bottom: 1.5rem;
}

.reference-viewport {
  --card-width: calc((100% - 2rem) / 3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.reference-viewport:focus-visible,
.reference-controls button:focus-visible {
  outline: 2px solid #b40000;
  outline-offset: 2px;
}

.reference-viewport[data-ready] {
  scrollbar-width: none;
}

.reference-viewport[data-ready]::-webkit-scrollbar {
  display: none;
}

.reference-track {
  position: relative;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reference-card {
  flex: 0 0 var(--card-width);
  min-width: 0;
  display: flex;
  padding: clamp(1.2rem, 2.1vw, 1.7rem);
  background: #fff;
  border: 1px solid #dedede;
  border-radius: 16px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.reference-card figure {
  display: flex;
  flex: 1;
  flex-direction: column;
  margin: 0;
}

.reference-card figure::before {
  content: '“' / '';
  height: 2.2rem;
  color: #b40000;
  font: 3.4rem/.9 Georgia, serif;
}

.reference-card blockquote {
  margin: 0;
  flex: 1;
}

.references .reference-card p {
  max-width: none;
  color: #292929;
  font-size: 1rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.reference-card figcaption {
  margin-top: 1.05rem;
  padding-top: .7rem;
  border-top: 1px solid #e5e5e5;
  color: #161616;
  font-weight: 750;
}

.reference-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem .8rem;
  margin-top: .8rem;
}

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

.reference-arrows, .reference-dots {
  display: flex;
  align-items: center;
}

.reference-arrows { gap: .35rem; }

.reference-controls button {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid #d2d2d2;
  border-radius: 8px;
  background: #fff;
  color: #171717;
  font: inherit;
  cursor: pointer;
}

.reference-controls button:hover {
  border-color: #a60000;
}

.reference-arrows button { min-width: 44px; }
.reference-arrows svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.reference-dots button {
  width: 27px;
  border: 0;
  background: transparent;
}

.reference-dots button::before {
  content: '';
  width: 7px;
  height: 7px;
  border: 1px solid #666;
  border-radius: 50%;
}

.reference-dots button[aria-current="true"]::before {
  width: 13px;
  height: 8px;
  border-color: #a60000;
  background: #a60000;
  border-radius: 6px;
}

.reference-dots { margin-left: auto; }

.reference-controls .reference-toggle {
  padding-inline: .7rem;
  font-size: .875rem;
}

.references .reference-note {
  max-width: none;
  margin-top: .5rem;
  font-size: .875rem;
}

@media (max-width: 1000px) {
  .reference-viewport { --card-width: calc((100% - 1rem) / 2); }
}

@media (max-width: 620px) {
  .reference-viewport { --card-width: 100%; }
  .reference-dots {
    margin-left: 0;
    order: 1;
    flex-basis: 100%;
    justify-content: center;
  }
}
