/* Research page, "The surgeons I write with." (research--coauthors.html)
   Replaces the old .co__* progress-bar list (still defined, now dead, in research.html's
   inline <style>) with a per-person partnership strip: one small stacked-bar chart per
   co-author, x = year (a shared 2001-2026 axis), bar height = papers that year, color =
   who led it. A white plate glides between rows on hover/focus; hovering a single year's
   bar swaps the readout to that year; the row itself always filters the explorer on click. */

.coa__grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.coa__grid .lede { margin-top: 1rem; }

.coa__key { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; margin-top: 1.5rem; }
.coa__k { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--label); font-weight: 600; font-size: 0.86rem; color: var(--muted); }
.coa__k-mark { position: relative; width: 9px; height: 15px; border-radius: 2px 2px 1px 1px; background: rgba(10, 13, 18, 0.08); overflow: hidden; flex: none; }
.coa__k-mark::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; border-radius: 2px 2px 1px 1px; }
.coa__k--me .coa__k-mark::after { height: 100%; background: var(--accent); }
.coa__k--them .coa__k-mark::after { height: 68%; background: var(--ink); }
.coa__k--other .coa__k-mark::after { height: 40%; background: var(--muted); }

.coa__detail { margin-top: 1.1rem; min-height: 3.1rem; font-size: 0.98rem; line-height: 1.5; color: var(--muted); max-width: 46ch; }
.coa__detail b { color: var(--ink); font-weight: 600; font-family: var(--display); }

.coa__axis { display: grid; grid-template-columns: 1.7rem 12.5rem minmax(0, 1fr) 3rem; align-items: end; margin: 0 0 0.3rem; }
.coa__axis > span { grid-column: 3; display: flex; justify-content: space-between; font-family: var(--label); font-weight: 600; font-size: 0.76rem; color: var(--muted); opacity: 0.75; }

.coa__list { position: relative; list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; border-top: 1px solid var(--line); }
.coa__plate { position: absolute; left: 0; right: 0; top: 0; height: 0; opacity: 0; background: #fff; border-radius: 14px; box-shadow: 0 14px 28px rgba(10, 13, 18, 0.09), 0 2px 7px rgba(10, 13, 18, 0.06); pointer-events: none; z-index: 0; transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1), height 0.4s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease; }
.coa__list.is-active .coa__plate { opacity: 1; }

.coa__row { position: relative; z-index: 1; border-bottom: 1px solid var(--line); opacity: 0; transform: translateY(10px); transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out); transition-delay: var(--d, 0ms); }
.coa__row:last-child { border-bottom: 0; }
.coa__list.is-in .coa__row { opacity: 1; transform: none; }

.coa__btn { width: 100%; display: grid; grid-template-columns: 1.7rem 12.5rem minmax(0, 1fr) 3rem; align-items: center; gap: 0.9rem; padding: 0.85rem 0.85rem; border: 0; border-radius: 14px; background: none; cursor: pointer; text-align: left; }
.coa__rank { font-family: var(--label); font-weight: 600; font-size: 0.86rem; color: var(--muted); font-variant-numeric: tabular-nums; transition: color 0.2s; }
.coa__name { font-family: var(--display); font-weight: 600; font-size: 1.06rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coa__count { font-family: var(--label); font-weight: 600; font-size: 0.98rem; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; transition: color 0.2s; }
.coa__btn:hover .coa__rank, .coa__btn:focus-visible .coa__rank { color: var(--accent); }
.coa__btn:hover .coa__count, .coa__btn:focus-visible .coa__count { color: var(--accent); }

.coa__strip { position: relative; height: 34px; display: block; }
.coa__bar { position: absolute; left: var(--x); bottom: 0; width: 4px; height: var(--h); margin-left: -2px; display: flex; flex-direction: column-reverse; border-radius: 2px 2px 1px 1px; overflow: hidden; transform: scaleY(0); transform-origin: bottom; transition: transform 0.55s cubic-bezier(0.28, 0.11, 0.32, 1); transition-delay: calc(var(--d, 0ms) + 90ms); }
.coa__list.is-in .coa__bar { transform: scaleY(1); }
.coa__seg { display: block; width: 100%; height: var(--sh); flex: none; }
.coa__seg--me { background: var(--accent); }
.coa__seg--them { background: var(--ink); }
.coa__seg--other { background: var(--muted); }
.coa__bar:hover, .coa__bar.is-on { transform: scaleY(1.1); }
.coa__bar:hover .coa__seg, .coa__bar.is-on .coa__seg { filter: brightness(1.08); }

@media (prefers-reduced-motion: reduce) {
  .coa__row { opacity: 1; transform: none; transition: none; }
  .coa__bar { transform: scaleY(1); transition: none; }
  .coa__list .coa__plate { transition: none; }
}

@media (max-width: 960px) {
  .coa__grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .coa__axis, .coa__btn { grid-template-columns: 1.3rem 9.5rem minmax(0, 1fr) 2.3rem; gap: 0.6rem; }
  .coa__btn { padding: 0.7rem 0.6rem; }
  .coa__name { font-size: 1rem; }
  .coa__strip { height: 28px; }
}
