/* Shared Film Force expanded-picture viewer. Toolbar is never transformed with the image. */

.gts-image-viewer {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    z-index: 2147483500;
    box-sizing: border-box;
    overflow: hidden;
    overscroll-behavior: none;
}

.gts-image-viewer[aria-hidden="false"] {
    display: block;
    touch-action: none;
}

.gts-image-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 27, 45, 0.92);
}

.gts-image-viewer-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    padding: max(8px, env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
    pointer-events: none;
}

.gts-image-viewer-shell > * {
    pointer-events: auto;
}

.gts-image-viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    flex: 0 0 auto;
    z-index: 2;
    padding: 4px 0 10px;
    transform: none !important;
}

.gts-image-viewer-btn {
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-radius: 8px;
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.gts-image-viewer-btn:hover,
.gts-image-viewer-btn:focus-visible {
    background: rgba(255, 255, 255, 0.26);
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.gts-image-viewer-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.gts-image-viewer-pct {
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    min-width: 52px;
    text-align: center;
    user-select: none;
}

.gts-image-viewer-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.gts-image-viewer-viewport {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.gts-image-viewer-viewport.is-pannable {
    cursor: grab;
}

.gts-image-viewer-viewport.is-panning {
    cursor: grabbing;
}

.gts-image-viewer-img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transform-origin: center center;
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
    -webkit-user-drag: none;
    user-select: none;
}

html.gts-image-viewer-open,
body.gts-image-viewer-open {
    overflow: hidden;
}

/* Nested above the main-calendar job popup (same stacking context as its Bootstrap nested modals). */
.afd-modal .gts-image-viewer {
    z-index: 1300;
}

@media (prefers-reduced-motion: reduce) {
    .gts-image-viewer-img {
        transition: none !important;
    }
}
