/* v2 / Companion: claim-first sections; each figure stays pinned beside the text that discusses it. */
main { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Reading progress: one tick per section, under the site nav. */
.rail { position: fixed; top: 57px; left: 0; right: 0; z-index: 90; height: 30px; background: var(--global-bg-color); border-bottom: 1px solid var(--global-divider-color); }
.rail ol { list-style: none; margin: 0 auto; padding: 0 24px; max-width: 1200px; height: 100%; display: flex; gap: 4px; align-items: center; }
.rail li { flex: 1; height: 100%; display: flex; align-items: center; }
.rail a { display: block; width: 100%; height: 4px; border-radius: 2px; background: var(--global-divider-color); transition: background .25s; }
.rail a[aria-current="true"], .rail a.done { background: var(--global-theme-color); }
.rail a.done { opacity: .45; }
.rail a:hover { text-decoration: none; background: var(--global-hover-color); opacity: 1; }
body.companion { padding-top: 87px; }

.post-header { max-width: 760px; padding: 3rem 0 1.5rem; }
.post-header .venue { margin: 0 0 .9rem; font-size: .9rem; font-weight: 500; color: var(--global-text-color-light); }
.post-header h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; font-weight: 300; letter-spacing: -.015em; }
.post-header h1 b { font-weight: 700; }
.post-header .subtitle { margin: .9rem 0 0; font-size: 1.15rem; color: var(--global-text-color-light); }
.post-header .authors { margin: 1.25rem 0 0; line-height: 1.8; }
.post-header .aff { color: var(--global-text-color-light); }
.post-header .links { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: .5rem 0 0; font-weight: 500; }

article > section { padding-top: 4rem; scroll-margin-top: 95px; }
.claim { max-width: 760px; margin-bottom: 2rem; }
.claim .where { margin: 0 0 .4rem; font-size: .9rem; font-weight: 600; color: var(--global-theme-color); font-variant-numeric: tabular-nums; }
.claim h2 { margin: 0; font-size: clamp(1.45rem, 3vw, 1.95rem); line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
.claim .sub { margin: .5rem 0 0; font-size: 1rem; color: var(--global-text-color-light); }

.row { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 3.25rem; align-items: start; margin-bottom: 3rem; }
.row.text-only { grid-template-columns: minmax(0, 760px); }
.figcol { position: sticky; top: 103px; }
figure.fig { margin: 0; }
.fig-missing { padding: 3rem 1rem; text-align: center; color: var(--global-text-color-light); }

.prose { font-size: 1.02rem; line-height: 1.72; }
.prose p { margin: 0 0 1.05rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.05rem; }
.prose li { margin: .35rem 0; }
.prose strong { font-weight: 600; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: .86rem; font-variant-numeric: tabular-nums; }
.prose th { text-align: left; font-weight: 600; padding: .45rem .5rem; border-bottom: 2px solid var(--global-divider-color); }
.prose td { padding: .5rem .5rem; border-top: 1px solid var(--global-divider-color); vertical-align: top; }
.prose .katex-display { overflow-x: auto; overflow-y: hidden; padding: .35rem 0; }

.cite { max-width: 760px; margin-top: 4rem; }
.cite h2 { font-size: 1.25rem; font-weight: 600; margin: 0 0 .75rem; }
.cite pre { margin: 0; padding: 1rem; overflow-x: auto; font-size: .82rem; line-height: 1.5; background: var(--global-code-bg-color); border-radius: 8px; }
.cite button { margin-top: .6rem; font: 500 .9rem var(--site-font); color: var(--global-theme-color); background: none; border: 1px solid var(--global-divider-color); border-radius: 6px; padding: .35rem .8rem; cursor: pointer; }

@media (max-width: 1080px) {
  .row { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .figcol { position: static; }
}
@media (max-width: 600px) {
  main { padding: 0 15px; }
}
body.companion .site-nav .inner { max-width: 1200px; padding: 0 24px; }
.figcol.tall { position: static; } /* a figure taller than the screen would be cut off if pinned */

/* Wide tables scroll sideways on phones instead of overflowing the page. */
.prose table { display: block; overflow-x: auto; max-width: 100%; }
