/* Figures for /research/senocr-zh.
   Built on the editorial variables declared in /research/template.css
   (--ink, --graphite, --stone, --bone, --manilla, --crail, --sage, --wheat,
   --wax, --olive, --slate-blue, --serif, --sans, --mono).

   Shares the figure vocabulary of /research/senocr-vi/figures.css. Rules that
   only this article's artboards need are marked. */

/* ── Frame ──────────────────────────────────────────────── */

.fig {
  margin: 44px 0;
}

/* Break out of the 700px reading column without touching .container. */
.fig--wide {
  width: min(100vw - 32px, 940px);
  margin-left: 50%;
  transform: translateX(-50%);
}

/* Title card between the dateline and the lede. */
.article-hero {
  margin-top: 0;
  margin-bottom: 40px;
}

.article-hero img {
  display: block;
  width: 100%;
  height: auto;
}

.fig-card {
  background: var(--manilla);
  border: 1px solid var(--bone);
  padding: 26px 28px 22px;
}

.fig-head {
  margin: 0 0 24px;
}

.fig-eyebrow {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--crail);
}

.fig-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* Charts keep their proportions on small screens by scrolling sideways
   inside their own card rather than compressing to illegibility. The
   padding-top keeps the top axis tick, which sits at bottom: 100% with a
   50% upward overhang, out of the scroll container's computed overflow-y. */
.fig-scroll {
  overflow-x: auto;
  padding-top: 10px;
}

/* ── Column charts (figures 1 and 3, and the figure 2 panels) ── */

.col-chart {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.col-chart__axis-title {
  width: 20px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: var(--axis-title-offset, 56px);
}

.col-chart__axis-title span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--stone);
}

.col-chart__ticks {
  width: 40px;
  flex: none;
  position: relative;
  height: var(--plot-h);
}

.col-chart__ticks span {
  position: absolute;
  right: 8px;
  transform: translateY(50%);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--stone);
}

.col-chart__ticks::after {
  content: "";
  position: absolute;
  right: 0;
  top: -1px;
  bottom: -1px;
  width: 1px;
  background: var(--graphite);
}

.col-chart__plot {
  flex: 1;
  min-width: 0;
}

.col-chart__grid {
  position: relative;
  height: var(--plot-h);
}

.col-chart__grid hr {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--bone);
}

.col-chart__bars {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: end;
}

.col-chart__baseline {
  height: 1px;
  background: var(--graphite);
}

.col-chart__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

/* A bar's height is a percentage of the plot and encodes the value, so it must
   not be flex-shrunk to make room for the logo and value above it. The column
   overflows its top edge instead; .fig-scroll's padding-top and the panel
   heading's margin absorb it. */
.col-chart__col > * {
  flex: none;
}

.col-chart__value {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--graphite);
  margin-bottom: 7px;
}

.col-chart__col.is-subject .col-chart__value {
  color: var(--crail);
  font-weight: 500;
}

.col-chart__bar {
  width: 62%;
  background: var(--wax);
}

.col-chart__labels {
  display: grid;
  padding-top: 11px;
}

.col-chart__labels > div {
  text-align: center;
  padding: 0 6px;
}

.col-chart__name {
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.col-chart__meta {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--stone);
  margin-top: 3px;
}

/* The artboards break long model names onto fixed lines rather than letting
   them wrap, so each line is its own block and never rewraps. */
.col-chart__name span {
  display: block;
  white-space: nowrap;
}

.col-chart__labels--nowrap .col-chart__name {
  white-space: nowrap;
}

/* ── Figure 1: model comparison ─────────────────────────── */

/* The y-axis starts at 78, not 0. Two rotated hairlines on the axis say so. */
.col-chart__axis-break {
  position: absolute;
  left: -16px;
  width: 13px;
  height: 1px;
  background: var(--graphite);
  transform: rotate(-28deg);
}

.col-chart__logo {
  height: 30px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 8px;
}

.col-chart__logo img {
  height: var(--logo-h, 20px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  opacity: 0.92;
  display: block;
}

/* Figure 1 mutes every category name except the subject. */
.col-chart__labels--muted .col-chart__name {
  color: var(--stone);
}

.col-chart__labels--muted .is-subject .col-chart__name {
  color: var(--ink);
}

/* ── Figure 2: two-panel comparison ─────────────────────── */

.panels {
  display: flex;
  gap: 22px;
}

.panel {
  background: var(--manilla);
  border: 1px solid var(--bone);
  padding: 22px 26px 20px;
  display: flex;
  flex-direction: column;
}

.panel--a { flex: 38; }
.panel--b { flex: 62; }

.panel__head h4 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.panel__note {
  margin: 16px 0 0;
  border-left: 2px solid var(--bone);
  padding-left: 12px;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.5;
  color: var(--graphite);
}

.panel .col-chart__bar {
  width: 72%;
  border-top: 2px solid var(--stone);
}

.panel .col-chart__col.is-subject .col-chart__bar {
  background: var(--crail);
  border-top: 0;
}

.panel .col-chart__value {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.panel .col-chart__col.is-subject .col-chart__value {
  color: var(--ink);
}

.panel .col-chart__name {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}

/* ── Figure 3: retrain target mix ───────────────────────── */

/* Full-width lanes rather than the narrower comparison bars, no vertical
   axis rule, and sans tick labels — as drawn on the artboard. */
.col-chart--lanes .col-chart__ticks::after {
  display: none;
}

.col-chart--lanes .col-chart__ticks span {
  font-family: var(--sans);
  font-size: 12px;
}

.col-chart--lanes .col-chart__bar {
  width: 78%;
}

.col-chart--lanes .col-chart__name {
  font-weight: 500;
}

.col-chart--lanes .col-chart__value {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1px;
}

.col-chart__share {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--stone);
  margin-bottom: 10px;
}

/* The artboard separates the three Chinese lanes from the two structured
   lanes with a pair of hairlines under the label row. */
.lane-rule {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 40px;
  padding-top: 22px;
}

.lane-rule > div {
  height: 1px;
  background: var(--bone);
}

/* ── Figure 4: SVG scatter ──────────────────────────────── */

.fig-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* ── Narrow screens ─────────────────────────────────────── */

@media (max-width: 860px) {
  .panels { flex-direction: column; }
  .panel--a, .panel--b { flex: none; }
}

@media (max-width: 640px) {
  .fig-card { padding: 20px 18px 18px; }
  .fig-title { font-size: 19px; }
  .fig-scroll > * { min-width: 600px; }
}
