/* Product page, new design (preview at /prints/<slug>/preview/). David, 4 Dec 2026.
   Left: the chosen view, square and large, with a named filmstrip under it (live grey wall, our room,
   Prodigi mockups on a grey wall). Right: a gallery plaque, then 01 size (six, each over a sofa to
   scale), 02 material (close-up swatches), price. Below: the photograph and its story. */

.page--print { padding-top: var(--header-h); }
.pv { --pv-ease: cubic-bezier(0.22, 1, 0.36, 1); --wall-cm: 200; }

.pv__top { display: flex; align-items: center; justify-content: space-between; padding-top: 28px; padding-bottom: 22px; }
.pv__back { font-size: 12px; }
.pv__badge { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent-line); padding: 6px 10px; border-radius: 2px; }

/* ---------- two columns: the stage (views, filmstrip under it) and the plaque with the choices */
.pv__grid {
  display: grid; gap: clamp(24px, 3.4vw, 64px);
  grid-template-columns: minmax(0, 1fr) clamp(340px, 31vw, 460px);
  max-width: 1500px; margin: 0 auto; padding: 0 var(--pad); align-items: start;
}

/* ---------- stage: every view is square */
.pv__stage { position: sticky; top: calc(var(--header-h) + 16px); animation: pvStage 1.1s var(--pv-ease) both; }
@keyframes pvStage { from { opacity: 0; transform: translateY(14px); } }
.pv__views { position: relative; aspect-ratio: 1 / 1; width: min(100%, calc(100vh - var(--header-h) - 190px)); min-width: min(100%, 420px);
  margin: 0 auto; overflow: hidden; background: #3a3937; }
.pv-view { position: absolute; inset: 0; opacity: 0; visibility: hidden; clip-path: inset(0 0 0 100%);
  transition: clip-path 0.9s var(--pv-ease), opacity 0s 0.9s, visibility 0s 0.9s; }
.pv-view.is-on { opacity: 1; visibility: visible; clip-path: inset(0); z-index: 2;
  transition: clip-path 0.9s var(--pv-ease), opacity 0s, visibility 0s; }
.pv-view > * { transition: transform 1.4s var(--pv-ease); transform: scale(1.06); }
.pv-view.is-on > * { transform: none; }
.pv-view--img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pv__under { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 14px auto 0;
  width: min(100%, calc(100vh - var(--header-h) - 190px)); min-width: min(100%, 420px); }
.pv__caption { display: flex; gap: 14px; margin: 0; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-2); }
.pv__count { color: var(--muted); font-variant-numeric: tabular-nums; }
.pv__dim { font-family: var(--serif); font-size: 17px; color: var(--fg); }

/* filmstrip under the stage, with names */
.pv__thumbs { display: flex; gap: 10px; margin: 18px auto 0; overflow-x: auto; scrollbar-width: none;
  width: min(100%, calc(100vh - var(--header-h) - 190px)); min-width: min(100%, 420px); }
.pv__thumbs::-webkit-scrollbar { display: none; }
.pv-thumb { flex: 0 0 auto; width: 74px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; color: var(--muted); }
.pv-thumb__pic { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: #777672; opacity: 0.55;
  transition: opacity 0.5s var(--pv-ease); }
.pv-thumb__pic::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--fg);
  transform: scaleX(0); transform-origin: left; transition: transform 0.7s var(--pv-ease); }
