/* ============================================================
   ElementorLiquidBlob — liquid-blob.css
   ============================================================ */

/* ── Wrapper ──────────────────────────────────────────── */
.elb-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    padding: 32px 24px;
}

/* ── Background canvas ────────────────────────────────── */
.elb-bg-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: block;
}

/* ── Grid ─────────────────────────────────────────────── */
.elb-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(var(--elb-cols, 3), 1fr);
    gap: var(--elb-gap, 24px);
}

@media (max-width: 1024px) {
    .elb-grid {
        grid-template-columns: repeat(var(--elb-cols-tablet, 2), 1fr);
    }
}

@media (max-width: 600px) {
    .elb-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 400px) {
    .elb-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Gallery Item ─────────────────────────────────────── */
.elb-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    /* Clip-path is set dynamically by JS */
    will-change: clip-path;
    /* Liquid distortion filter composed with a glow drop-shadow */
    filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.35));
    transition: filter 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-tap-highlight-color: transparent;
}

/* Hover: apply SVG liquid-distort + coloured glow */
.elb-item--hovered {
    filter: url(#elb-liquid)
            drop-shadow(0 6px 28px color-mix(in srgb, var(--elb-item-accent, #6c63ff) 60%, transparent));
    transform: scale(1.03);
    z-index: 2;
}

/* ── Image ────────────────────────────────────────────── */
.elb-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    transform-origin: center;
}

/* ── Caption ──────────────────────────────────────────── */
.elb-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 16px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-family: sans-serif;
    letter-spacing: 0.03em;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}

.elb-item--hovered .elb-caption {
    opacity: 1;
    transform: translateY(0);
}

/* ── Lightbox ─────────────────────────────────────────── */
.elb-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.38s ease, visibility 0.38s ease;
}

.elb-lightbox.open {
    visibility: visible;
    opacity: 1;
}

.elb-lb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px) saturate(0.6);
    -webkit-backdrop-filter: blur(8px) saturate(0.6);
    cursor: pointer;
}

.elb-lb-content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: elb-lb-appear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes elb-lb-appear {
    from { transform: scale(0.78) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0);       opacity: 1; }
}

.elb-lb-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    border-radius: 8px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08),
                0 40px 90px rgba(0,0,0,0.8);
}

.elb-lb-title {
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    font-family: sans-serif;
    margin: 0;
    text-align: center;
}

.elb-lb-close,
.elb-lb-download {
    position: absolute;
    top: -50px;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.07);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(4px);
}

.elb-lb-download { right: 46px; font-size: 20px; }

.elb-lb-close:hover,
.elb-lb-download:hover {
    background: rgba(255,255,255,0.18);
    transform: scale(1.12);
}

/* ── Reduced motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .elb-item,
    .elb-item img,
    .elb-caption { transition: none !important; }
}
