.max-w-prose { max-width:120ch } .panzoom-popup { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.8); display: flex; justify-content: center; align-items: center; z-index: 9999; cursor: zoom-out; overflow: hidden; } .panzoom-popup img { max-width: 100%; max-height: 100%; cursor: grab; vertical-align: middle; margin-left: auto; margin-right: auto; } .panzoom-popup .panzoom-overlay { position: relative; width: 100%; height: 100%; } .panzoom-container { cursor: zoom-in; display: inline-block; /* Shrink-wrap the content */ max-width: fit-content; /* Ensure the container doesn't grow larger than its content */ max-height: fit-content; /* Restrict height similarly */ margin: 0 auto; /* Optional: Center the container if necessary */ overflow: hidden; /* Ensure no content overflows */ } .panzoom-container img { display: block; max-width: 100%; height: auto; } .gallery { width: auto; /* Allow it to size naturally */ max-width: 100%; /* Prevent overflow */ }