.pv-thumb__pic > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-thumb__name { display: block; margin-top: 7px; font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; transition: color 0.4s; }
.pv-thumb:hover .pv-thumb__pic { opacity: 0.85; }
.pv-thumb.is-on .pv-thumb__pic { opacity: 1; }
.pv-thumb.is-on .pv-thumb__pic::after { transform: scaleX(1); }
.pv-thumb.is-on .pv-thumb__name { color: var(--fg); }
.pv-thumb.is-new { animation: pvThumbIn 0.6s var(--pv-ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes pvThumbIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- live scenes: the print is placed in cm, so it grows and shrinks with the size */
.scene { position: absolute; inset: 0; container-type: inline-size; overflow: hidden; }
/* a dark plaster wall with window light falling across it (tools/make_wall.py) */
.wall { background: #3a3937 url(/static/img/prints/wall-plaster.jpg) center / cover no-repeat; }
.wall__light { display: none; }
/* the light stays on the wall: the print shows exactly as the photograph (David, 4 Dec) */

.art { position: absolute; z-index: 3; left: 50%; top: 48%; width: calc(var(--w) / var(--wall-cm) * 100cqw);
  aspect-ratio: var(--ar); transform: translate(-50%, -50%);
  transition: width 0.9s var(--pv-ease), aspect-ratio 0.9s var(--pv-ease), box-shadow 0.6s; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.art::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.6s;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 40%); }
/* depth off the wall, per material: soft contact shadow + long ambient shadow */
.m-photo-rag .art { box-shadow: 0.12cqw 0.3cqw 0.4cqw rgba(0, 0, 0, 0.4), 0.6cqw 1.1cqw 2cqw rgba(0, 0, 0, 0.3); }
.m-dibond .art { box-shadow: 0.3cqw 0.55cqw 0.7cqw rgba(0, 0, 0, 0.5), 1.4cqw 2.6cqw 3.8cqw rgba(0, 0, 0, 0.45); }
.m-acrylic .art { box-shadow: 0.3cqw 0.6cqw 0.8cqw rgba(0, 0, 0, 0.52), 1.6cqw 3cqw 4.2cqw rgba(0, 0, 0, 0.48); }
.m-acrylic .art::after { opacity: 0; }

/* room: our own room photo at its real scale, cropped square around the print */
.room-in { position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); container-type: inline-size; }
.scene--room img.room-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scene--room .art { top: auto; transform: translateX(-50%); }

/* ---------- right column: a gallery plaque, then numbered choices */
.pv__side { padding-top: 4px; }
.pv-plaque { padding-bottom: 26px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.pv__title { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 3.8vw, 62px); line-height: 1; margin: 12px 0 14px; }
.pv-plaque__ed { margin: 0; font-size: 12px; letter-spacing: 0.06em; color: var(--muted); font-style: italic; font-family: var(--serif); }
.pv__block { margin-bottom: 32px; }
.pv__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pv__label { display: flex; align-items: baseline; gap: 10px; margin: 0; font-size: 10.5px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--fg-2); }
.pv__toggles { display: flex; gap: 8px; }
.pv__label em { font-style: normal; font-family: var(--serif); font-size: 15px; letter-spacing: 0; color: var(--accent); }

/* size cards: the print over a real-looking 2 m sofa, to scale; 3 x 2 */
.pv-sizes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; container-type: inline-size; }
.pv-size { grid-column: span 2; }
/* fewer than six (a ratio the lab makes in fewer sizes): the last row widens, never a hole */
.pv-sizes[data-n="5"] .pv-size:nth-child(n+4), .pv-sizes[data-n="2"] .pv-size { grid-column: span 3; }
.pv-sizes[data-n="4"] .pv-size:nth-child(4), .pv-sizes[data-n="1"] .pv-size { grid-column: span 6; }
.pv-size { position: relative; display: flex; flex-direction: column; align-items: center; padding: 12px 8px 10px; border: 1px solid var(--line);
  background: transparent; color: var(--fg-2); cursor: pointer; text-align: center;
  transition: border-color 0.4s, background 0.4s, color 0.4s, opacity 0.5s var(--pv-ease), transform 0.5s var(--pv-ease); }
.pv-size:hover { border-color: var(--line-2); color: var(--fg); }
.pv-size.is-on { border-color: var(--fg-2); background: #2a2926; color: var(--fg); }
.pv-size__scene { position: relative; display: block; width: calc((100cqw - 16px) / 3 - 18px); max-width: 100%; aspect-ratio: 260 / var(--hcm); }   /* same scale in every card, wide or not */
.pv-size__sofa { position: absolute; left: 50%; bottom: 0; width: calc(200 / 260 * 100%); transform: translateX(-50%);
  filter: saturate(0.85) brightness(0.82); transition: filter 0.4s; }
.pv-size.is-on .pv-size__sofa, .pv-size:hover .pv-size__sofa { filter: none; }
.pv-size__art { position: absolute; left: 50%; bottom: calc((88 + 24) / var(--hcm) * 100%); width: calc(var(--w) / 260 * 100%); aspect-ratio: var(--ar);
  transform: translateX(-50%); background-size: cover; background-position: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), 0 3px 8px rgba(0, 0, 0, 0.25); }
