/* Shared, local-only artwork viewer for all four case studies. */
html.image-viewer-open { overflow: hidden; }
.case-cover a[aria-haspopup="dialog"],
.screen a[aria-haspopup="dialog"] { cursor: zoom-in; }
.image-viewer {
  width: calc(100% - 40px);
  height: calc(100vh - 40px);
  height: calc(100dvh - 40px);
  max-width: 1680px;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 100px #0004;
  overflow: hidden;
}
.image-viewer::backdrop { background: #252321cc; }
.image-viewer-layout {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.image-viewer-toolbar,
.image-viewer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 22px;
}
.image-viewer-toolbar { border-bottom: 1px solid var(--line); }
.image-viewer button {
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}
.image-viewer button:hover { background: #ede3d7; }
.image-viewer button:focus-visible,
.image-viewer-stage:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: -3px;
}
.image-viewer .image-viewer-close {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.image-viewer .image-viewer-close:hover { background: #49423d; }
.image-viewer-close span:last-child { margin-left: 8px; font-size: 20px; line-height: 1; }
.image-viewer-hint { font: 10px var(--mono); color: var(--muted); }
.image-viewer-stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  padding: 20px;
  overflow: auto;
  overscroll-behavior: contain;
  background: #eae5df;
}
.image-viewer-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.image-viewer-stage.is-zoomed { place-items: start; }
.image-viewer-stage.is-zoomed .image-viewer-image {
  width: 1440px;
  max-width: none;
  max-height: none;
}
.image-viewer [hidden] { display: none !important; }
.image-viewer-error { max-width: 340px; font-size: 14px; line-height: 1.7; text-align: center; }
.image-viewer-footer { border-top: 1px solid var(--line); }
.image-viewer-caption { min-width: 0; }
.image-viewer-caption h2 { font-size: 15px; line-height: 1.4; }
.image-viewer-description { max-width: 850px; margin-top: 5px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.image-viewer-navigation { display: flex; align-items: center; gap: 13px; flex-shrink: 0; }
.image-viewer-navigation button { width: 44px; padding: 0; font-size: 20px; }
.image-viewer-counter { min-width: 40px; text-align: center; white-space: nowrap; font: 11px var(--mono); }
@media (max-width: 700px) {
  .image-viewer { width: 100%; height: 100vh; height: 100dvh; max-width: none; border: 0; border-radius: 0; }
  .image-viewer-toolbar { gap: 10px; padding: max(10px, env(safe-area-inset-top)) 12px 10px; }
  .image-viewer-hint { display: none; }
  .image-viewer button { padding: 10px; font-size: 11px; }
  .image-viewer .image-viewer-close { gap: 7px; }
  .image-viewer-close span:last-child { margin-left: 3px; }
  .image-viewer-stage { padding: 10px; }
  .image-viewer-footer { flex-wrap: wrap; gap: 12px; padding: 14px 16px max(14px, env(safe-area-inset-bottom)); }
  .image-viewer-caption { flex-basis: 100%; }
  .image-viewer-caption h2 { font-size: 14px; }
  .image-viewer-description { display: none; }
  .image-viewer-navigation { width: 100%; justify-content: space-between; }
  .image-viewer-navigation button { font-size: 20px; }
}
