/* ===================================================
 * ABCISSE GALLERY WIDGET
 * =================================================== */
.pgal-wrapper { width: 100%; max-width: 1240px; margin: 0 auto; }

.pgal-header { text-align: center; margin-bottom: 36px; }
.pgal-header-supra {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #0073e6;
    margin-bottom: 12px;
    line-height: 1;
}
.pgal-header-title {
    font-size: 36px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.015em;
}

/* ===== GRILLE COMMUNE ===== */
.pgal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ===== ITEM COMMUN ===== */
.pgal-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    background: #0f172a;
    aspect-ratio: 1;
    transform: translateZ(0);
}
.pgal-media,
.pgal-media img {
    width: 100%;
    height: 100%;
    display: block;
}
.pgal-media img {
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.4s ease;
}
.pgal-item:hover .pgal-media img {
    transform: scale(1.08);
    filter: brightness(0.85);
}

.pgal-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(15, 23, 42, 0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    opacity: 0;
    transition: opacity 0.4s ease, background-color 0.4s ease;
    padding: 20px;
}
.pgal-item:hover .pgal-overlay {
    opacity: 1;
    background-color: rgba(15, 23, 42, 0.5);
}

.pgal-play,
.pgal-zoom {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 115, 230, 0.95);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.6);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.pgal-play svg,
.pgal-zoom svg { width: 22px; height: 22px; }
.pgal-play svg { margin-left: 3px; }
.pgal-item:hover .pgal-play,
.pgal-item:hover .pgal-zoom { transform: scale(1); }

/* Bouton play permanent (visible même sans hover pour les vidéos) */
.pgal-item[data-type="video"] .pgal-overlay {
    opacity: 1;
    background-color: rgba(15, 23, 42, 0.25);
}
.pgal-item[data-type="video"] .pgal-play {
    transform: scale(0.85);
    animation: pgal-pulse 2.4s ease-in-out infinite;
}
.pgal-item[data-type="video"]:hover .pgal-overlay {
    background-color: rgba(15, 23, 42, 0.5);
}
.pgal-item[data-type="video"]:hover .pgal-play {
    animation: none;
    transform: scale(1.1);
}
@keyframes pgal-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 115, 230, 0.6); }
    50%      { box-shadow: 0 0 0 16px rgba(0, 115, 230, 0); }
}

.pgal-caption {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    max-width: 90%;
}

/* ===== VARIANTE 1 : CLASSIC ===== */
/* (par défaut, grid uniforme) */

/* ===== VARIANTE 2 : MAGAZINE ===== */
.pgal-variant-magazine .pgal-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 200px;
    grid-auto-flow: dense;
}
.pgal-variant-magazine .pgal-item {
    aspect-ratio: auto;
    grid-column: span 1;
    grid-row: span 1;
}
.pgal-variant-magazine .pgal-featured {
    grid-column: span 2;
    grid-row: span 2;
}
.pgal-variant-magazine .pgal-item:nth-child(5n) {
    grid-column: span 2;
}

/* ===== VARIANTE 3 : MASONRY ===== */
.pgal-variant-masonry .pgal-grid {
    display: block;
    column-count: 3;
    column-gap: 16px;
}
.pgal-variant-masonry .pgal-item {
    aspect-ratio: auto;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 16px;
    display: inline-block;
    width: 100%;
}
.pgal-variant-masonry .pgal-media,
.pgal-variant-masonry .pgal-media img { height: auto; }
.pgal-variant-masonry .pgal-r-square   { aspect-ratio: 1/1; }
.pgal-variant-masonry .pgal-r-portrait { aspect-ratio: 3/4; }
.pgal-variant-masonry .pgal-r-wide     { aspect-ratio: 16/9; }
.pgal-variant-masonry .pgal-r-square .pgal-media img,
.pgal-variant-masonry .pgal-r-portrait .pgal-media img,
.pgal-variant-masonry .pgal-r-wide .pgal-media img { height: 100%; }

/* ===================================================
 * LIGHTBOX
 * =================================================== */
.pgal-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.pgal-lightbox.is-open { opacity: 1; }
.pgal-lb-overlay {
    position: absolute;
    inset: 0;
    cursor: zoom-out;
}
.pgal-lb-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.pgal-lb-media {
    max-width: 100%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pgal-lb-media img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.pgal-lb-media iframe,
.pgal-lb-media video {
    width: min(90vw, 1200px);
    aspect-ratio: 16/9;
    max-height: 80vh;
    border: 0;
    border-radius: 8px;
    background: #000;
    display: block;
}
.pgal-lb-caption {
    color: #fff;
    text-align: center;
    font-size: 15px;
    max-width: 800px;
}
.pgal-lb-counter {
    position: absolute;
    top: 24px;
    left: 24px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 100px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 3;
}

.pgal-lb-close,
.pgal-lb-prev,
.pgal-lb-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.3s ease, transform 0.3s ease;
    z-index: 3;
}
.pgal-lb-close:hover,
.pgal-lb-prev:hover,
.pgal-lb-next:hover {
    background: #0073e6;
    transform: scale(1.08);
}
.pgal-lb-close { top: 20px; right: 20px; font-size: 28px; line-height: 1; }
.pgal-lb-prev  { left: 24px; top: 50%; transform: translateY(-50%); }
.pgal-lb-next  { right: 24px; top: 50%; transform: translateY(-50%); }
.pgal-lb-prev:hover { transform: translateY(-50%) scale(1.08); }
.pgal-lb-next:hover { transform: translateY(-50%) scale(1.08); }
.pgal-lb-prev svg,
.pgal-lb-next svg { width: 22px; height: 22px; }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .pgal-variant-magazine .pgal-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 180px; }
    .pgal-variant-magazine .pgal-featured { grid-column: span 2; grid-row: span 2; }
    .pgal-header-title { font-size: 28px; }
}
@media (max-width: 700px) {
    .pgal-grid { grid-template-columns: repeat(2, 1fr) !important; column-count: 2 !important; }
    .pgal-variant-magazine .pgal-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; }
    .pgal-variant-magazine .pgal-featured { grid-column: span 2; grid-row: span 1; }
    .pgal-variant-magazine .pgal-item:nth-child(5n) { grid-column: span 1; }
    .pgal-lb-close { top: 12px; right: 12px; width: 40px; height: 40px; }
    .pgal-lb-prev  { left: 8px; width: 40px; height: 40px; }
    .pgal-lb-next  { right: 8px; width: 40px; height: 40px; }
    .pgal-lb-counter { top: 12px; left: 12px; font-size: 12px; padding: 4px 10px; }
}

/* ===== LIGHTBOX PORTFOLIO (réutilisée par le widget Portfolio) ===== */
.pport-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    padding: 40px;
    box-sizing: border-box;
    animation: pgal-lb-in 0.3s ease;
}
@keyframes pgal-lb-in { from { opacity: 0; } to { opacity: 1; } }
.pport-lightbox .pport-lb-content {
    text-align: center;
    max-width: 100%;
    max-height: 100%;
}
.pport-lightbox img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}
.pport-lightbox .pport-lb-caption {
    color: #fff;
    margin-top: 16px;
    font-size: 15px;
}
.pport-lightbox .pport-lb-close {
    position: absolute;
    top: 20px; right: 20px;
    background: rgba(255,255,255,0.1);
    border: 0;
    color: #fff;
    width: 44px; height: 44px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    line-height: 1;
}
.pport-lightbox .pport-lb-close:hover { background: #0073e6; }