.pv-size__label { display: block; margin-top: 10px; font-size: 12.5px; white-space: nowrap; }
.pv-size__price { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.pv-size.is-new { animation: pvThumbIn 0.55s var(--pv-ease) both; animation-delay: calc(var(--i, 0) * 45ms); }

/* materials: cards with a close-up swatch; the chosen one's description below */
.pv-mats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pv-mat { position: relative; display: flex; flex-direction: column; gap: 9px; padding: 8px 8px 11px; border: 1px solid var(--line); cursor: pointer;
  transition: border-color 0.4s, background 0.4s; }
.pv-mat:hover { border-color: var(--line-2); }
.pv-mat:has(input:checked) { border-color: var(--fg-2); background: #2a2926; }
.pv-mat input { position: absolute; opacity: 0; pointer-events: none; }
.pv-mat input:focus-visible ~ .pv-mat__swatch { outline: 1px solid var(--fg); outline-offset: 2px; }
.pv-mat__swatch { display: block; aspect-ratio: 1; background-size: 100%; background-position: center; filter: brightness(0.8);
  transition: filter 0.5s, background-size 1.2s var(--pv-ease); }
.pv-mat:hover .pv-mat__swatch, .pv-mat:has(input:checked) .pv-mat__swatch { filter: none; background-size: 110%; }
.pv-mat__swatch--photo-rag { background-size: 100%; }
.pv-mat:hover .pv-mat__swatch--photo-rag, .pv-mat:has(input:checked) .pv-mat__swatch--photo-rag { background-size: 108%; }
.pv-mat__name { font-size: 11.5px; line-height: 1.35; color: var(--fg-2); }
.pv-mat:has(input:checked) .pv-mat__name { color: var(--fg); }
.pv-matdesc { margin: 14px 0 0; font-size: 12.5px; line-height: 1.65; color: var(--muted); animation: pvIn 0.6s var(--pv-ease) both; }

/* price, then buy now + add to cart */
.pv-buy { display: flex; flex-direction: column; gap: 16px; margin: 6px 0 18px; padding-top: 26px; border-top: 1px solid var(--line); }
.pv-buy__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0; }
.pv-buy__price span { font-family: var(--serif); font-size: 38px; line-height: 1; color: var(--fg); display: inline-block; white-space: nowrap; }
.pv-buy__price span.is-tick { animation: pvTick 0.5s var(--pv-ease); }
@keyframes pvTick { from { opacity: 0; transform: translateY(8px); } }
.pv-buy__price small { font-size: 11px; color: var(--muted); }
.pv-buy__btns { display: grid; grid-template-columns: 1fr; gap: 10px; }
.pv-buy__btns .btn { justify-content: center; width: 100%; white-space: nowrap; }
.pv-buy__add .ico { width: 16px; height: 16px; }
.pv-buy__btn[disabled] { opacity: 0.6; }
/* notes: hanging, crop, duties, delivery */
.pv-note { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.pv-note .ico { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--fg-2); }
.pv-note strong { color: var(--fg-2); font-weight: 400; }
.pv-note--crop { color: var(--accent); }
.pv-note[hidden], .pv [hidden] { display: none !important; }
.pv-note--small { display: block; font-size: 11.5px; margin: 16px 0 24px; }
.pv-note--small a { color: var(--fg-2); text-decoration: underline; text-underline-offset: 3px; }
.pv__side .trust { margin-top: 22px; }

/* entrance */
.pv-in { animation: pvIn 0.9s var(--pv-ease) both; animation-delay: calc(0.15s + var(--i) * 90ms); }
@keyframes pvIn { from { opacity: 0; transform: translateY(16px); } }

/* ---------- the photograph, large, and its story */
.pv-photo { margin: clamp(80px, 10vw, 150px) auto 0; max-width: 1600px; padding: 0 var(--pad); }
.pv-photo__img img, .pv-photo picture, .pv-photo img { width: 100%; height: auto; display: block; }
.pv-info { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(24px, 5vw, 80px); padding-top: 48px; padding-bottom: 40px; }
.pv-info__head .h2 { margin-top: 10px; }
.pv-info .pstory { margin: 0; }

/* sticky bar once the buy button scrolls away */
.pv-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: rgba(14, 14, 13, 0.92); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); transform: translateY(105%); transition: transform 0.6s var(--pv-ease); }
.pv-bar.is-on { transform: none; }
.pv-bar__in { display: flex; align-items: center; gap: 16px; padding-top: 10px; padding-bottom: 10px; }
.pv-bar__in img { width: 54px; height: 40px; object-fit: cover; }
.pv-bar__in p { flex: 1; margin: 0; display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.pv-bar__in p strong { font-family: var(--serif); font-weight: 400; font-size: 20px; color: var(--fg); }
.pv-bar__price { font-family: var(--serif); font-size: 24px; }

/* ---------- smaller screens */
@media (max-width: 1000px) {
  .pv__grid { grid-template-columns: minmax(0, 1fr); }
  .pv__stage { position: relative; top: 0; }
  .pv__views, .pv__under, .pv__thumbs { width: 100%; min-width: 0; }
  .pv-info { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .pv-bar__in img { display: none; }
  .pv-sizes { gap: 6px; }
  .pv-size { padding: 9px 5px 8px; }
  .pv-size__label { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .pv *, .pv *::before, .pv *::after { animation: none !important; transition: none !important; }
}
