﻿/* PDF viewer container and canvas styles.
   Desktop: scrollbars enabled. Mobile: gestures enabled.
   The page is centered whenever smaller than the container. */

#pdf-container {
    position: relative;
    width: 100%;
    height: 100%; /* parent should provide a real height */
    background: #f5f5f5;
    /*border: 10px solid #f5f5f5;*/
}

/* Desktop/trackpad: normal scrolling */
@media (pointer: fine) {
    #pdf-container {
        overflow: auto; /* allow scrollbars */
        touch-action: auto; /* mouse/trackpad default behavior */
        overscroll-behavior: auto;
    }
}

/* Mobile/tablet: capture gestures inside the viewer */
@media (pointer: coarse) {
    #pdf-container {
        overflow: hidden; /* prevent the page from scrolling while panning */
        touch-action: none; /* disable browser panning/zooming inside container */
        overscroll-behavior: contain;
    }
}

#pdf-canvas {
    display: block;
    background: #f5f5f5; /* page background */
    transform-origin: 0 0; /* predictable pan/zoom */
    transition: opacity 120ms ease-out; /* avoid flashing on load */
    width: 100%;
}

