[data-legacy-viewer] {
  min-width: 0;
  display: grid;
  gap: .65rem;
  align-content: start;
}

[data-legacy-viewer] [data-viewer-stage],
[data-legacy-viewer] figure {
  min-width: 0;
  margin: 0;
  background: var(--wash, #e6e8de);
}

[data-legacy-viewer] [data-viewer-image] {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  cursor: zoom-in;
}

[data-viewer-caption] {
  margin: .05rem 0;
  color: var(--muted, #565b4f);
  font-size: .87rem;
}

[data-viewer-tools],
[data-legacy-viewer] .viewer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}

[data-legacy-viewer] button,
.artist-legacy-lightbox button {
  min-height: 2.75rem;
  padding: .34rem .65rem;
  border: 1px solid var(--rule, #cecec0);
  border-radius: .2rem;
  color: inherit;
  background: var(--paper, #f4f1e9);
  font: inherit;
  font-size: .86rem;
  cursor: pointer;
}

[data-legacy-viewer] button[hidden] {
  display: none;
}

[data-legacy-viewer] button[aria-pressed="true"] {
  border-color: var(--ink, #252821);
  color: var(--paper, #f4f1e9);
  background: var(--ink, #252821);
}

[data-legacy-viewer] button:disabled {
  opacity: .45;
  cursor: default;
}

[data-viewer-prev],
[data-viewer-next],
.artist-legacy-lightbox__controls button {
  min-width: 2.75rem;
}

.artist-legacy-lightbox__controls button[aria-pressed="true"] {
  color: #242720;
  background: #f6f3eb;
  border-color: #f6f3eb;
}

@media (max-width: 40rem) {
  [data-legacy-viewer] [data-viewer-image] {
    max-height: none;
  }
}

.artist-legacy-lightbox {
  width: min(96vw, 82rem);
  max-width: none;
  max-height: 96vh;
  max-height: 96dvh;
  padding: clamp(.6rem, 2vw, 1rem);
  border: 1px solid #696961;
  color: #f6f3eb;
  background: #242720;
  overflow: auto;
}

.artist-legacy-lightbox[open] {
  display: grid;
  gap: .52rem;
}

.artist-legacy-lightbox::backdrop {
  background: #171912dd;
}

.artist-legacy-lightbox__stage {
  display: grid;
  place-items: center;
  background: #1b1d17;
}

.artist-legacy-lightbox__stage img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(96vh - 8rem);
  max-height: calc(96dvh - 8rem);
  object-fit: contain;
}

.artist-legacy-lightbox__controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .4rem;
}

.artist-legacy-lightbox__controls button {
  color: #f6f3eb;
  background: #373a31;
  border-color: #777a70;
}

.artist-legacy-lightbox__caption {
  margin: 0;
  font-size: .9rem;
  text-align: center;
}


[data-viewer-stage] [data-gallery-crop],
.artist-legacy-lightbox__stage [data-gallery-crop] {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
}
[data-viewer-stage] [data-gallery-crop] { cursor: zoom-in; }
.artist-legacy-lightbox__stage [data-gallery-crop] { max-height: calc(96dvh - 8rem); }
[data-viewer-stage] img[hidden], .artist-legacy-lightbox__stage img[hidden] { display: none; }
.gallery-studio-card .gallery-card-tools { display:flex; align-items:center; justify-content:center; gap:.3rem; margin:.35rem .5rem 0; padding:0; }
.gallery-studio-card .gallery-card-tools button { min-width:2rem; min-height:2rem; padding:.15rem .55rem; font:inherit; font-size:.78rem; line-height:1.15; }
.gallery-studio-card .card-body a { color:inherit; text-decoration:none; }
.gallery-studio-card .card-body a:focus-visible, .gallery-studio-card .card-body a:hover { text-decoration:underline; }
.gallery-studio-card [data-viewer-stage] { position:relative; width:100%; aspect-ratio:1.42; }
.gallery-studio-card [data-viewer-stage] > img,
.gallery-studio-card [data-viewer-stage] > [data-gallery-crop] { position:absolute; inset:0; width:100%; height:100%; max-height:100%; object-fit:contain; }
@media (max-width: 40rem) { [data-viewer-stage] [data-gallery-crop] { max-height: none; } }

.artist-legacy-lightbox__header{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.6rem;align-items:center}
.artist-legacy-lightbox__header .artist-legacy-lightbox__caption{text-align:start;overflow-wrap:anywhere}
.artist-legacy-lightbox .artist-legacy-lightbox__close{display:grid;place-items:center;min-width:2.75rem;min-height:2.75rem;padding:0;font-size:1.45rem;line-height:1;color:#f6f3eb;background:#373a31;border-color:#777a70}
@media(max-width:40rem){
 .gallery-studio-card{container-type:inline-size}
 .gallery-studio-card .gallery-card-tools,.artist-legacy-lightbox__controls{display:flex;flex-wrap:nowrap;gap:.28rem}
 .gallery-studio-card .gallery-card-tools button,.artist-legacy-lightbox__controls button{min-height:2.75rem;padding:.27rem .25rem;font-size:.78rem;line-height:1.16}
 .gallery-studio-card .gallery-card-tools [data-viewer-kind],.artist-legacy-lightbox__controls [data-viewer-kind]{flex:1 1 0;min-width:0;max-width:10rem;overflow-wrap:anywhere}
 .gallery-studio-card .gallery-card-tools :is([data-viewer-prev],[data-viewer-next]),.artist-legacy-lightbox__controls :is([data-viewer-prev],[data-viewer-next]){flex:0 0 2.75rem;min-width:2.75rem}
 .artist-legacy-lightbox[open]{gap:.4rem}
 .artist-legacy-lightbox__stage :is(img,[data-gallery-crop]){max-height:calc(96dvh - 7.75rem)}
}
@container (max-width:235px){
 .gallery-studio-card .gallery-card-tools:has([data-viewer-kind]:not([hidden])){display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .gallery-studio-card .gallery-card-tools [data-viewer-prev]{grid-row:2;grid-column:1}
 .gallery-studio-card .gallery-card-tools [data-viewer-next]{grid-row:2;grid-column:2}
 .gallery-studio-card .gallery-card-tools:not(:has([data-viewer-kind]+[data-viewer-kind])) [data-viewer-kind]{grid-column:1/-1}
}
