/* ============================================================
   SwarmGallery – Stylesheet v1.0
   ============================================================ */

/* ── Wrapper ── */
.sg-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 6px;
    background: #020810;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.sg-canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    cursor: grab;
    transition: filter 0.45s ease;
}

.sg-canvas:active { cursor: grabbing; }

.sg-canvas--blurred {
    filter: blur(12px) brightness(0.35) saturate(0.4);
}

/* ── Hint ── */
.sg-hint {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    opacity: 0.45;
    transition: opacity 0.5s ease;
}
.sg-wrapper:hover .sg-hint { opacity: 0; }

.sg-hint span {
    display: inline-block;
    padding: 5px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    color: #8aabcc;
    font-size: 11px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* ── Frozen badge ── */
.sg-frozen-badge {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
    opacity: 0;
    z-index: 10;
}

.sg-frozen-badge--visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.sg-frozen-badge span {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(100,180,255,0.15);
    border: 1px solid rgba(100,180,255,0.35);
    border-radius: 20px;
    color: #a8d8ff;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0.03em;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

/* ── Placeholder ── */
.sg-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    background: #060d18;
    border: 2px dashed #1a3050;
    border-radius: 6px;
    color: #4a6080;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
}

/* ============================================================
   Lightbox
   ============================================================ */
.sg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.32s ease, visibility 0.32s ease;
}

.sg-lightbox--open {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.sg-lb-overlay {
    position: absolute;
    inset: 0;
    background: var(--sg-lb-bg, rgba(0,0,0,0.94));
    cursor: zoom-out;
    backdrop-filter: blur(3px);
}

.sg-lb-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transform: scale(0.86);
    transition: transform 0.36s cubic-bezier(0.34,1.56,0.64,1);
}

.sg-lightbox--open .sg-lb-content { transform: scale(1); }

.sg-lb-img {
    display: block;
    max-width: 90vw;
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 4px 60px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,255,255,0.06);
}

.sg-lb-caption {
    margin: 0;
    color: rgba(255,255,255,0.55);
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
    max-width: 60ch;
    line-height: 1.5;
}

/* ── Close button ── */
.sg-lb-close {
    position: absolute;
    top: -18px;
    right: -18px;
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 2;
    width: 36px;
    height: 36px;
}

.sg-lb-close.circle {
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    color: #111;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.sg-lb-close.circle:hover {
    background: #fff;
    transform: rotate(90deg) scale(1.1);
}

.sg-lb-close.plain {
    background: transparent;
    color: #fff;
    border-radius: 4px;
    font-size: 22px;
    top: -32px; right: -6px;
}
.sg-lb-close.plain:hover { color: #88ccff; transform: scale(1.2); }

/* ── Mobile ── */
@media (max-width: 767px) {
    .sg-lb-close.circle { width:30px; height:30px; top:-12px; right:-10px; font-size:12px; }
    .sg-lb-img { max-width:95vw; max-height:78vh; }
    .sg-hint span { font-size:10px; padding:4px 10px; }
}

/* ── Elementor editor ── */
.elementor-editor-active .sg-wrapper { min-height: 300px; }
