/* =============================================
   Simple Gallery for Elementor — gallery.css
   ============================================= */

/* ---------- Grid ---------- */
.sge-gallery-wrapper {
    width: 100%;
}

.sge-gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--sge-columns, 3), 1fr);
    gap: 12px;
    width: 100%;
}

/* ---------- Item ---------- */
.sge-gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: block;
    background: #f0f0f0;
}

.sge-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* ---------- Overlay ---------- */
.sge-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    background-color: rgba(0,0,0,0.5);
}

.sge-gallery-item:hover .sge-overlay {
    opacity: 1;
}

.sge-overlay-icon {
    font-size: 36px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.sge-gallery-item:hover .sge-overlay-icon {
    transform: scale(1.1);
}

.sge-caption {
    color: #fff;
    font-size: 14px;
    text-align: center;
    margin: 8px 12px 0;
    padding: 6px 10px;
}

/* ---------- Hover: Zoom ---------- */
.sge-hover-zoom .sge-gallery-item:hover img {
    transform: scale(1.08);
}

/* ---------- Hover: Fade ---------- */
.sge-hover-fade .sge-gallery-item img {
    transition: opacity 0.4s ease;
}

.sge-hover-fade .sge-gallery-item:hover img {
    opacity: 0.7;
}

/* ---------- Hover: Slide ---------- */
.sge-hover-slide .sge-overlay {
    transform: translateY(100%);
    opacity: 1;
    transition: transform 0.4s ease;
}

.sge-hover-slide .sge-gallery-item:hover .sge-overlay {
    transform: translateY(0);
    opacity: 1;
}

/* ---------- Masonry layout ---------- */
.sge-layout-masonry {
    columns: var(--sge-columns, 3);
    display: block;
}

.sge-layout-masonry .sge-gallery-item {
    break-inside: avoid;
    margin-bottom: 12px;
    display: block;
}

.sge-layout-masonry .sge-gallery-item img {
    width: 100%;
    height: auto;
    aspect-ratio: unset !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .sge-gallery-grid {
        grid-template-columns: repeat(var(--sge-columns-tablet, var(--sge-columns, 2)), 1fr);
    }
    .sge-layout-masonry {
        columns: var(--sge-columns-tablet, var(--sge-columns, 2));
    }
}

@media (max-width: 767px) {
    .sge-gallery-grid {
        grid-template-columns: repeat(var(--sge-columns-mobile, 1), 1fr);
    }
    .sge-layout-masonry {
        columns: var(--sge-columns-mobile, 1);
    }
}

/* =============================================
   LIGHTBOX
   ============================================= */
.sge-lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
    animation: sgeFadeIn 0.25s ease;
}

.sge-lightbox-overlay.sge-lb-open {
    display: flex;
}

@keyframes sgeFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.sge-lb-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
    animation: sgeLbZoomIn 0.3s ease;
}

@keyframes sgeLbZoomIn {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.sge-lb-image {
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
    display: block;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.sge-lb-caption {
    color: rgba(255,255,255,0.75);
    font-size: 14px;
    margin-top: 12px;
    text-align: center;
    max-width: 600px;
}

/* Buttons */
.sge-lb-close,
.sge-lb-prev,
.sge-lb-next {
    position: fixed;
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 1000000;
}

.sge-lb-close:hover,
.sge-lb-prev:hover,
.sge-lb-next:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.1);
}

.sge-lb-close {
    top: 20px;
    right: 20px;
}

.sge-lb-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.sge-lb-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.sge-lb-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.sge-lb-next:hover {
    transform: translateY(-50%) scale(1.1);
}
