/* Production Style Master and detail image maximizer. */
.psu-master-image:has(img),
.psu-exact-development .mse-image-preview:has(img) {
    position: relative;
}

.psu-master-image img,
.psu-exact-development .mse-image-preview img {
    cursor: zoom-in;
}

.psu-master-image:has(img)::after,
.psu-exact-development .mse-image-preview:has(img)::after {
    content: "Click to enlarge";
    position: absolute;
    right: 6px;
    bottom: 6px;
    padding: 4px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--green, #626967) 88%, transparent);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
}

.psu-master-image:has(img):hover::after,
.psu-exact-development .mse-image-preview:has(img):hover::after {
    opacity: 1;
}

.pst-image-viewer {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 28px;
    background: rgba(0, 0, 0, .72);
    box-sizing: border-box;
}

.pst-image-dialog {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(1200px, 94vw);
    height: min(900px, 92vh);
    border: 1px solid var(--line, #d4d7d6);
    border-radius: 16px;
    overflow: hidden;
    background: var(--paper, #fff);
    color: var(--ink, #252827);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

.pst-image-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    min-height: 54px;
    padding: 10px 14px 10px 18px;
    border-bottom: 1px solid var(--line, #d4d7d6);
    background: color-mix(in srgb, var(--green, #626967) 6%, #fff);
}

.pst-image-bar button {
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid var(--green, #626967);
    border-radius: 8px;
    background: var(--green, #626967);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.pst-image-stage {
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 16px;
    overflow: auto;
    background: #fff;
}

.pst-image-stage img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

html.pst-image-viewer-open,
html.pst-image-viewer-open body {
    overflow: hidden;
}

@media (max-width: 700px) {
    .pst-image-viewer { padding: 10px; }
    .pst-image-dialog { width: 100%; height: 96vh; }
}
