/* PP Gallery Plus -- Gallery Grid */

.pp-gallery {
    list-style-type: none;
    display: flex;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.pp-gallery li {
    width: 20%;
}

.pp-gallery img {
    width: 100%;
    display: block;
    margin: auto;
}

.pp-gallery img:hover {
    opacity: 0.85;
}

.pp-gallery__item figure {
    margin: 0;

    a {
        text-decoration: none;
    }
}

/* Title text inside each thumb link -- hidden by default, shown in titles mode */
.ppgal2-thumb-title {
    display: none;
}

/* Titles mode: flat list with small thumbnail */
.ppgal2-titles-mode .pp-gallery {
    display: block;
    max-width: 600px;
    margin: 0 auto;
}

.ppgal2-titles-mode .pp-gallery li {
    width: 100%;
    padding: 4px 0;
}

.ppgal2-titles-mode .ppgal2-thumb img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
    margin-right: 12px;
}

.ppgal2-titles-mode .ppgal2-thumb-title {
    display: inline;
    font-size: 20px;
    color: #333;
    vertical-align: middle;
}

/* ---- Filter bar ---- */

.ppgal2-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ppgal2-filters select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.ppgal2-filter-reset {
    padding: 6px 12px;
    border: 1px solid #337638;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    color: #337638;
    cursor: pointer;
}

.ppgal2-filter-reset:hover {
    background: #337638;
    color: #fff;
}

.ppgal2-title-toggle {
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    color: #333;
    cursor: pointer;
}

.ppgal2-title-toggle.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* ---- Column selector ---- */

.ppgal2-column-select {
    margin-bottom: 10px;
}

.ppgal2-column-select select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

/* ---- Infinite scroll sentinel ---- */

.ppgal2-sentinel {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 14px;
}

/* ---- Lightbox ---- */

.ppgal2-lightbox {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 1000;
    display: none;
}

.ppgal2-lightbox .lightbox-content {
    width: 100%;
    height: 100%;
    position: relative;
}

.ppgal2-lightbox .ppgal2-lb-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.2s ease;
}

.ppgal2-lightbox .ppgal2-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 44px;
    cursor: pointer;
    color: #000;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    line-height: 1;
    padding: 4px 12px;
    z-index: 10;
}

.ppgal2-lightbox .ppgal2-prev,
.ppgal2-lightbox .ppgal2-next {
    color: #000;
    font-size: 36px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    user-select: none;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    padding: 10px 14px;
    text-decoration: none;
    z-index: 10;
}

.ppgal2-lightbox .ppgal2-prev {
    left: 15px;
}

.ppgal2-lightbox .ppgal2-next {
    right: 15px;
}

.ppgal2-lightbox .lightbox-inner-content {
    width: 100%;
    height: 100%;
    position: relative;
}

.ppgal2-lightbox .ppgal2-lb-title {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    background: rgba(255, 255, 255, 0.85);
    padding: 8px 20px;
    font-size: 18px;
    z-index: 10;
    white-space: nowrap;
}

.ppgal2-lightbox .ppgal2-lb-description {
    display: none;
}

.ppgal2-lightbox-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

/* ---- Responsive ---- */

@media screen and (max-width: 500px) {
    .pp-gallery li {
        width: 50%;
    }

    .ppgal2-lightbox img {
        height: auto;
    }
}
