.jar-gallery { align-self: start; width: 100%; min-width: 0; }
.jar-photos { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.jar-slide { flex: 0 0 100%; min-width: 0; margin: 0; scroll-snap-align: start; }
.jar-slide > a { position: relative; display: block; cursor: zoom-in; }
.jar-slide > a::after {
  content: "";
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: rgba(255,255,255,.9) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234b3425' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='6'/%3E%3Cpath d='m15 15 5 5M7.5 10h5M10 7.5v5'/%3E%3C/svg%3E") no-repeat center;
  pointer-events: none;
}
.jar-thumbnails { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: .4rem; margin-top: .5rem; }
.jar-thumbnails button { display: grid; place-items: center; border: 1px solid #ddd2c4; padding: .25rem; background: #fff; cursor: pointer; }
.jar-thumbnails button[aria-current] { border-color: #6c4423; box-shadow: inset 0 0 0 1px #6c4423; }
.jar-thumbnails button img { width: 100%; max-width: 4.3rem; }
.jar-gallery :focus-visible { outline: 2px solid #845918; outline-offset: -2px; }

/* The larger canvas lets phone users pan across the original label. */
.jar-viewer {
  box-sizing: border-box;
  margin: auto;
  padding: 0;
  width: min(98vw, 1024px);
  max-width: 100vw;
  max-height: 96vh;
  max-height: 96dvh;
  overflow: hidden;
  background: #faf7f1;
}
.jar-viewer::backdrop { background: rgba(35, 26, 21, .78); }
.jar-viewer-frame {
  max-height: 96vh;
  max-height: 96dvh;
  overflow: auto;
  overscroll-behavior: contain;
}
.jar-viewer-frame img {
  display: block;
  width: 100%;
  min-width: 700px;
  max-width: none;
  height: auto;
}
.jar-viewer-close {
  position: absolute;
  z-index: 1;
  top: .5rem;
  right: .5rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #c4b4a5;
  border-radius: 50%;
  background: #fff;
  color: #4b3425;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}
body:has(.jar-viewer[open]) { overflow: hidden; }