/* XED-authored sections on the Harvard ELP home page — Cohort Statistics and
 * Testimonials. harvard.edu has no design for these, so they are built from
 * Harvard's own tokens (--c-crimson, --c-charcoal, --f-serif …, defined in
 * style-3.css) to sit naturally beside the vendored accordion items.
 *
 * Loaded after style-1..5 and, like them, unlayered: Harvard's reset
 * (`ul, li, h3, b … { margin:0; padding:0; font:inherit }`, `ul { list-style:none }`)
 * is unlayered too, so plain class selectors here win on specificity, which
 * Tailwind's layered utilities would not. See style-5 for the full story.
 */

/* ── Cohort Statistics ─────────────────────────────────────────────── */

/* minmax(0, …) and min-width: 0 matter: the band's track is as wide as every
   name laid end to end, and an auto-sized grid column would stretch to fit it,
   pushing the chart and chips off the right edge. */
.xed-stats { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
.xed-stats__group { min-width: 0; }

/* Headings are shown exactly as written in the CMS (sentence case, per
   Harvard's review): no forced capitals or tracking. */
.xed-stats__label {
  margin-bottom: 16px;
  font-family: var(--f-sans);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--c-charcoal);
}

.xed-stats__experience { display: grid; gap: 32px; }
@media (min-width: 750px) {
  .xed-stats__experience { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 48px; align-items: start; }
}

/* Headline number, with the crimson rule Harvard uses on pull quotes. */
.xed-stats__average { padding-left: 20px; border-left: 4px solid var(--c-crimson); }
.xed-stats__average .xed-stats__label { margin-bottom: 8px; }
.xed-stats__average-value {
  font-family: var(--f-serif);
  font-size: 3rem;
  line-height: 1;
  color: var(--c-process-black);
}

/* Work-experience bars: label | bar | value. Bars are thin, anchored at the
   left baseline, rounded only at the data end, and scaled to the largest
   bucket. Values are printed, so no hover layer is needed. */
.xed-bars { display: grid; gap: 14px; }
.xed-bars__row {
  display: grid;
  grid-template-columns: minmax(6.5rem, 9rem) minmax(0, 1fr) 3rem;
  gap: 12px;
  align-items: center;
}
.xed-bars__label { font-size: .9375rem; line-height: 1.3; color: var(--c-process-black); }
.xed-bars__label small { display: block; font-size: .8125rem; color: var(--c-charcoal); }
.xed-bars__track { display: block; height: 14px; }
.xed-bars__fill {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--c-crimson);
}
.xed-bars__value {
  font-size: .9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--c-process-black);
}

/* Designations / sectors chips. Side by side when both are present; a single
   group (e.g. sectors left out of the CMS) takes the full width instead of
   leaving the right column empty. */
.xed-stats__lists { display: grid; gap: 32px; }
@media (min-width: 750px) {
  .xed-stats__lists { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
  .xed-stats__lists > :only-child { grid-column: 1 / -1; }
}
.xed-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.xed-chips li {
  padding: 6px 12px;
  font-size: .875rem;
  line-height: 1.3;
  color: var(--c-process-black);
  background: var(--c-parchment-lighter);
}

/* Scrolling schools band. Two identical sets; the track slides by exactly
   half its width, so the loop has no seam. */
.xed-band {
  overflow: hidden;
  padding: 20px 0;
  border-top: 1px solid var(--c-parchment);
  border-bottom: 1px solid var(--c-parchment);
}
.xed-band__track {
  display: flex;
  width: max-content;
  animation: xed-band-scroll var(--xed-band-duration, 60s) linear infinite;
}
.xed-band:hover .xed-band__track { animation-play-state: paused; }
.xed-band__set { display: flex; flex-shrink: 0; align-items: center; }
.xed-band__item { display: flex; align-items: center; white-space: nowrap; }
.xed-band__item--logo { padding-left: 48px; }
.xed-band__logo { display: block; width: auto; max-width: 160px; height: 40px; object-fit: contain; }
.xed-band__item--text {
  padding-left: 24px;
  font-family: var(--f-serif);
  font-size: 1.25rem;
  line-height: 1.2;
  color: var(--c-process-black);
}
/* Square crimson separator before each name (Harvard lists use square markers). */
.xed-band__item--text::before {
  content: "";
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-right: 24px;
  background: var(--c-crimson);
}
@keyframes xed-band-scroll { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  .xed-band__track { width: auto; animation: none; }
  .xed-band__set { flex-shrink: 1; flex-wrap: wrap; row-gap: 12px; }
  .xed-band__set[aria-hidden="true"] { display: none; }
}

/* ── Testimonials ──────────────────────────────────────────────────── */

/* Quote cards, after the cornell-v2 template's testimonials: a thin border with
   a crimson top edge, an italic serif quote, and the credit pinned to the
   bottom so cards in a row line up. Columns follow the panel's own width
   (two in the desktop accordion, one on phones), not the viewport's. */
.xed-testimonials {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}
.xed-testimonial {
  display: grid;
  align-content: space-between;
  gap: 20px;
  padding: 26px 26px 22px;
  background: var(--c-white);
  border: 1px solid var(--c-parchment);
  border-top: 3px solid var(--c-crimson);
}
.xed-testimonial__quote p {
  font-family: var(--f-serif);
  font-size: 1.125rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--c-process-black);
  white-space: pre-line;
}
.xed-testimonial__credit { display: flex; align-items: center; gap: 14px; }
.xed-testimonial__photo,
.xed-testimonial__initials { flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; }
.xed-testimonial__photo { object-fit: cover; }
/* Placeholder until a photo URL is added in the CMS. */
.xed-testimonial__initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-serif);
  font-size: 1.25rem;
  color: var(--c-crimson);
  background: var(--c-parchment-lighter);
}
.xed-testimonial__name {
  display: block;
  font-family: var(--f-serif);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--c-process-black);
}
.xed-testimonial__role {
  display: block;
  margin-top: 2px;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--c-charcoal);
}
