/* PS Galería Interactiva */

.ps-gal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.75rem;
    justify-content: center;
}
.ps-gal-filter {
    padding: .4rem 1.1rem;
    border-radius: 9999px;
    border: 1.5px solid #e8e2da;
    background: transparent;
    color: #62605d;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .22s ease;
    font-family: 'Inter', sans-serif;
}
.ps-gal-filter:hover, .ps-gal-filter.active {
    background: #487e80;
    border-color: #487e80;
    color: #fff;
}

/* Masonry grid — CSS puro */
.ps-gal-grid {
    column-count: 3;
    column-gap: 1rem;
}
@media (max-width: 900px) { .ps-gal-grid { column-count: 2; } }
@media (max-width: 480px) { .ps-gal-grid { column-count: 1; } }

.ps-gal-item {
    break-inside: avoid;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.ps-gal-item[data-cat].ps-hidden { display: none; }

.ps-gal-btn {
    position: relative;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    display: block;
    width: 100%;
}

.ps-gal-btn img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    transition: transform .4s ease;
}
.ps-gal-btn:hover img { transform: scale(1.04); }

.ps-gal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(72,126,128,.55);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .3s ease;
}
.ps-gal-btn:hover .ps-gal-overlay,
.ps-gal-btn:focus .ps-gal-overlay { opacity: 1; }

.ps-gal-title {
    font-size: .78rem;
    color: #8e8c89;
    text-align: center;
    padding: 0 .25rem;
}

/* Lightbox */
.ps-gal-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.ps-gal-lightbox[hidden] { display: none; }

.ps-gal-lb-bg {
    position: absolute;
    inset: 0;
    background: rgba(26,26,24,.92);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.ps-gal-lb-content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    gap: .875rem;
    animation: ps-lb-in .3s ease;
}
@keyframes ps-lb-in {
    from { transform: scale(.92); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

#ps-gal-lb-img {
    max-width: 90vw;
    max-height: 75vh;
    border-radius: 16px;
    object-fit: contain;
    box-shadow: 0 24px 80px rgba(0,0,0,.4);
}

.ps-gal-lb-caption {
    background: rgba(254,250,240,.12);
    border-radius: 10px;
    padding: .75rem 1rem;
    backdrop-filter: blur(4px);
    text-align: center;
}
.ps-gal-lb-caption strong { display: block; color: #fefaf0; font-size: .95rem; }
#ps-gal-lb-desc { color: rgba(254,250,240,.7); font-size: .82rem; margin: .2rem 0 0; }

.ps-gal-lb-close,
.ps-gal-lb-prev,
.ps-gal-lb-next {
    position: absolute;
    z-index: 2;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.3rem;
    transition: background .2s ease;
    padding: 0;
}
.ps-gal-lb-close { top: -1rem; right: -1rem; font-size: 1.5rem; }
.ps-gal-lb-prev  { left: -3.5rem; top: 50%; transform: translateY(-50%); }
.ps-gal-lb-next  { right: -3.5rem; top: 50%; transform: translateY(-50%); }
.ps-gal-lb-close:hover,
.ps-gal-lb-prev:hover,
.ps-gal-lb-next:hover { background: rgba(72,126,128,.6); }

@media (max-width: 640px) {
    .ps-gal-lb-prev { left: .5rem; }
    .ps-gal-lb-next { right: .5rem; }
    .ps-gal-lb-close { top: .5rem; right: .5rem; }
}
