/* Comparison pages only (templates/comparison.html and comparison-hub.html link this after site.css): the page uses the whole canvas (#3637, lens 3).
   An article (a comparison of one job) is read in order, so its prose stays one column; the width goes to what sits beside the reading:
   a contents rail on the left and the Sources on the right, and the table spans both. The hub (.hub) holds sibling comparisons, so those sit two across.
   Under 1100 it is the one column it always was (site.js folds the contents list there). Under its own width a table row is a card (dt.css). */

.page.cmp > .toc { margin-bottom: 1.5rem; }

@media (min-width: 1100px) {
  .page.cmp {
    max-width: 78rem; display: grid; grid-template-columns: 14rem minmax(0, 1fr); column-gap: 3rem; align-items: start;
    padding-left: 2rem; padding-right: 2rem;
  }
  .page.cmp > * { grid-column: 2; }
  .page.cmp > .toc {
    grid-column: 1; grid-row: 1 / span 400; position: sticky; top: 1.5rem; border: 0; padding: 0; margin: 0;
    max-height: calc(100dvh - 3rem); overflow-y: auto;
  }
  .page.cmp > h1 { max-width: 40ch; }
  .page.cmp > .sec { min-width: 0; }
  /* prose is read at a comfortable line */
  .page.cmp > .sec > :not(.dt) { max-width: 46rem; }
  .page.cmp > .sec > :is(p, ul, ol) { max-width: min(46rem, 62ch); }  /* 46rem of Inter is ~88 characters a line; 62ch is ~75 */
}

@media (min-width: 1440px) {
  .page.cmp { max-width: 96rem; grid-template-columns: 14rem minmax(0, 1fr) 22rem; grid-auto-flow: row dense; column-gap: 3rem; }
  .page.cmp > h1, .page.cmp > .lede, .page.cmp > .pair, .page.cmp > figure, .page.cmp > .hero { grid-column: 2 / -1; }
  .page.cmp > .sec { grid-column: 2; }
  .page.cmp > .sec:has(> .dt) { grid-column: 2 / -1; }
  .page.cmp > .toc { grid-column: 1; }
  /* the Sources sit beside the reading, from the first prose section down */
  .page.cmp > .sources { grid-column: 3; grid-row: span 8; position: sticky; top: 1.5rem; max-height: calc(100dvh - 3rem); overflow-y: auto; font-size: .9em; }
  .page.cmp > .sources li { break-inside: avoid; }

  /* the hub: sibling comparisons two across (the list of every comparison is the sixth, so no row is left with one); the intro and the closing method span the row */
  .page.cmp.hub { grid-template-columns: 14rem repeat(2, minmax(0, 1fr)); }
  .page.cmp.hub > h1, .page.cmp.hub > .lede { grid-column: 2 / -1; }
  .page.cmp.hub > .sec { grid-column: span 1; }
  .page.cmp.hub > .sec > :not(.dt) { max-width: none; }
  .page.cmp.hub > .sec:has(> .dt [role="columnheader"]:nth-child(5)), .page.cmp.hub > .sec:last-of-type { grid-column: 2 / -1; }
  .page.cmp.hub > p { grid-column: 2 / -1; max-width: 60rem; }
  .page.cmp.hub > .sources { grid-column: 2 / -1; grid-row: auto; position: static; max-height: none; overflow: visible; font-size: 1em; }
  .page.cmp.hub > .sources ol { columns: 2; column-gap: 3rem; }
}

@media (min-width: 1920px) {
  .page.cmp { max-width: 108rem; grid-template-columns: 14rem minmax(0, 1fr) 26rem; }
  .page.cmp.hub { grid-template-columns: 14rem repeat(2, minmax(0, 1fr)); }
}

/* A guide (checklist, letter template) is read in order: one column, with the glanceable sections and the Sources beside it (sections.rs guide()). */
@media (min-width: 1100px) {
  .page.guide .read { max-width: 46rem; }
  .page.guide > .read, .page.guide > .side { grid-column: 2; }
}
@media (min-width: 1440px) {
  .page.guide > h1, .page.guide > .lede, .page.guide > figure, .page.guide > .hero { grid-column: 2 / -1; }
  .page.guide > .read { grid-column: 2; grid-row: auto; }
  .page.guide { max-width: none; grid-template-columns: 14rem minmax(0, 46rem) 24rem; justify-content: center; }
  .page.guide > .side { grid-column: 3; font-size: .95em; }
  .page.guide .side .sec + .sources, .page.guide .side .sources { margin-top: 2rem; }
}
