/* The Tables page (/tables/): the three standard normal tables. The numbers are written into the page by
   weeks/w09/checks/ztables.py. Tokens and boxes are those of site.css (a table is a box with its name on a black tab,
   as the tools of Week 3); the shaded area is the pick wash, as on the heights projector. */

.zt-jump .pick { display: inline-block; text-decoration: none; }
.zt-how { margin-top: 4px; }
.zt-dl { margin: 0 0 8px; }

.zt-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; margin: 0 0 14px; }
.zt-def { font-size: 17px; color: var(--ink2); }
.zt-f { color: var(--ink); font-weight: 650; white-space: nowrap; }
.zt-sub { margin: 0; font: 720 20px/1.2 var(--font); font-stretch: 108%; }
/* the two halves of "Area to the left of z" are tabs (the instructor, 2026-11-11); in print each half has its page */
.zt-tabs { margin: 0 0 18px; }
.zt-tabs .pick { min-width: 96px; font-size: 17px; }
.zt-tabs .pick[aria-selected="true"] { background: var(--ink); color: var(--paper); }
@media (hover: hover) { .zt-tabs .pick[aria-selected="true"]:hover { background: var(--ink); color: var(--paper); box-shadow: inset 0 0 0 2px var(--ink); } }
/* Inside a long table its name stays at the top of the screen (a phone shows a third of a table at a time, and the
   three tables have the same row and column labels). */
.zt-block > h2 { position: sticky; top: 0; z-index: 3; }
.zt-ph { display: none; }                 /* the name of a half, on its printed page only (the tab names it on screen) */

/* the picture */
.zc { display: block; width: 240px; max-width: 100%; height: auto; }
.zc-area { fill: var(--pick-wash); }
.zc-curve { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.zc-axis, .zc-tick { stroke: var(--ink); stroke-width: 1.5; }
.zc-edge { stroke: var(--ink); stroke-width: 1.5; }
.zc-lab { fill: var(--ink); font: 650 15px var(--font); }
.zc-lab--z { font-style: italic; }

/* the table: wider than a phone, so it scrolls sideways in its own box and its z column stays in view */
.zt-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.zt { width: 100%; border-collapse: separate; border-spacing: 0; font: 500 15px/1 var(--font); font-variant-numeric: tabular-nums; }
.zt th, .zt td { padding: 6px 6px; text-align: right; white-space: nowrap; }
.zt thead th { border-bottom: 2px solid var(--ink); font-weight: 700; }
.zt tfoot th { border-top: 2px solid var(--ink); font-weight: 700; }
.zt tbody th { position: sticky; left: 0; z-index: 1; padding-right: 12px; text-align: left; font-weight: 700; background: var(--paper); border-right: 2px solid var(--ink); }
.zt th.zt-zh { text-align: left; }
/* the corner cells stay over the z column when the table is moved sideways */
.zt thead th:first-child, .zt tfoot th:first-child { position: sticky; left: 0; z-index: 2; background: var(--paper); }
.zt tbody tr:nth-child(5n):not(:last-child) > * { border-bottom: 1px solid var(--line); }
.zt td { cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* the cell read: its row and its column marked, the cell and its two labels in the highlighter */
.zt .is-x { background: var(--wash); }
.zt th.is-x, .zt td.is-on { background: var(--hl); color: #000; }
.zt td.is-on { font-weight: 750; box-shadow: inset 0 0 0 2px #000; }
@media (hover: hover) { .zt td:hover:not(.is-on) { background: var(--wash); } }

.zt-read { position: fixed; z-index: 5; bottom: max(18px, env(safe-area-inset-bottom)); left: calc(var(--side) + (100vw - var(--side)) / 2); transform: translateX(-50%);
  max-width: calc(100vw - 32px); margin: 0; padding: 13px 22px; border-radius: 999px; background: var(--ink); color: var(--paper);
  font: 700 19px/1.1 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; box-shadow: 0 0 0 2px var(--paper); cursor: pointer; }
.zt-read.is-top { top: max(60px, env(safe-area-inset-top)); bottom: auto; }   /* when the cell read is near the foot of the screen */

@media (max-width: 900px) {
  .zt-read { left: 50%; }
}
@media (max-width: 640px) {
  .zt { font-size: 14px; }
  .zt th, .zt td { padding: 7px 5px; }
  .zt tbody th { padding-right: 9px; }
  .zt-read { font-size: 17px; padding: 12px 18px; }
}

/* Printing: each table on a page of its own (the two halves of B on one page each), black on white whatever the
   theme on the screen, without the navigation. */
@media print {
  :root, :root[data-theme="dark"] { --paper: #ffffff; --ink: #000000; --ink2: #54565c; --line: #bdbdbd; --wash: #f2f2f0; --pick-wash: #e2b4ea; }
  @page { size: A4; margin: 14mm 12mm; }
  body.hub { padding-left: 0; }
  body.hub::before, .side, .top, .zt-jump, .zt-how, .zt-dl, .zt-read, .zt-tabs, .where, .page > h1 { display: none !important; }
  .zt-half[hidden] { display: block !important; }
  .zt-block > h2 { position: static; }
  .page { max-width: none; padding: 0; }
  .block--tool { margin: 0; padding: 0; border: 0; break-before: page; }
  #zt-b { break-before: auto; }
  .block--tool > h2 { margin: 0 0 6px; padding: 0; background: none; color: #000; font-size: 20px; }
  .zt-half + .zt-half { break-before: page; margin-top: 0; }
  .zt-ph { display: block; }
  .zt-top { margin-bottom: 8px; }
  .zc { width: 170px; }
  .zt { font-size: 10.5pt; }
  .zt th, .zt td { padding: 3.2px 6px; }
  .zt .is-x, .zt th.is-x, .zt td.is-on { background: none; box-shadow: none; font-weight: inherit; }
  .zt-scroll { overflow: visible; }
}
