/* Portfolio Gallery Plugin - même ADN que RGP V6.9 */

:root {
    --pgp-primary:    #6366f1;
    --pgp-secondary:  #f1f5f9;
    --pgp-text-dark:  #1e293b;
    --pgp-text-light: #64748b;
    --pgp-border:     #e2e8f0;
    --pgp-overlay:    rgba(0, 0, 0, 0.6);
    --pgp-speed:      0.3s;
}

* { box-sizing: border-box; }

/* FILTRES */
.pgp-filter-btn {
    padding: 0.6rem 1.2rem;
    background: var(--pgp-secondary);
    color: var(--pgp-text-dark);
    border: 2px solid transparent;
    border-radius: 2rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--pgp-speed) ease;
    text-decoration: none;
}
.pgp-filter-btn:hover {
    border-color: var(--pgp-primary);
    color: var(--pgp-primary);
    transform: translateY(-2px);
}
.pgp-filter-btn.active {
    background: var(--pgp-primary);
    color: white;
    border-color: var(--pgp-primary);
}

/* GRILLE MOSAÏQUE PINTEREST */
.pgp-gallery-grid {
    column-count: auto;
    column-width: 280px;
    column-gap: 1rem;
}

.pgp-gallery-item {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all var(--pgp-speed) ease;
    cursor: pointer;
    margin-bottom: 1rem;
    break-inside: avoid;
    page-break-inside: avoid;
}
.pgp-gallery-item:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    transform: translateY(-4px);
}

/* IMAGE */
.pgp-image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--pgp-secondary);
    cursor: pointer;
}
.pgp-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--pgp-speed) ease;
}
.pgp-gallery-item:hover .pgp-image {
    transform: scale(1.05);
}

/* OVERLAY */
.pgp-image-overlay {
    position: absolute;
    inset: 0;
    background: var(--pgp-overlay);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    opacity: 0;
    transition: opacity var(--pgp-speed) ease;
}
.pgp-gallery-item:hover .pgp-image-overlay {
    opacity: 1;
}
.pgp-overlay-content { color: white; width: 100%; }
.pgp-overlay-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.4rem 0;
    color: white;
}
.pgp-overlay-hint {
    font-size: 0.85rem;
    margin: 0;
    opacity: 0.9;
}

/* LIGHTBOX */
.pgp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
.pgp-lightbox.open {
    display: flex !important;
}
.pgp-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.92);
    cursor: pointer;
}
.pgp-lightbox-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
}
.pgp-lightbox-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 85vw;
    max-height: 80vh;
}
.pgp-lightbox-img {
    max-width: 85vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    transition: opacity 0.2s ease;
}

/* Boutons lightbox */
.pgp-lightbox-close,
.pgp-lightbox-prev,
.pgp-lightbox-next {
    position: fixed;
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 50%;
    transition: background var(--pgp-speed) ease;
    line-height: 1;
    z-index: 2;
}
.pgp-lightbox-close:hover,
.pgp-lightbox-prev:hover,
.pgp-lightbox-next:hover {
    background: rgba(255,255,255,0.3);
}
.pgp-lightbox-close {
    top: 1.2rem;
    right: 1.2rem;
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pgp-lightbox-prev {
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pgp-lightbox-next {
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pgp-lightbox-prev.hidden,
.pgp-lightbox-next.hidden {
    opacity: 0.2;
    pointer-events: none;
}

/* Caption */
.pgp-lightbox-caption {
    margin-top: 0.8rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
}
.pgp-lightbox-counter {
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .pgp-gallery-grid {
        column-width: 150px;
        column-gap: 0.7rem;
    }
    .pgp-lightbox-prev { left: 0.3rem; }
    .pgp-lightbox-next { right: 0.3rem; }
}
