/* Licensed to account 52c7da1aea3f, 2026-10-19. Moving parts. */
/* Print table, the mechanics.
   Moving parts. The script writes the state, one transform per print and the two shares its shadows read.
   Readable source: components/print-table/print-table.css */

/* File layout: required mechanics, then the optional look.
   The rules before the line "look, left out of the Webflow Embed" are what
   the script needs: a block that holds the screen while the page scrolls,
   the table as the frame the prints are measured in, the prints as things
   a hand can take, and the two shadows of a print. They read attributes,
   never classes, and set no size, no gap and no column: the grid is the
   page's own.

   The pin is CSS, not script. The block is sticky inside a section made
   taller by the scroll the tidying takes, so there is no spacer to insert
   when the pin starts and nothing to give back when it ends. Under reduced
   motion, and without the script, none of it applies: the grid, as the
   page wrote it. */

/* Presence marker read by the engine. */
[data-print-table] {
  --print-table-css: 1;
}

/* Section while pinned: the scroll the tidying takes, added under its content. */
[data-print-table-state="pin"]::after {
  content: "";
  display: block;
  height: var(--print-table-length, clamp(900px, 170vh, 2400px));
}

/* The pin: one screen tall, held at the top.
   The small viewport height where the browser knows it, so the bar of a
   phone browser never hides the foot of the table. */
[data-print-table-state="pin"] [data-print-table-pin] {
  position: sticky;
  top: 0;
  box-sizing: border-box;
  height: 100vh;
  height: 100svh;
}

/* The table: the frame the cells are read in and the prints kept in. */
[data-print-table-state] [data-print-table-surface] {
  position: relative;
}

/* A print, while the pile is live: its own layer, turned about its middle.
   pan-y leaves a swipe up or down to the page, so the table never traps
   the scroll of a phone; a finger that rests on a print, or moves
   sideways, takes it. */
[data-print-table-state="pin"] [data-print-table-print],
[data-print-table-state="flow"] [data-print-table-print] {
  position: relative;
  transform-origin: 50% 50%;
  will-change: transform;
  touch-action: pan-y pinch-zoom;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

/* The grid once done: nothing left to move, no layer kept. */
[data-print-table-tidy] [data-print-table-print] {
  will-change: auto;
}

/* The hand: open over a print that can be taken, closed while it holds one. */
[data-print-table-grab] [data-print-table-print] {
  cursor: grab;
}

[data-print-table-dragging],
[data-print-table-dragging] [data-print-table-print] {
  cursor: grabbing;
}

[data-print-table-state] [data-print-table-print] img {
  -webkit-user-drag: none;
}

/* The two shadows of a print: lying on the table, and held above it.
   Each is a box the size of the print that paints nothing but a shadow
   around itself, so it never tints the print. The script writes how loose
   the print lies and how high it is held, 0 to 1, and only the opacity of
   the two boxes follows: the contact shadow fades into the grid and
   thins as the print rises, the long one comes with the lift. The colour
   is the shadow setting. A print that clips its overflow shows neither. */
[data-print-table-state] [data-print-table-print]::before,
[data-print-table-state] [data-print-table-print]::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  pointer-events: none;
  will-change: opacity;
}

[data-print-table-state] [data-print-table-print]::before {
  box-shadow:
    0 1px 2px color-mix(in srgb, var(--print-table-shadow, #000000) 55%, transparent),
    0 clamp(4px, 0.6vw, 10px) clamp(10px, 1.5vw, 24px) color-mix(in srgb, var(--print-table-shadow, #000000) 50%, transparent);
  opacity: calc(var(--print-table-loose, 0) * (1 - var(--print-table-lift, 0) * 0.55));
}

[data-print-table-state] [data-print-table-print]::after {
  box-shadow: 0 clamp(18px, 2.8vw, 46px) clamp(28px, 4.6vw, 76px) color-mix(in srgb, var(--print-table-shadow, #000000) 62%, transparent);
  opacity: var(--print-table-lift, 0);
}

/* Keyboard: the ring on a print, never on a click. */
:where([data-print-table-print]):focus {
  outline: none;
}

:where([data-print-table-print]):focus-visible {
  outline: 2px solid #ff4a00;
  outline-offset: 3px;
}

/* The Webflow Embed inside the section: no room. Its scripts run all the same. */
[data-print-table] > .w-embed {
  display: none;
}

/* ---------- look, left out of the Webflow Embed ---------- */

/* Clinix Studio: the look of the preview (the print-table-* classes of the
   dark table with fourteen car proofs, set in Instrument Sans and Geist
   Mono) is left out of this copy on purpose. The studio section of
   src/pages/over-ons.astro keeps its own grid, type and colours on the
   site's tokens, and sets the shadow colour through the setting on the
   section. The mechanics above are the file as shipped. */
