/* ========================================
   GPI Public Styles - Galerie Photo Interactive
   ======================================== */

.gpi-frontend-wrapper {
    margin: 20px 0;
}

.gpi-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.gpi-filter-btn {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    color: #2c3338;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.gpi-filter-btn:hover {
    background: #e7f0f8;
    border-color: #8ec1e6;
}

.gpi-filter-btn.active {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
    box-shadow: 0 2px 6px rgba(34, 113, 177, 0.3);
}

.gpi-gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--gpi-columns, 4), 1fr);
    gap: var(--gpi-gap, 15px);
    align-items: start;
}

/* Masonry style using CSS columns (good compromise without heavy JS) */
.gpi-style-masonry {
    column-count: var(--gpi-columns, 4);
    column-gap: var(--gpi-gap, 15px);
    display: block !important; /* override grid for masonry effect */
}

.gpi-style-masonry .gpi-gallery-item {
    break-inside: avoid;
    margin-bottom: var(--gpi-gap, 15px);
    width: 100%;
    display: inline-block;
}

/* Grid style */
.gpi-style-grid .gpi-gallery-item {
    aspect-ratio: 1 / 1;
}

.gpi-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s ease;
    background: #f0f0f1;
}

.gpi-gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

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

.gpi-gallery-item:hover img {
    transform: scale(1.08);
}

.gpi-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0,0,0,0.45) 100%
    );
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 12px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

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

.gpi-zoom-icon {
    background: rgba(255,255,255,0.95);
    color: #1d2327;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Lightbox */
.gpi-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.96);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
}

.gpi-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.gpi-lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gpi-lightbox img {
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: gpiLightboxEnter 0.3s ease forwards;
}

@keyframes gpiLightboxEnter {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.gpi-lightbox-caption {
    color: #fff;
    margin-top: 14px;
    font-size: 15px;
    text-align: center;
    max-width: 800px;
    padding: 0 20px;
    opacity: 0.9;
}

.gpi-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 10;
}

.gpi-lightbox-nav:hover {
    background: rgba(255,255,255,0.3);
}

.gpi-lightbox-nav.prev { left: 20px; }
.gpi-lightbox-nav.next { right: 20px; }

.gpi-lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    font-size: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.gpi-lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}

.gpi-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    background: rgba(0,0,0,0.4);
    padding: 4px 14px;
    border-radius: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .gpi-filter-bar {
        gap: 6px;
    }
    
    .gpi-filter-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .gpi-gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    
    .gpi-style-masonry {
        column-count: 2 !important;
    }
}

@media (max-width: 480px) {
    .gpi-gallery-grid {
        grid-template-columns: 1fr !important;
    }
    
    .gpi-style-masonry {
        column-count: 1 !important;
    }
}