/* Mobile-first gallery: editorial image wall and touch-ready inspection studio. */
.gallery-v3 {
  --gallery-max:1320px;
  min-height:70vh;
  padding:0 16px 70px;
}
.gallery-v3-hero {
  max-width:var(--gallery-max);
  margin:0 auto;
  padding:42px 0 24px;
  display:grid;
  grid-template-columns:1fr;
  gap:18px;
  align-items:end;
}
.gallery-v3-hero .eyebrow { margin-bottom:15px; }
.gallery-v3-hero h1 {
  max-width:12ch;
  margin:0;
  color:var(--plum);
  font:500 clamp(42px,11vw,62px)/.98 var(--display-serif);
  letter-spacing:-.05em;
}
.gallery-v3-hero h1 em { color:var(--pink-strong); }
.gallery-v3-intro { max-width:48ch; margin:16px 0 0; color:var(--muted); font-size:14px; }
.gallery-v3-stamp { display:none; }
.gallery-v3-shell { max-width:var(--gallery-max); margin:0 auto; }
.gallery-v3-controls {
  position:sticky;
  top:64px;
  z-index:20;
  padding:10px 0;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  border-block:1px solid var(--line);
  background:color-mix(in srgb,var(--bg) 96%,transparent);
  backdrop-filter:blur(12px);
}
.gallery-v3-search { position:relative; grid-column:1/-1; }
.gallery-v3-search input {
  width:100%;
  height:44px;
  padding:0 42px 0 13px;
  border:1px solid var(--line);
  border-radius:0;
  outline-offset:2px;
  color:var(--ink);
  background:var(--white);
  font:inherit;
  font-size:13px;
}
.gallery-v3-search input::placeholder { color:var(--muted); opacity:.75; }
.gallery-v3-search svg { position:absolute; top:13px; right:13px; width:17px; color:var(--pink-strong); pointer-events:none; }
.gallery-v3-count { color:var(--muted); font-size:11px; white-space:nowrap; }
.gallery-v3-count strong { color:var(--plum); font-size:14px; }
.gallery-v3-filter-label {
  grid-column:1/-1;
  display:flex;
  align-items:center;
  gap:7px;
  overflow-x:auto;
  margin-inline:-16px;
  padding:2px 16px 5px;
  scrollbar-width:thin;
  scrollbar-color:var(--pink) transparent;
  overscroll-behavior-inline:contain;
}
.gallery-v3-filter {
  flex:0 0 auto;
  min-height:36px;
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:999px;
  color:var(--muted);
  background:transparent;
  font:700 11px var(--font-ui);
  cursor:pointer;
  transition:color .2s,background .2s,border-color .2s,transform .2s;
}
.gallery-v3-filter:hover { border-color:var(--pink); color:var(--plum); }
.gallery-v3-filter.is-active { border-color:var(--plum); color:var(--white); background:var(--plum); }
.gallery-v3-tools { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:14px 0 12px; }
.gallery-v3-result-note { margin:0; color:var(--muted); font-size:10px; }
.gallery-v3-density { display:flex; gap:3px; padding:2px; border:1px solid var(--line); }
.gallery-v3-density button { width:32px; height:30px; display:grid; place-items:center; border:0; color:var(--muted); background:transparent; cursor:pointer; }
.gallery-v3-density button[aria-pressed="true"] { color:var(--plum); background:var(--pink-soft); }
.gallery-v3-density svg { width:15px; height:15px; }
.gallery-v3-density button[data-columns="4"] { display:none; }
.gallery-v3-grid { --gallery-cols:2; display:grid; grid-template-columns:repeat(var(--gallery-cols),minmax(0,1fr)); gap:8px; }
.gallery-v3-grid[data-columns="2"] { --gallery-cols:2; }
.gallery-v3-grid[data-columns="3"] { --gallery-cols:3; }
.gallery-v3-card { min-width:0; }
.gallery-v3-card-button {
  position:relative;
  width:100%;
  aspect-ratio:4/5;
  display:grid;
  place-items:center;
  padding:0;
  overflow:hidden;
  border:1px solid var(--line);
  background:var(--pink-soft);
  cursor:zoom-in;
  -webkit-tap-highlight-color:transparent;
}
.gallery-v3-card-button img { width:100%; height:100%; object-fit:contain; transition:transform .55s cubic-bezier(.2,.75,.2,1),opacity .3s; }
.gallery-v3-card-button::after { content:""; position:absolute; inset:0; border:0 solid var(--pink); transition:border-width .2s; pointer-events:none; }
.gallery-v3-card-index { position:absolute; left:7px; bottom:7px; z-index:1; padding:5px 7px; color:var(--white); background:var(--plum); font:700 8px var(--font-ui); letter-spacing:.08em; }
.gallery-v3-card-caption { display:flex; justify-content:space-between; gap:6px; padding:7px 0 0; }
.gallery-v3-card-caption span { overflow:hidden; color:var(--muted); font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.gallery-v3-card-caption a { flex:0 0 auto; color:var(--pink-strong); font-size:9px; font-weight:800; text-decoration:none; }
.gallery-v3-empty { grid-column:1/-1; padding:48px 18px; border:1px solid var(--line); color:var(--muted); font-size:13px; text-align:center; }
.gallery-v3-more { display:flex; flex-direction:column; align-items:center; gap:10px; padding:28px 0; }
.gallery-v3-more button { min-height:46px; padding:12px 22px; border:1px solid var(--plum); color:var(--plum); background:transparent; font:700 12px var(--font-ui); cursor:pointer; transition:color .2s,background .2s; }
.gallery-v3-more button:hover { color:var(--white); background:var(--plum); }
.gallery-v3-more p { margin:0; color:var(--muted); font-size:10px; }
body.gallery-studio-open { overflow:hidden; }
.gallery-studio {
  position:fixed;
  z-index:1000;
  inset:0;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  padding:8px 10px max(10px,env(safe-area-inset-bottom));
  color:var(--white);
  background:rgba(42,29,35,.98);
  overscroll-behavior:contain;
}
.gallery-studio[hidden] { display:none; }
.gallery-studio-top { display:grid; grid-template-columns:1fr auto; align-items:center; gap:8px; min-height:44px; }
.gallery-studio-ident { display:flex; align-items:center; gap:8px; min-width:0; }
.gallery-studio-ident img { width:42px; max-height:32px; object-fit:contain; filter:brightness(0) invert(1); }
.gallery-studio-current { overflow:hidden; color:rgba(255,255,255,.72); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.gallery-studio-close { justify-self:end; width:38px; height:38px; border:1px solid rgba(255,255,255,.24); border-radius:50%; color:#fff; background:transparent; font-size:21px; cursor:pointer; }
.gallery-studio-stage { position:relative; min-width:0; min-height:0; display:grid; grid-template-columns:32px minmax(0,1fr) 32px; align-items:center; gap:3px; }
.gallery-studio-viewport { position:relative; width:100%; height:100%; min-height:0; display:grid; place-items:center; overflow:hidden; touch-action:none; cursor:grab; }
.gallery-studio-viewport.is-moving { cursor:grabbing; }
.gallery-studio-image { max-width:none; max-height:none; width:auto; height:auto; object-fit:contain; user-select:none; -webkit-user-drag:none; transform-origin:center; will-change:transform; }
.gallery-studio-nav { width:32px; height:32px; display:grid; place-items:center; border:1px solid rgba(255,255,255,.24); border-radius:50%; color:#fff; background:rgba(255,255,255,.05); font-size:18px; cursor:pointer; transition:background .2s,transform .2s; }
.gallery-studio-nav:hover,.gallery-studio-close:hover { background:rgba(236,113,177,.25); }
.gallery-studio-bottom { display:grid; grid-template-columns:1fr auto; align-items:center; gap:7px; padding-top:8px; }
.gallery-studio-photo-info { min-width:0; }
.gallery-studio-photo-info strong { display:block; color:#fff; font:500 17px var(--display-serif); }
.gallery-studio-photo-info span { display:block; margin-top:2px; overflow:hidden; color:rgba(255,255,255,.58); font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.gallery-studio-zoom { grid-column:1; grid-row:2; justify-self:start; display:flex; align-items:center; gap:5px; padding:3px; border:1px solid rgba(255,255,255,.2); border-radius:999px; }
.gallery-studio-zoom button { min-width:34px; height:30px; border:0; color:#fff; background:transparent; font:700 12px var(--font-ui); cursor:pointer; }
.gallery-studio-zoom button:hover { color:var(--pink); }
.gallery-studio-zoom output { min-width:42px; color:rgba(255,255,255,.72); font:10px var(--font-ui); text-align:center; }
.gallery-studio-zoom input { width:58px; height:24px; accent-color:var(--pink); cursor:pointer; }
.gallery-studio-actions { grid-column:2; grid-row:1/3; display:flex; flex-direction:column; align-items:stretch; gap:6px; }
.gallery-studio-fit { min-height:34px; padding:7px 10px; border:1px solid rgba(255,255,255,.26); color:#fff; background:transparent; font:700 9px var(--font-ui); cursor:pointer; white-space:nowrap; }
.gallery-studio-order { min-height:34px; display:inline-flex; align-items:center; justify-content:center; padding:8px 11px; color:var(--plum); background:var(--pink); font-size:10px; font-weight:800; text-decoration:none; white-space:nowrap; }
.gallery-studio-order:hover { background:var(--pink-soft); }
.gallery-studio-hint { display:none; }
@media(min-width:520px) {
  .gallery-v3 { padding-inline:22px; }
  .gallery-v3-hero { padding-top:54px; }
  .gallery-v3-filter-label { margin-inline:-22px; padding-inline:22px; }
  .gallery-v3-grid { gap:12px; }
  .gallery-v3-card-caption span,.gallery-v3-card-caption a { font-size:10px; }
  .gallery-studio { padding:12px 16px max(14px,env(safe-area-inset-bottom)); }
  .gallery-studio-top { grid-template-columns:1fr auto 1fr; min-height:48px; }
  .gallery-studio-ident img { width:50px; }
  .gallery-studio-current { text-align:center; }
  .gallery-studio-bottom { grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); gap:12px; }
  .gallery-studio-zoom { grid-column:auto; grid-row:auto; }
  .gallery-studio-actions { grid-column:auto; grid-row:auto; justify-self:end; flex-direction:row; }
  .gallery-studio-fit,.gallery-studio-order { min-height:38px; }
}
@media(min-width:760px) {
  .gallery-v3-density button[data-columns="4"] { display:grid; }
  .gallery-v3 { padding:0 24px 100px; }
  .gallery-v3-hero { grid-template-columns:1fr auto; padding:clamp(60px,7vw,92px) 0 38px; gap:24px; }
  .gallery-v3-hero h1 { font-size:clamp(56px,6vw,78px); }
  .gallery-v3-stamp { width:108px; aspect-ratio:1; display:grid; place-content:center; border:1px solid var(--pink); border-radius:50%; color:var(--pink-strong); font:500 20px/1.1 var(--display-serif); text-align:center; transform:rotate(8deg); }
  .gallery-v3-stamp small { margin-top:5px; font:700 8px/1.2 var(--font-ui); letter-spacing:.13em; text-transform:uppercase; }
  .gallery-v3-controls { top:78px; grid-template-columns:minmax(210px,1fr) auto; gap:12px 24px; padding:14px 0; }
  .gallery-v3-search { grid-column:auto; max-width:420px; }
  .gallery-v3-filter-label { margin-inline:0; padding:2px 0 5px; }
  .gallery-v3-tools { margin:20px 0 14px; }
  .gallery-v3-result-note { font-size:12px; }
  .gallery-v3-grid { --gallery-cols:3; gap:16px; }
  .gallery-v3-grid[data-columns="2"] { --gallery-cols:2; }
  .gallery-v3-grid[data-columns="3"] { --gallery-cols:3; }
  .gallery-v3-grid[data-columns="4"] { --gallery-cols:4; }
  .gallery-studio-zoom input { width:86px; }
  .gallery-v3-grid[data-columns="4"] { --gallery-cols:4; }
  .gallery-v3-card-index { left:10px; bottom:10px; padding:6px 8px; font-size:9px; }
  .gallery-v3-card-caption { padding-top:9px; }
  .gallery-v3-card-caption span,.gallery-v3-card-caption a { font-size:10px; }
  .gallery-v3-card-button:hover img { transform:scale(1.035); }
  .gallery-v3-card-button:hover::after { border-width:3px; }
  .gallery-v3-empty { padding:60px 20px; font-size:inherit; }
  .gallery-v3-more { padding:34px 0; }
  .gallery-v3-more p { font-size:11px; }
  .gallery-studio { padding:14px 20px 16px; }
  .gallery-studio-stage { grid-template-columns:56px minmax(0,1fr) 56px; gap:12px; }
  .gallery-studio-nav { width:46px; height:46px; font-size:24px; }
  .gallery-studio-close { width:42px; height:42px; font-size:23px; }
  .gallery-studio-photo-info strong { font-size:20px; }
  .gallery-studio-photo-info span { font-size:10px; }
  .gallery-studio-fit { min-height:38px; padding:8px 12px; font-size:10px; }
  .gallery-studio-order { min-height:40px; padding:9px 14px; font-size:11px; }
  .gallery-studio-hint { position:absolute; right:50%; bottom:20px; display:block; color:rgba(255,255,255,.48); font-size:10px; transform:translateX(50%); white-space:nowrap; pointer-events:none; }
}
@media(min-width:1120px) {
  .gallery-v3-grid { --gallery-cols:4; gap:clamp(14px,1.5vw,20px); }
  .gallery-v3-grid[data-columns="5"] { --gallery-cols:5; }
}
@media(prefers-reduced-motion:reduce) {
  .gallery-v3-card-button img,.gallery-v3-filter,.gallery-v3-more button { transition:none; }
}

/* Preserve usable photo widths and touch targets on phones. */
.gallery-v3-card { margin:0; }
.gallery-studio-top { grid-template-columns:minmax(0,1fr) auto; }
.gallery-studio-top > [data-studio-index] { display:none; }
.gallery-studio-close { grid-column:2; grid-row:1; min-width:44px; min-height:44px; }
.gallery-v3-density button,.gallery-studio-zoom button { min-width:44px; min-height:44px; }
@media(max-width:519px) {
 .gallery-studio-bottom { grid-template-columns:minmax(0,1fr); }
 .gallery-studio-zoom { grid-column:1; grid-row:auto; }
 .gallery-studio-actions { grid-column:1; grid-row:auto; flex-direction:row; flex-wrap:wrap; }
 .gallery-studio-order { flex:1; min-height:44px; }
 .gallery-studio-fit { min-height:44px; }
}

/* Photo-first presentation and a compact, balanced mobile viewer. */
.gallery-v3-hero { padding-top:34px; }
.gallery-v3-hero h1 { font-size:clamp(38px,10vw,64px); line-height:1.08; letter-spacing:-.04em; }
.gallery-v3-intro { font-size:14px; line-height:1.85; }
.gallery-v3-tools { align-items:center; gap:14px; }
.gallery-v3-result-note { max-width:38ch; line-height:1.6; }
.gallery-v3-density { flex-shrink:0; border-radius:5px; }
.gallery-v3-filter { min-height:42px; padding:10px 15px; font-size:12px; }
.gallery-v3-search input { font-size:16px; }
.gallery-v3-card-button { border-radius:4px; background:var(--white); }
.gallery-v3-card-index { border-radius:2px; letter-spacing:.06em; }
.gallery-v3-card-caption { flex-wrap:wrap; gap:4px; padding:10px 2px 8px; }
.gallery-v3-card-caption span { flex-basis:100%; font-size:11px; line-height:1.5; }
.gallery-v3-card-caption a { min-height:36px; display:inline-flex; align-items:center; font-size:11px; }
.gallery-studio { background:var(--ink); }
.gallery-studio-top { padding-bottom:8px; border-bottom:1px solid rgba(255,255,255,.12); }
.gallery-studio-viewport { border-radius:4px; }
.gallery-studio-stage { padding-block:12px; }
.gallery-studio-bottom { padding-top:12px; border-top:1px solid rgba(255,255,255,.12); }
.gallery-studio-zoom { background:rgba(255,255,255,.04); }
.gallery-studio-photo-info span { line-height:1.5; }
.gallery-studio-order { border-radius:3px; }
@media(min-width:760px) {
 .gallery-v3-hero { padding-top:64px; }
 .gallery-v3-hero h1 { font-size:70px; }
 .gallery-v3-card-caption span { font-size:12px; }
 .gallery-v3-search input { font-size:14px; }
}

/* Bounded thumbnail strip: only nine nearby previews, never the whole catalog. */
.gallery-studio{grid-template-rows:auto minmax(0,1fr) auto auto}
.gallery-studio-thumbs{position:relative;display:flex;gap:7px;max-width:650px;width:100%;min-width:0;justify-self:center;overflow-x:auto;overscroll-behavior-x:contain;padding:5px 3px 9px;scrollbar-width:thin;scrollbar-color:#9b6b84 transparent}
.gallery-studio-thumb{flex:0 0 48px;width:48px;height:56px;min-height:44px;padding:2px;border:1px solid rgba(255,255,255,.3);border-radius:5px;background:#482333;cursor:pointer;opacity:.65}
.gallery-studio-thumb img{display:block;width:100%;height:100%;object-fit:cover;border-radius:3px}
.gallery-studio-thumb[aria-current="true"]{border:2px solid #ec71b1;opacity:1}
.gallery-studio-thumb:hover{opacity:1}
.gallery-studio-thumb:focus-visible{outline:2px solid #f7b8d9;outline-offset:1px;opacity:1}
@media(min-width:760px){.gallery-studio-thumb{flex-basis:56px;width:56px;height:64px}.gallery-studio-thumbs{gap:8px}}
@media(max-height:600px) and (orientation:landscape){.gallery-studio-thumb{height:44px;flex-basis:40px;width:40px}.gallery-studio-thumbs{padding-block:2px}}
