/* The figure collection: sculptors on the home page, every figure on its own screen (js/figures.js). */

/* ── Home: one card per sculptor, their figures taking turns ── */
.fig-makers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 16px; }
@media (min-width: 1200px) { .fig-makers { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
/* computers show one row; the rest are on the collection's screen */
@media (min-width: 1200px) { .fig-maker:nth-child(n + 7) { display: none; } }
@media (min-width: 641px) and (max-width: 1199px) { .fig-maker:nth-child(n + 5) { display: none; } }
.fig-maker { display: grid; gap: 2px; align-content: start; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.fig-maker:focus-visible, .fig-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius); }
.fig-maker-img, .fig-tile-img { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius); background: #17161a; margin-bottom: 8px; }
.fig-maker-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; opacity: 0; transition: opacity .9s ease; }
.fig-maker-img img.on { opacity: 1; }
.fig-maker-img .render-tag, .fig-tile-img .render-tag, .fig-view-img .render-tag { position: absolute; left: 8px; top: 8px; }
.fig-maker b { font: 400 1.3rem/1.15 var(--display); letter-spacing: -.01em; }
.fig-maker small { color: var(--muted); font-size: .86rem; line-height: 1.35; }
.fig-maker-now { color: var(--dim); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#collection .biz-foot { margin-top: 28px; }

/* ── The collection's screen ── */
.fig-intro { max-width: 68ch; margin: 0 0 20px; color: var(--muted); }
.fig-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fig-count { margin: 16px 0 14px; color: var(--dim); font-size: .9rem; }
.fig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 26px 16px; }
.fig-tile { display: grid; gap: 1px; align-content: start; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.fig-tile[hidden] { display: none; }
.fig-tile-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; transition: transform .5s ease; }
.fig-tile b { font-weight: 500; line-height: 1.3; }
.fig-tile small { color: var(--muted); font-size: .86rem; }
.fig-from { margin-top: 2px; font-size: .9rem; font-weight: 500; }
.fig-prices { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: .95rem; }
.fig-prices th { padding: 0 0 6px; color: var(--dim); font-size: .7rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; text-align: right; }
.fig-prices td { padding: 8px 0; border-top: 1px solid var(--line); text-align: right; font-weight: 500; white-space: nowrap; }
.fig-prices :is(th, td):first-child { text-align: left; font-weight: 400; white-space: normal; }
.fig-prices td small { display: block; color: var(--muted); font-size: .84rem; }
.fig-view-text p { font-size: .88rem; }
.fig-more { display: flex; justify-content: center; margin-top: clamp(28px, 5vw, 44px); }
.fig-more[hidden] { display: none; }
.fig-chips { scroll-margin-top: 16px; }
.est-ask { margin: 18px 0 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); }
.est-ask[hidden] { display: none; }
.fig-prices td.fig-ask { color: var(--accent); }
.fig-credit { max-width: 72ch; margin: clamp(36px, 6vw, 60px) 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .fig-tile:hover .fig-tile-img img { transform: scale(1.04); }
}

/* ── A figure up close ── */
.fig-view { width: min(920px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 16px; background: var(--bg); color: var(--ink); overflow: auto; }
.fig-view::backdrop { background: rgba(10, 10, 10, .72); }
.fig-view[open] { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.fig-view-media { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; background: #17161a; }
/* the picture keeps one height while stepping through them, so nothing jumps */
.fig-view-img { position: relative; display: grid; place-items: center; min-height: 0; height: min(68dvh, 620px); }
.fig-view-img img { display: block; width: 100%; height: 100%; object-fit: contain; }
.fv-nav { position: absolute; top: 50%; z-index: 1; display: grid; place-items: center; width: 42px; height: 42px; margin-top: -21px; padding: 0 0 3px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .86); color: var(--ink); font-size: 1.6rem; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.fv-nav:hover { background: #fff; }
.fv-nav[hidden] { display: none; }
.fv-prev { left: 10px; }
.fv-next { right: 10px; }
.fv-count { position: absolute; right: 10px; bottom: 10px; padding: 3px 9px; border-radius: 999px; background: rgba(60, 60, 60, .42); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); color: rgba(255, 255, 255, .92); font-size: .78rem; font-variant-numeric: tabular-nums; }
.fv-count:empty { display: none; }
.fv-thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; scrollbar-width: none; }
.fv-thumbs::-webkit-scrollbar { display: none; }
.fv-thumbs[hidden] { display: none; }
.fv-thumbs button { flex: none; width: 54px; height: 54px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #26252a; opacity: .6; cursor: pointer; transition: opacity .2s, border-color .2s; }
.fv-thumbs button:hover { opacity: .9; }
.fv-thumbs button[aria-current="true"] { border-color: #fff; opacity: 1; }
.fv-thumbs img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
@media (prefers-reduced-motion: reduce) { .fv-thumbs button { transition: none; } }
.fig-view-text { display: grid; gap: 8px; align-content: center; padding: clamp(20px, 4vw, 40px); }
.fig-view-text > b { font: 400 clamp(1.7rem, 3.6vw, 2.4rem)/1.05 var(--display); letter-spacing: -.01em; }
.fig-view-text > span { color: var(--accent); font-weight: 500; }
.fig-view-text p { margin: 6px 0 0; color: var(--muted); }
.fig-view-acts { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.fig-view .lb-close { position: absolute; top: 10px; right: 10px; z-index: 1; background: rgba(255, 255, 255, .92); border-color: var(--line); color: var(--ink); }
.fig-view .lb-close:hover { background: #fff; }

/* ── Phones and zoomed-in screens ── */
@media (max-width: 640px) {
  /* the sculptors: a row swiped sideways, the next one peeking in */
  .fig-makers {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 44%; gap: 14px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 10px; scroll-padding-inline: var(--gutter);
  }
  .fig-makers::-webkit-scrollbar { display: none; }
  .fig-maker { scroll-snap-align: start; }
  .fig-maker b { font-size: 1.15rem; }
  #collection .biz-foot .btn { width: 100%; }
  /* the sculptors' names: one row swiped sideways, fading out where there's more */
  .fig-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter); }
  .fig-chips::-webkit-scrollbar { display: none; }
  .fig-chips .chip { flex: none; }
  .fig-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .fig-more .btn { width: 100%; }
  .fig-view[open] { grid-template-columns: minmax(0, 1fr); }
  .fig-view-img { height: 52dvh; }
  .fv-thumbs button { width: 46px; height: 46px; }
  .fv-nav { width: 40px; height: 40px; margin-top: -20px; }
  .fig-view-acts .btn { flex: 1; }
}
@media (max-height: 520px) and (min-width: 641px) { .fig-view-img { height: calc(100dvh - 100px); } }
@media (prefers-reduced-motion: reduce) { .fig-maker-img img, .fig-tile-img img { transition: none; } }

/* search the collection */
.fig-search { margin: 0 0 14px; max-width: 460px; }
.fig-search .input { width: 100%; }
.fig-none { margin: 10px 0 0; color: var(--muted); }
.fig-none[hidden] { display: none; }
