/* =============================================================================
   WSM Gallery — Stylesheet v1.1.0
   ============================================================================= */

/* ── Wrapper ──────────────────────────────────────────────────────────────── */
.wsm-gallery-wrapper {
    width: 100%;
}

/* ── Canvas — the absolute positioning surface ────────────────────────────── */
.wsm-gallery-canvas {
    position: relative;
    width: 100%;
    height: 600px;
}

/* ── Item ─────────────────────────────────────────────────────────────────── */
.wsm-gallery-item {
    position: absolute;
    display: inline-flex;
    flex-direction: column;
    cursor: default;
}

/* ── Media container — background image, sized to real image dimensions ─── */
/* width + height are set via inline style in PHP (real pixel dimensions)    */
.wsm-gallery-media {
    position: relative;
    display: block;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: 100% 100%; /* stretch to exact pixel dimensions */
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.35s ease;
}

.wsm-gallery-item:hover .wsm-gallery-media {
    transform: scale(1.03);
}

/* ── Overlay ──────────────────────────────────────────────────────────────── */
.wsm-gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none;
}

/* ── Title variants ───────────────────────────────────────────────────────── */
.wsm-gallery-title {
    display: block;
}

.wsm-gallery-title--above {
    order: -1;
}

.wsm-gallery-title--below {
    order: 1;
}

.wsm-gallery-title--overlay,
.wsm-gallery-title--bottom {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 2;
    pointer-events: none;
}

.wsm-gallery-title--overlay {
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
}

.wsm-gallery-title--bottom {
    bottom: 0;
}

/* ── Drag handle — hidden on frontend, shown in editor (body.elementor-editor-active) ─── */
.wsm-gallery-drag-handle {
    display: none;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    background: #4f94d4;
    color: #fff;
    border-radius: 4px;
    align-items: center;
    justify-content: center;
    cursor: grab;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 4px;
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.wsm-gallery-drag-handle:active {
    cursor: grabbing;
}

/* Show drag handles in editor */
body.elementor-editor-active .wsm-gallery-drag-handle,
body.elementor-editor-preview .wsm-gallery-drag-handle {
    display: flex;
}

body.elementor-editor-active .wsm-gallery-item:hover .wsm-gallery-drag-handle,
body.elementor-editor-preview .wsm-gallery-item:hover .wsm-gallery-drag-handle {
    opacity: 1;
}

/* Highlight dragged item */
body.elementor-editor-active .wsm-gallery-item.wsm-is-dragging,
body.elementor-editor-preview .wsm-gallery-item.wsm-is-dragging {
    outline: 2px dashed #4f94d4;
    outline-offset: 3px;
    z-index: 9999 !important;
    cursor: grabbing;
}

/* Position badge shown while dragging */
.wsm-drag-badge {
    position: fixed;
    background: #1d2939;
    color: #fff;
    font-size: 11px;
    font-family: monospace;
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 99999;
    white-space: nowrap;
    transform: translate(12px, 12px);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.wsm-drag-badge.is-visible {
    opacity: 1;
}
