/* Apply to nested scroll areas as well as the document in embedded views. */
:where(.pinch-zoom-enabled, .pinch-zoom-enabled *) {
  touch-action: pan-x pan-y;
}

.page-pinched > body > :is(main, footer) {
  width: 100vw;
  zoom: var(--page-pinch-scale);
}

.page-pinched > body > header {
  width: 100vw;
}

dialog.dialog-pinched {
  overflow: auto;
  overscroll-behavior: contain;
}

dialog.dialog-pinched > :not(.photo-close) {
  zoom: var(--dialog-pinch-scale);
}

/* Dialogs inside main have their own zoom and remain sized to the screen. */
.page-pinched > body > main dialog {
  zoom: calc(1 / var(--page-pinch-scale));
}
