/* =====================================================
   Pasan Gallery — Classic Grid + Lightbox
   ===================================================== */

.psgg-wrap { margin: 2rem 0; }
.psgg-heading {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    text-align: center;
}

/* ---------- GRID ---------- */
.psgg-grid {
    display: grid;
    grid-template-columns: repeat(var(--psgg-cols, 3), 1fr);
    gap: var(--psgg-gap, 12px);
}
.psgg-item {
    position: relative;
    aspect-ratio: var(--psgg-ratio, 1 / 1);
    border: none;
    padding: 0;
    margin: 0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: transparent;
    font-size: 0;
    line-height: 0;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.psgg-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.psgg-item:hover { box-shadow: 0 10px 28px rgba(0,0,0,0.15); }
.psgg-item:hover img { transform: scale(1.05); }

/* Hover overlay with expand icon */
.psgg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.psgg-item:hover .psgg-overlay { opacity: 1; }

.psgg-play {
    position: absolute;
    top: 10px; right: 10px;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    z-index: 2;
}

/* ---------- MASONRY (ratio="auto") ---------- */
.psgg-masonry {
    display: block;
    column-count: var(--psgg-cols, 3);
    column-gap: var(--psgg-gap, 12px);
}
.psgg-item--auto {
    aspect-ratio: auto;
    display: inline-block;
    width: 100%;
    margin-bottom: var(--psgg-gap, 12px);
    break-inside: avoid;
}
.psgg-item--auto img { height: auto; }

/* ---------- LIGHTBOX ---------- */
.psgg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(8,8,8,0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.psgg-lightbox.psgg-open { opacity: 1; }
.psgg-lightbox[hidden] { display: none; }

.psgg-lb-stage {
    max-width: 88vw;
    max-height: 86vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.psgg-lb-stage img,
.psgg-lb-stage video {
    max-width: 88vw;
    max-height: 86vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    display: block;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.psgg-lb-close {
    position: absolute;
    top: 16px; right: 20px;
    width: 46px; height: 46px;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    z-index: 4;
    opacity: 0.85;
    transition: opacity 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.psgg-lb-close:hover { opacity: 1; }

.psgg-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px; height: 56px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff;
    cursor: pointer;
    z-index: 4;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.psgg-lb-nav:hover { background: rgba(255,255,255,0.22); }
.psgg-lb-prev { left: 18px; }
.psgg-lb-next { right: 18px; }

.psgg-lb-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
    max-width: 80vw;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    z-index: 4;
}
.psgg-lb-counter {
    position: absolute;
    top: 20px; left: 24px;
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    z-index: 4;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 780px) {
    .psgg-grid { grid-template-columns: repeat(2, 1fr); }
    .psgg-masonry { column-count: 2; }
    .psgg-lb-nav { width: 44px; height: 44px; }
    .psgg-lb-prev { left: 8px; }
    .psgg-lb-next { right: 8px; }
}
@media (max-width: 480px) {
    .psgg-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .psgg-masonry { column-count: 2; column-gap: 8px; }
}
