/* ==========================================================================
   Collections. Loaded on template-packages.php only; the three cards on the
   home page use .pkg from components.css.
   ========================================================================== */

.table-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  margin-top: 30px;
  border: var(--border) solid var(--rule-i);
}

.table-scroll:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

.pkg-table { width: 100%; border-collapse: collapse; font-size: var(--t-body-s); }

.pkg-table th,
.pkg-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule-i);
}

.pkg-table thead th {
  position: sticky;
  top: 0;
  background: var(--ink);
  font-size: var(--t-label);
  font-weight: 600;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  white-space: nowrap;
}

.pkg-table tbody th {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.pkg-table td:nth-child(2) { white-space: nowrap; font-weight: 600; }
.pkg-table td:last-child { min-width: 34ch; color: rgba(255, 246, 239, .72); }

@media (min-width: 1100px) {
  .pkg-table { font-size: var(--t-body); }
  .pkg-table td:last-child { min-width: 0; }
}

/* ==========================================================================
   Size visualiser - the question a printed list can never answer.
   ========================================================================== */

.viz-sec { background: var(--paper-2); }

/* Everything is drawn from one unit, so the comparison between the rectangles
   is true. The unit is measured against the container rather than the viewport:
   a desktop scrollbar does not shift it, and the two-column layout below needs
   no second calculation. 21.6 leaves the widest print (20in) a margin. */
.viz-stage-col { container-type: inline-size; }

.szbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 32px 0 26px;
}

.sz {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap-min);
  padding: 0 14px;
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  background: none;
  color: var(--ink);
  font-family: var(--ui);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  transition:
    background-color var(--d-ui) var(--ease-out),
    color var(--d-ui) var(--ease-out),
    transform var(--d-press) var(--ease-out);
}

.sz:active { transform: scale(.97); }
.sz[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.sz:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

.sz em {
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  opacity: .5;
}

.stage {
  --u: min(calc(100cqw / 21.6), 24px);
  --grid-line: color-mix(in srgb, var(--ink) 8%, transparent);

  position: relative;
  height: calc(var(--u) * var(--tall) + 36px);
  border: var(--border) solid var(--ink);
  overflow: hidden;
  background:
    repeating-linear-gradient(to right, var(--grid-line) 0 1px, transparent 1px var(--u)),
    repeating-linear-gradient(to bottom, var(--grid-line) 0 1px, transparent 1px var(--u)),
    var(--paper);
}

.stage::after {
  content: "1 inch grid";
  position: absolute;
  left: 10px;
  top: 9px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--ink-3);
}

.rect {
  position: absolute;
  bottom: 16px;
  left: 50%;
  width: calc(var(--u) * var(--w));
  height: calc(var(--u) * var(--h));
  border: var(--border) solid color-mix(in srgb, var(--ink) 26%, transparent);
  transform: translateX(-50%) scaleY(.96);
  transform-origin: bottom center;
  opacity: 0;
  transition:
    opacity 460ms var(--ease-out),
    transform 520ms var(--ease-out),
    background-color 240ms var(--ease-out),
    border-color 240ms var(--ease-out);
}

.viz-in .rect { opacity: 1; transform: translateX(-50%) scaleY(1); }

.viz-in .rect:nth-child(2) { transition-delay: 45ms; }
.viz-in .rect:nth-child(3) { transition-delay: 90ms; }
.viz-in .rect:nth-child(4) { transition-delay: 135ms; }
.viz-in .rect:nth-child(5) { transition-delay: 180ms; }
.viz-in .rect:nth-child(6) { transition-delay: 225ms; }
.viz-in .rect:nth-child(7) { transition-delay: 270ms; }
.viz-in .rect:nth-child(8) { transition-delay: 315ms; }
.viz-in .rect:nth-child(9) { transition-delay: 360ms; }

.rect.on { background: var(--coral); border-color: var(--ink); z-index: 3; }

.rect > span {
  position: absolute;
  left: 9px;
  bottom: 7px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(15px, 4.4vw, 22px);
  letter-spacing: -.03em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 200ms var(--ease-out) 70ms;
}

.rect.on > span { opacity: 1; }

.viz-read { margin-top: 26px; }

.viz-cap {
  transition:
    opacity 180ms var(--ease-out),
    transform 180ms var(--ease-out);
}

.viz-cap.swap { opacity: 0; transform: translateY(7px); }

.viz-cap b {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 8.4vw, 44px);
  line-height: .92;
  letter-spacing: -.04em;
}

.viz-cap .cm { display: block; margin-top: 10px; }

.viz-cap p {
  margin-top: 14px;
  font-size: var(--t-body-s);
  color: var(--ink-2);
  max-width: 44ch;
}

.viz-where {
  border-top: var(--border) solid var(--ink);
  margin-top: 26px;
  padding-top: 17px;
}

.viz-where > .k { display: block; margin-bottom: 11px; }

.viz-where ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.viz-where li {
  border: 1px solid var(--rule);
  padding: 8px 11px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--ink-2);
}

@media (min-width: 1100px) {
  .viz-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 56px;
    align-items: start;
    margin-top: 36px;
  }

  .szbar { margin-top: 0; }
  .viz-read { margin-top: 0; }
  .viz-where { margin-top: 30px; }
}

/* The draw-in is the whole point of the section, so it stays - but as a fade
   with no travel, and the caption swaps instantly instead of sliding. */
@media (prefers-reduced-motion: reduce) {
  .rect { transform: translateX(-50%); transition: opacity 200ms var(--ease-out), background-color 200ms var(--ease-out), border-color 200ms var(--ease-out); }
  .viz-in .rect { transform: translateX(-50%); transition-delay: 0ms; }
  .sz:active { transform: none; }
  .viz-cap { transition: opacity 120ms var(--ease-out); }
  .viz-cap.swap { transform: none; }
}
