/* Gallery viewer, look "Salon" (design round 1, agent pick 2026-11-23, Neil may change): a dark wall tinted per
   artist, the work on an ivory mount, the artist's name large in Bodoni, hairline controls. Loaded after shop.css. */
:root { --tint: #211f1c; --ink: #efe8dc; --ease: cubic-bezier(.2, .7, .1, 1); --panel: clamp(360px, 30vw, 440px);
  --sans: "Jost", system-ui, sans-serif; --serif: "EB Garamond", Georgia, serif; --focus: #d8b67a; }
body.gallery { background: var(--tint); color: var(--ink); transition: background-color .9s var(--ease); }
#gallery { min-height: 100svh; }
#gallery.ready .g-wall { animation: g-arrive .9s var(--ease) both; }
@keyframes g-arrive { from { opacity: 0; } }

/* no-script and first paint */
.g-static { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; }
.g-static h2 { font: 400 clamp(40px, 6vw, 88px)/1 "Bodoni Moda", serif; margin: 0; }
.g-static img { max-height: 62svh; width: auto; padding: 10px; background: #f7f3ea; }
.g-static a { color: inherit; }

.g-wall { container-type: inline-size; height: 100svh; min-height: 560px; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto; padding: 0 clamp(16px, 4vw, 56px);
  background: radial-gradient(120% 90% at 50% 38%, color-mix(in oklab, var(--tint) 82%, #fff 6%), var(--tint) 70%); transition: margin .6s var(--ease); }
.g-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0 6px; }
.g-brand { font: 500 22px/1 "Bodoni Moda", Didot, serif; text-decoration: none; color: inherit; letter-spacing: .01em; }
.g-brand span { opacity: .6; }
.g-head { padding: 8px 0 10px; }
.g-kicker { margin: 0 0 6px; font: 500 11px/1.3 var(--sans); letter-spacing: .22em; text-transform: uppercase; opacity: .7; }
.g-name { margin: 0; font: 400 clamp(40px, 6.4vw, 92px)/.95 "Bodoni Moda", Didot, serif; letter-spacing: -.01em; }
.g-life { margin: 8px 0 0; font: 400 14px/1.3 var(--sans); letter-spacing: .06em; opacity: .75; }
.g-stage { margin: 0; position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; grid-template-rows: minmax(0, 1fr) auto; align-items: center; min-height: 0; }
.g-frame { grid-column: 2; grid-row: 1; height: 100%; min-height: 0; position: relative; touch-action: pan-y; }
/* two stacked layers: the new work fades in on one while the old fades out on the other (gallery.js show()) */
.g-layer { position: absolute; inset: 8px 0; display: flex; align-items: center; justify-content: center; opacity: 0; }
.g-layer img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none;
  padding: clamp(6px, .9vw, 12px); background: #f7f3ea; box-shadow: 0 2px 3px rgba(0,0,0,.35), 0 30px 80px rgba(0,0,0,.55); }
.g-print-preview { display: block; max-width: 100%; max-height: 100%; box-shadow: 0 2px 3px rgba(0,0,0,.35), 0 30px 80px rgba(0,0,0,.55); }
.g-cap { grid-column: 2; text-align: center; padding: 10px 0 2px; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; font: 15px/1.35 var(--serif); }
.g-title { font-style: italic; font-size: 19px; }
.g-date, .g-src { opacity: .7; font-family: var(--sans); font-size: 13px; letter-spacing: .04em; align-self: center; }
.g-src { flex-basis: 100%; font-size: 12px; opacity: .55; }
.g-step { appearance: none; background: none; border: 0; color: inherit; width: 64px; height: 64px; display: grid; place-items: center; cursor: pointer; opacity: .55; transition: opacity .3s, transform .4s var(--ease); }
.g-step svg { width: 42px; height: 14px; }
.g-step:hover { opacity: 1; }
.g-step-prev:hover { transform: translateX(-4px); }
.g-step-next:hover { transform: translateX(4px); }
/* phones and tablets: a sticky bar opens the print sheet; on desktop the panel is always open, so the bar is gone */
.g-buybar { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 calc(-1 * clamp(16px, 4vw, 56px));
  padding: 10px clamp(16px, 4vw, 56px) calc(10px + env(safe-area-inset-bottom)); background: #fbf8f2; color: #1d1b18; font: 15px/1.2 var(--sans); box-shadow: 0 -8px 30px rgba(0,0,0,.3); }
.g-buybar b { font-weight: 500; }
.g-print { appearance: none; border: 0; background: #1d1b18; color: #fff; font: 500 12px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; padding: 14px 18px; cursor: pointer; }
.printing .g-buybar { display: none; }
.g-foot { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 8px 0 18px; border-top: 1px solid color-mix(in oklab, currentColor 18%, transparent); }
.g-strip { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; padding: 8px 2px 10px; scrollbar-width: thin; scrollbar-color: color-mix(in oklab, currentColor 30%, transparent) transparent; }
.g-thumb { flex: none; appearance: none; border: 0; padding: 0; background: none; height: 64px; cursor: pointer; opacity: .5; transition: opacity .3s, transform .4s var(--ease); scroll-snap-align: center; position: relative; color: inherit; }
.g-thumb img { height: 100%; width: auto; display: block; }
.g-thumb:hover { opacity: .9; transform: translateY(-2px); }
.g-thumb.on { opacity: 1; }
.g-thumb.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 1px; background: currentColor; }
.g-artist-nav { appearance: none; background: none; border: 0; color: inherit; cursor: pointer; display: flex; align-items: center; gap: 12px; text-align: left; padding: 6px; opacity: .8; transition: opacity .3s; }
.g-artist-nav:hover { opacity: 1; }
.g-artist-nav svg { width: 36px; height: 12px; flex: none; transition: transform .4s var(--ease); }
.g-artist-prev:hover svg { transform: translateX(-4px); }
.g-artist-next:hover svg { transform: translateX(4px); }
.g-artist-next { text-align: right; }
.g-artist-nav small { display: block; font: 500 10px/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; opacity: .65; }
.g-artist-nav b { font: 400 20px/1.2 var(--serif); font-style: italic; }
.g-finder { position: relative; }
.g-find { appearance: none; background: none; border: 1px solid color-mix(in oklab, currentColor 35%, transparent); color: inherit; display: flex; align-items: center; gap: 10px; padding: 10px 14px; font: 500 11px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; cursor: pointer; }
.g-find svg { width: 15px; height: 15px; }
.g-pop { position: absolute; right: 0; top: calc(100% + 8px); width: min(360px, 86vw); z-index: 30; background: #fbf8f2; color: #1d1b18; box-shadow: 0 18px 50px rgba(0,0,0,.35); padding: 12px; }
.g-pop input { width: 100%; font: 16px var(--sans); padding: 10px 12px; border: 1px solid #cfc7ba; background: #fff; color: #1d1b18; }
.g-pop ul { list-style: none; margin: 8px 0 0; padding: 0; max-height: 52svh; overflow-y: auto; }
.g-pop li { padding: 9px 10px; cursor: pointer; display: flex; flex-direction: column; }
.g-pop li span { font: 18px/1.2 var(--serif); }
.g-pop li small { font: 12px/1.4 var(--sans); color: #6d665c; }
.g-pop li[aria-selected="true"], .g-pop li:hover { background: #efe8dc; }
.g-pop li.none { cursor: default; color: #6d665c; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* the print panel: a side sheet on wide screens, a bottom sheet on phones */
.printer { position: fixed; top: 0; right: 0; bottom: 0; width: var(--panel); z-index: 40; overflow-y: auto; overscroll-behavior: contain;
  background: #fbf8f2; color: #1d1b18; padding: 20px 24px 40px; box-shadow: -20px 0 60px rgba(0,0,0,.35); animation: p-in .5s var(--ease); --focus: #7a3e1d; --ink: #1d1b18; }
.printer[hidden] { display: none; }
@keyframes p-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes p-up { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 1024px) { .printing .g-wall { margin-right: var(--panel); } .printer { animation: none; box-shadow: -1px 0 0 rgba(0,0,0,.25); } }
.p-head { display: flex; justify-content: space-between; align-items: center; }
.p-kicker { font: 500 11px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: #6d665c; margin: 0; }
.printer .p-close { appearance: none; background: none; border: 0; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; color: inherit; }
.p-close svg { width: 18px; height: 18px; }
.p-title { font: italic 500 30px/1.1 var(--serif); margin: 10px 0 4px; }
.p-by { font: 15px/1.4 var(--sans); color: #6d665c; margin: 0 0 18px; }
.p-scale { font: 12px var(--sans); color: #6d665c; }
.p-more { font: 13px var(--sans); }
.printer .btn { max-width: none; }
.printer .caps { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
@media (max-width: 1023px) {
  .printer { left: 0; right: 0; width: auto; top: auto; height: min(70svh, 100%); box-shadow: 0 -20px 60px rgba(0,0,0,.4); animation-name: p-up; }
  .printing .g-wall { height: 30svh; min-height: 0; grid-template-rows: minmax(0, 1fr); overflow: hidden; position: sticky; top: 0; }
  .printing .g-stage { grid-row: 1; height: 100%; }
  .printing .g-frame { height: 100%; max-height: none; }
  .printing .g-head, .printing .g-foot, .printing .g-cap, .printing .g-top { display: none; }
}

/* below the viewer: the catalogue index (details, other works, artists) */
.index { --ink: #1d1b18; --focus: #7a3e1d; background: #f6f2ea; color: #1d1b18; max-width: none; padding: 48px clamp(16px, 4vw, 56px) 56px; }
.index section { max-width: 1400px; margin: 0 auto 40px; }
.index h1 { font: 400 clamp(32px, 4vw, 52px)/1.05 "Bodoni Moda", serif; margin: 0 0 6px; }
.index h2 { font: 400 26px/1.2 var(--serif); margin: 32px 0 16px; }
.index .by { font: 17px var(--sans); color: #6d665c; }
.index .facts { max-width: 760px; }
.index .grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 24px 18px; }
body.gallery .foot { --ink: #1d1b18; background: #f6f2ea; color: #6d665c; }

@media (max-width: 700px) {
  .g-wall { height: auto; min-height: 100svh; }
  .g-frame { height: 44svh; }
  .g-stage { grid-template-columns: 36px minmax(0, 1fr) 36px; }
  .g-step { width: 36px; } .g-step svg { width: 26px; }
  .g-find span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .g-foot { grid-template-columns: 1fr 1fr; }
  .g-strip { grid-column: 1 / -1; grid-row: 1; }
  .g-artist-nav b { font-size: 17px; }
}

/* motion lives in gallery.js (crossfade layers, artist slide); reduced motion turns it off */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* desktop: the panel is always open, so no bar and no close button (kept last so it wins) */
@media (min-width: 1024px) { .g-buybar { display: none; } .printer .p-close { display: none; } }
/* a narrow viewer (desktop beside the panel, or tablets): the strip gets its own row above the artist controls */
@container (max-width: 720px) {
  .g-foot { grid-template-columns: 1fr 1fr; }
  .g-strip { grid-column: 1 / -1; grid-row: 1; }
  .g-artist-nav b { font-size: 17px; }
  .g-stage { grid-template-columns: 44px minmax(0, 1fr) 44px; }
  .g-step { width: 44px; } .g-step svg { width: 30px; }
}
