.gallery-shell {
  max-width: 1640px;
}
.gallery-shell .page-heading {
  margin-bottom: 16px;
}
.gallery-hint {
  font-size: 14px;
  color: #cabba7;
  margin-bottom: 32px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px 44px;
  align-items: start;
  padding: 8px 12px 32px;
}
.gallery-print {
  position: relative;
  min-width: 0;
  transform: rotate(var(--rotation));
  transition: transform 320ms var(--settle);
  z-index: 1;
}
.gallery-print:nth-child(3n + 2) {
  margin-top: 32px;
}
.print-button {
  display: block;
  position: relative;
  width: 100%;
  background: var(--paper);
  border: 0;
  padding: 10px;
  box-shadow: var(--shadow);
  transition: box-shadow 320ms var(--settle);
  color: var(--ink);
  text-align: left;
}
.print-button img {
  width: 100%;
  height: auto;
  aspect-ratio: var(--ratio, auto);
  background: #39322a;
  min-height: 100px;
}
.gallery-print:is(:hover, :focus-within) {
  transform: translateY(-11px) rotate(var(--tilt, 0deg)) scale(1.02);
  z-index: 3;
}
.gallery-print:is(:hover, :focus-within) .print-button {
  box-shadow:
    13px 26px 26px #000a,
    2px 3px 5px #0008;
}
.gallery-print.is-broken img {
  min-height: 180px;
}
.gallery-message {
  padding: 50px 0;
}
.gallery-message p {
  margin-bottom: 18px;
}
.gallery-sentinel {
  text-align: right;
  margin-top: 32px;
}
.gallery-sentinel button {
  border: 0;
  font-size: 18px;
}
.viewer-open {
  overflow: hidden;
}
.gallery-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  padding: 24px;
  background: #17130ff5;
  color: var(--ivory);
  overflow: auto;
}
.gallery-viewer::backdrop {
  background: #080604e8;
}
.gallery-viewer[open] {
  animation: fade-in 180ms var(--quick);
}
.viewer-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 1800px;
  margin: auto;
}
.viewer-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  align-items: center;
  flex: none;
}
.viewer-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.viewer-actions a,
.viewer-actions button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  gap: 10px;
  border: 1px solid #eee5d844;
  font-size: 15px;
}
.viewer-actions a:hover,
.viewer-actions button:hover {
  background: #e8dccb18;
}
.viewer-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 20px;
  align-items: center;
  padding-top: 20px;
}
.viewer-stage figure {
  margin: 0;
  min-height: 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.viewer-image-wrap {
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  width: 100%;
}
.viewer-image-wrap img {
  object-fit: contain;
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  border: 9px solid var(--paper);
  box-shadow: var(--shadow);
  animation: photo-in 320ms var(--settle);
}
.viewer-image-wrap.is-loading img {
  opacity: 0.45;
}
.viewer-stage figcaption {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  padding-top: 14px;
  flex: none;
}
.viewer-step {
  width: 48px;
  height: 52px;
  padding: 0;
  border: 0;
  font-size: 30px;
}
.viewer-step:hover {
  color: var(--accent);
}
.viewer-step:disabled {
  opacity: 0.3;
}
.viewer-image-wrap.is-error img {
  max-height: 120px;
}
@keyframes photo-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 24px;
  }
  .gallery-print:nth-child(3n + 2) {
    margin-top: 0;
  }
  .gallery-print:nth-child(even) {
    margin-top: 25px;
  }
  .viewer-actions {
    gap: 8px;
  }
  .viewer-stage {
    gap: 8px;
  }
}
@media (max-width: 520px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 35px;
    padding: 10px 18px 20px;
  }
  .gallery-print:nth-child(even) {
    margin-top: 0;
  }
  .gallery-hint {
    font-size: 13px;
  }
  .gallery-viewer {
    padding: 16px 12px;
  }
  .viewer-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .viewer-actions {
    justify-content: space-between;
  }
  .viewer-actions a,
  .viewer-actions button {
    font-size: 13px;
    padding: 8px 12px;
  }
  .viewer-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px 0 58px;
  }
  .viewer-stage figure {
    width: 100%;
    height: 100%;
  }
  .viewer-step {
    position: absolute;
    bottom: 0;
  }
  .viewer-previous {
    left: 20%;
  }
  .viewer-next {
    right: 20%;
  }
  .viewer-image-wrap img {
    border-width: 6px;
  }
  .viewer-stage figcaption {
    font-size: 12px;
  }
  .gallery-print:is(:hover, :focus-within) {
    transform: rotate(var(--rotation));
  }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-print:is(:hover, :focus-within) {
    transform: rotate(var(--rotation));
  }
}
