@media (max-width: 767px) {
  #sp-component .dp-photo-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
  }
  #sp-component .dp-photo-grid > br { display: none; }
  #sp-component .dp-photo-grid > a,
  #sp-component .dp-photo-grid > a img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    height: auto !important;
    margin: 0 !important;
    float: none !important;
    box-sizing: border-box;
  }
  #sp-component .dp-photo-grid.dp-single { grid-template-columns: minmax(0, 1fr); }
}

html.dp-viewing { overflow: hidden; }
dialog.dp-viewer {
  position: fixed; inset: 0; margin: 0; padding: 0; border: 0;
  width: 100%; height: 100%; max-width: none; max-height: none;
  background: transparent; outline: none; overflow: hidden;
}
dialog.dp-viewer[open] { display: grid; place-items: center; }
.dp-viewer::backdrop { background: rgb(0 0 0 / 54%); }
.dp-viewer .dp-stage { position: relative; touch-action: pan-y pinch-zoom; }
.dp-viewer .dp-image {
  display: block; width: auto; height: auto;
  max-width: calc(100vw - 32px); max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
}
.dp-viewer .dp-error { display: block; padding: 20px 54px; background: white; color: #263036; }
.dp-viewer .dp-button {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; margin: 0; padding: 0;
  width: 44px; height: 48px; color: white; opacity: .78;
  border: 0; background: transparent; box-shadow: none; cursor: pointer;
}
.dp-viewer .dp-prev { left: 0; }
.dp-viewer .dp-next { right: 0; }
.dp-viewer .dp-button svg { width: 28px; height: 28px; filter: drop-shadow(0 1px 2px #242424); }
.dp-viewer .dp-button:hover, .dp-viewer .dp-button:focus-visible { opacity: 1; }
.dp-viewer .dp-button:focus-visible { outline: 2px solid #4393d5; }
.dp-viewer .dp-count, .dp-viewer .dp-close {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.dp-viewer .dp-close:focus-visible { top: 8px; right: 8px; transform: none; width: 44px; height: 44px; clip-path: none; }
.dp-viewer > div:last-child:has(.dp-count) { position: absolute; }
.dp-viewer [hidden] { display: none !important; }

.dp-viewer .dp-stage:has(.dp-image:not([hidden])) { width: min(1100px, calc(100vw - 32px), calc((100dvh - 48px) * var(--ratio, 1))); }
.dp-viewer .dp-stage .dp-image { width: 100%; height: auto; }
.dp-viewer .dp-outgoing { position: fixed; pointer-events: none; max-width: none; max-height: none; }
@keyframes dp-in { from {opacity:0} to {opacity:1} }
@keyframes dp-out { from {opacity:1} to {opacity:0} }
@media (prefers-reduced-motion: no-preference) {
  dialog.dp-viewer[open], dialog.dp-viewer[open]::backdrop { animation: dp-in 180ms ease-out both; }
  dialog.dp-viewer.dp-closing, dialog.dp-viewer.dp-closing::backdrop { animation: dp-out 160ms ease-in both; }
}
