/* Lightbox + zoom for ER diagrams. */

.hmp-er-wrapper {
    margin: 1rem 0 0.5rem 0;
}

.hmp-er-hint {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--pst-color-text-muted);
    font-style: italic;
}

.hmp-zoom-trigger {
    cursor: zoom-in;
    display: inline-block;
    border-radius: 4px;
    transition: box-shadow 0.15s ease-in-out, transform 0.15s ease-in-out;
}

.hmp-zoom-trigger:hover {
    box-shadow: 0 0 0 2px var(--pst-color-primary), 0 4px 12px rgba(0, 0, 0, 0.15);
}

img.hmp-zoomable {
    cursor: zoom-in;
    max-width: 100%;
    height: auto;
}

.hmp-zoom-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    z-index: 9999;
    overflow: hidden;
}

.hmp-zoom-overlay.open {
    display: block;
}

body.hmp-zoom-open {
    overflow: hidden;
}

.hmp-zoom-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    overflow: hidden;
}

.hmp-zoom-overlay.dragging .hmp-zoom-stage {
    cursor: grabbing;
}

.hmp-zoom-stage img {
    max-width: 90vw;
    max-height: 90vh;
    transform-origin: center center;
    user-select: none;
    pointer-events: none;
    background: white;
    border-radius: 4px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.hmp-zoom-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.4rem;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    line-height: 1;
}

.hmp-zoom-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.hmp-zoom-toolbar {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.4rem 0.6rem;
    border-radius: 999px;
    z-index: 10001;
}

.hmp-zoom-toolbar button {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.95rem;
    cursor: pointer;
    min-width: 2.4rem;
}

.hmp-zoom-toolbar button:hover {
    background: rgba(255, 255, 255, 0.15);
}
