/* Backpack Effect — hand-crafted teaching diagrams */

/* ── Shared diagram panel ─────────────────────────────────── */

.teach-diagram {
  max-width: none;
  margin: 1.75rem 0 2.25rem;
  padding: 1.15rem 1.15rem 1.25rem;
  background: var(--cool-grey);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.teach-diagram figcaption {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--navy);
  margin: 0 0 1rem;
  text-transform: none;
  letter-spacing: normal;
}

.article-prose .teach-diagram h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--navy);
  margin: 0 0 0.35rem;
  scroll-margin-top: 0;
}

.teach-diagram p,
.teach-diagram li {
  max-width: none;
}

.teach-diagram :focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.teach-diagram .figure-note {
  margin: 0;
  padding: 0.75rem 1.25rem 1.05rem;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-muted);
  border-top: 1px solid var(--line);
}

/* ── A. Leverage matrix table ─────────────────────────────── */

.pack-table__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.15rem;
  padding: 0 0.15rem;
}

.pack-table__table {
  width: 100%;
  min-width: 32rem;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.pack-table__table thead {
  background: var(--navy);
}

.pack-table__table th {
  padding: 0.65rem 0.75rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: left;
  border-bottom: 1px solid var(--gold);
  white-space: nowrap;
}

.pack-table__table td {
  padding: 0.7rem 0.75rem;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.pack-table__table tbody tr:last-child td {
  border-bottom: none;
}

.pack-table__table tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.65);
}

.pack-table__table td:first-child {
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}

.pack-table__table td:nth-child(2) {
  font-weight: 600;
  color: var(--navy);
}

.pack-table__table td:last-child {
  font-weight: 600;
  color: var(--navy);
}

/* ── B. Neutral spine vs backpack effect ──────────────────── */

.pack-spine {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.pack-spine__panel {
  flex: 1;
  min-width: 0;
}

.pack-spine__chart {
  margin: 0.35rem 0 0.5rem;
  position: relative;
}

.pack-spine__chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.pack-spine__chart--lean {
  padding-right: 0.25rem;
}

.pack-spine__fat-label {
  position: absolute;
  right: 0.25rem;
  top: 48%;
  transform: translateY(-50%);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--navy);
  background: rgba(248, 250, 252, 0.94);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  line-height: 1.35;
  text-align: center;
  max-width: 7.5rem;
}

.pack-spine__shear-label {
  position: absolute;
  left: 0.15rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--navy);
  background: rgba(248, 250, 252, 0.94);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  line-height: 1.3;
  max-width: 5.5rem;
}

.pack-spine__caption {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.pack-spine__callout {
  display: inline-block;
  margin-top: 0.35rem;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--navy);
  background: rgba(248, 250, 252, 0.94);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

@media (min-width: 560px) {
  .pack-spine {
    flex-direction: row;
    gap: 1.5rem;
  }
}

/* ── Reduced motion ───────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .teach-diagram,
  .teach-diagram * {
    animation: none !important;
    transition: none !important;
  }
}
