/* A WORK YOU CAN TURN (TURNING.md) — the control beside "look closer" and the layer turn.js opens. In closer-layer.css's own
   vocabulary: the same round dark control, the same pill buttons, the same ground, so the two read as one family. */

/* the control: the look-closer's twin, to its left; alone in the corner where the picture has no zoom */
.turn-open {
  position: absolute;
  right: var(--mount-pad, 0);
  bottom: var(--mount-pad, 0);
  margin: 10px 56px 10px 10px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.94);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 300ms ease;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
}
.closer-open[hidden] ~ .turn-open { margin-right: 10px; }
.turn-open:hover,
.turn-open:focus-visible { opacity: 1; outline: none; }
.turn-open:focus-visible { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }
.turn-open svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.turn-open[hidden] { display: none !important; }
@media (pointer: coarse) {
  .turn-open { width: 44px; height: 44px; opacity: 0.8; margin-right: 64px; }
  .closer-open[hidden] ~ .turn-open { margin-right: 10px; }
  .turn-open svg { width: 24px; height: 24px; }
}

/* the layer: body-level, outside every transform, above the page as the look-closer's is */
.turn {
  position: fixed;
  inset: 0;
  z-index: 7;
  background: var(--lit-ground, #0a090c);
  color: rgba(255, 255, 255, 0.94);
  font-family: var(--font-label, monospace);
  overscroll-behavior: contain;
  touch-action: none;
}
.turn[hidden] { display: none !important; }
.turn-stage, .turn-stage model-viewer { position: absolute; inset: 0; width: 100%; height: 100%; }
.turn-stage model-viewer { background: transparent; --poster-color: transparent; outline: none; }

.turn-controls, .turn-views {
  position: absolute;
  display: flex;
  gap: 8px;
  z-index: 1;
  margin: 0;
}
.turn-controls { top: max(3vh, 22px); right: max(3vw, 22px); }
.turn-views { top: max(3vh, 22px); left: max(3vw, 22px); flex-wrap: wrap; }
.turn-controls button, .turn-views button {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 17px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.94);
  font-family: inherit;
  font-size: var(--label-size, 11px);
  letter-spacing: var(--label-tracking, 0.12em);
  text-transform: var(--label-case, none);
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 250ms ease;
  -webkit-tap-highlight-color: transparent;
}
.turn-controls button:hover, .turn-views button:hover,
.turn-controls button:focus-visible, .turn-views button:focus-visible { opacity: 1; outline: none; }
.turn-controls button:focus-visible, .turn-views button:focus-visible { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }
.turn-controls button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.9); color: #0a090c; }
@media (pointer: coarse) {
  .turn-controls button, .turn-views button { height: 42px; padding: 0 16px; border-radius: 21px; }
}
/* on a phone the views take their own row under turn slowly and close — the foot is the line's, which may wrap */
@media (max-width: 640px) {
  .turn-views { top: calc(max(3vh, 22px) + 50px); left: 8px; right: 8px; justify-content: center; gap: 5px; flex-wrap: nowrap; }
  .turn-views button { padding: 0 10px; }
}

/* the ground, the visitor's to choose (the owner, 2026-09-27): four swatches beside turn slowly, the page's own first */
.turn-grounds { display: flex; align-items: center; gap: 6px; margin-right: 6px; }
.turn-ground {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.turn-ground[aria-pressed="true"] { box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55), 0 0 0 4px rgba(255, 255, 255, 0.9); }
.turn-ground:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 0 0 4px rgba(0, 0, 0, 0.55); }
.turn-controls { align-items: center; }
@media (pointer: coarse) { .turn-ground { width: 28px; height: 28px; } }
/* ⚠ ROUND, AS DRAWN (2026-10-10, the owner, of the four drawn as they were and as they were meant: "round is better"):
   `.turn-controls button` — every button in the row — outranked the swatch's own size by one element, and its height and
   side padding made each an upright oval, 28 × 34 on a computer and 32 × 42 on a phone. The swatch's own, one class up. */
.turn-controls .turn-ground { width: 22px; height: 22px; padding: 0; }
@media (pointer: coarse) { .turn-controls .turn-ground { width: 28px; height: 28px; } }

/* the model arriving: a bar that fills, over the poster (the work's own photograph), under the controls where nothing covers it */
.turn-progress {
  position: absolute;
  left: 50%;
  top: calc(max(3vh, 22px) + 52px);
  width: min(240px, 50vw);
  height: 4px;
  padding: 3px;
  margin-left: calc(min(240px, 50vw) / -2);
  background: rgba(0, 0, 0, 0.55);                   /* the buttons' own backing: it shows on any ground */
  border-radius: 5px;
  overflow: hidden;
  z-index: 1;
}
.turn-progress[hidden] { display: none !important; }
.turn-progress span { display: block; height: 100%; width: 0; border-radius: 2px; background: rgba(255, 255, 255, 0.92); transition: width 200ms linear; }

/* what the model is: a reconstruction, from how many photographs, by whom, with what — always said (TURNING.md); on the
   buttons' own dark backing, so it reads on any ground the page gives the layer */
.turn-said {
  position: absolute;
  left: 50%;
  bottom: max(2.4vh, 18px);
  transform: translateX(-50%);
  width: max-content;
  max-width: min(720px, calc(100vw - 44px));
  box-sizing: border-box;
  margin: 0;
  padding: 7px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.55);
  text-align: center;
  font-size: var(--label-size, 11px);
  letter-spacing: var(--label-tracking, 0.06em);
  line-height: 1.5;
  z-index: 1;
}
.turn-said:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .turn-progress span { transition: none; } }
@media (max-width: 640px) { .turn-progress { top: calc(max(3vh, 22px) + 104px); } }
/* on the black ground the buttons and the line take a light backing, or they would vanish into it */
.turn.on-dark .turn-controls button, .turn.on-dark .turn-views button, .turn.on-dark .turn-said, .turn.on-dark .turn-progress {
  background: rgba(255, 255, 255, 0.16);
}

/* the artist's row — which side is this? (0124): only to the artist working on the catalogue, under the views on the left, on
   the buttons' own backing; a side already set wears the pressed look */
.turn-setting {
  position: absolute;
  top: calc(max(3vh, 22px) + 46px);
  left: max(3vw, 22px);
  max-width: min(400px, calc(100vw - 44px));
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1;
  font-size: var(--label-size, 11px);
  letter-spacing: var(--label-tracking, 0.06em);
  line-height: 1.5;
}
.turn-setting p { margin: 0; }
.turn-setting p[role="status"] { margin-top: 8px; opacity: 0.85; }
.turn-setting div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.turn-setting button {
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 15px;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: var(--label-case, none);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.turn-setting button.is-set { background: rgba(255, 255, 255, 0.9); color: #0a090c; border-color: transparent; }
.turn-setting button:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }
.turn-setting .turn-clear { border-style: dashed; }
.turn.on-dark .turn-setting { background: rgba(255, 255, 255, 0.16); }
@media (pointer: coarse) { .turn-setting button { height: 38px; padding: 0 14px; border-radius: 19px; } }
/* on a phone the row sits under the views (the foot is the line's, three rows tall there), and the bar under the row */
@media (max-width: 640px) {
  .turn-setting { top: calc(max(3vh, 22px) + 100px); left: 8px; right: 8px; max-width: none; }
  .turn.is-setting .turn-progress { top: calc(max(3vh, 22px) + 290px); }
}

/* a photo spin (0125): one canvas the photographs are drawn on, the whole stage; dragged across to turn the work */
.turn-stage .turn-spin { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; outline: none; }
.turn-stage .turn-spin:active { cursor: grabbing; }
