/* Journal guides only (tools/journal.py links this file on pages of kind "guide", after blog.css; ADDING_A_GUIDE.md).
   Tables in the article body sit in a scroll box (.ar-tbl, keyboard focusable), so a wide table scrolls inside the page on
   phones instead of widening it. Colours, lines and radii are the kit tokens from page.css. */
.pg .prose .ar-tbl{margin:32px 0;overflow-x:auto;border:1px solid var(--line);border-radius:var(--r-m);background:#fff;}
.pg .prose .ar-tbl:focus-visible{outline:2px solid var(--green-2);outline-offset:2px;}
.pg .prose table{width:100%;border-collapse:collapse;font-size:16px;line-height:1.5;font-variant-numeric:tabular-nums;}
.pg .prose caption{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}   /* the kit's .vh: the caption repeats the section heading above it, so only screen readers get it */
.pg .prose :is(th,td){min-width:8em;padding:12px 16px;text-align:left;vertical-align:top;border-top:1px solid var(--line);}
/* From five columns the 8em minimum no longer fits the 640px text column, so every column is squeezed to its minimum.
   Five columns (a column of names and four short values, as in guide 3): on wider screens the table fits the column;
   the first column keeps at least 15em and the value columns shrink to their content. Six or more columns get about
   12em per column and scroll inside their box; the browser shares the width out by content. On phones every table of
   five or more columns gets 11em per column and scrolls inside its box. Tables of up to four columns are unchanged. */
.pg .prose table:has(tr > :nth-child(6)){--cols:6;width:max(100%,calc(var(--cols) * 12em));}
.pg .prose table:has(tr > :nth-child(7)){--cols:7;}
@media (min-width:760px){
  .pg .prose table:has(tr > :nth-child(5)):not(:has(tr > :nth-child(6))) :is(th,td){min-width:0;}
  .pg .prose table:has(tr > :nth-child(5)):not(:has(tr > :nth-child(6))) :is(th,td):first-child{min-width:15em;}
}
.pg .prose th{font-weight:500;color:var(--ink);}
.pg .prose tbody th{font-weight:inherit;color:inherit;}   /* a row header (th scope="row") looks like the other body cells */
.pg .prose thead th{font-size:14px;background:var(--canvas);}
/* Six or more columns: the first column stays in view while the rest scroll sideways, and a shade on the right edge of the box,
   from the first row down, shows there is more to the right (the white cover at the end of the content hides it once the table
   is scrolled to its end). Separate borders, because collapsed borders do not move with a sticky cell; with spacing 0 and only
   top borders the table looks the same. */
.pg .prose table:has(tr > :nth-child(6)){border-collapse:separate;border-spacing:0;}
.pg .prose table:has(tr > :nth-child(6)) :is(th,td):first-child{position:sticky;left:0;z-index:1;background:#fff;box-shadow:inset -1px 0 0 var(--line);}
.pg .prose table:has(tr > :nth-child(6)) thead :is(th,td):first-child{background:var(--canvas);}
.pg .prose .ar-tbl:has(> table tr > :nth-child(6)){background:linear-gradient(to left,#fff 16px,rgba(255,255,255,0)) right / 40px 100% no-repeat local,linear-gradient(to left,rgba(20,32,27,.14),rgba(20,32,27,0)) right / 32px 100% no-repeat scroll,#fff;}
/* Lists on touch screens: blog.css makes a list item's only link a 44px inline-flex box (for lists of links). In a guide that
   drops a source's publisher onto its own line after a stray comma, and gives other list items whose only element is a link
   (a brief list, a tier list) a taller last line, so on guide pages every such link stays inline. Notes and archive posts do
   not load this file and keep blog.css's rule. */
@media (pointer:coarse){.pg .prose li>a:only-child{display:inline;min-height:0;}}
.pg .prose td :is(ul,ol,p){margin:0;}
@media (max-width:759px){
  .pg .prose .ar-tbl{margin:28px 0;}
  .pg .prose table{font-size:15px;}
  .pg .prose table:has(tr > :nth-child(5)){width:max(100%,calc(var(--cols,5) * 11em));}
  .pg .prose :is(th,td){padding:10px 12px;}
}
