/* ─────────────────────────────────────────────
   PB GALLERY
   ───────────────────────────────────────────── */

.pb-gallery {
    width: 100%;
}

/* ── Grid ── */
.pb-gallery--grid .pb-gallery--items,
.pb-gallery--grid-no-gap .pb-gallery--items {
    display: grid;
}

.pb-gallery--grid-no-gap .pb-gallery--items {
    gap: 0 !important;
}

/* ── Masonry (CSS column-count) ── */
.pb-gallery--masonry .pb-gallery--items {
    display: block; /* column-count csak block-on működik */
}

.pb-gallery--masonry .pb-gallery--item {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: var(--pb-gallery-gap, 10px);
}

.pb-gallery--masonry .pb-gallery--item-inner {
    display: block;
}

/* ── Slider (Slick) ── */
.pb-gallery--slider .pb-gallery--items {
    display: block;
}

.pb-gallery--slider .pb-gallery--items.slick-initialized {
    display: block;
}

/* ── Item ── */
.pb-gallery--item {
    position: relative;
    overflow: hidden;
}

.pb-gallery--hidden {
    display: none !important;
}

.pb-gallery--link {
    display: block;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.pb-gallery--link img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

/* .pb-gallery--link:hover img {
    transform: scale(1.04);
} */

/* ── Overlay ── */
.pb-gallery--overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 12px 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.pb-gallery--link:hover .pb-gallery--overlay {
    opacity: 1;
}

.pb-gallery--overlay-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ── Load more ── */
.pb-gallery--footer {
    text-align: center;
    margin-top: 20px;
}

.pb-gallery--load-more {
    display: inline-block;
    padding: 10px 30px;
    background: var(--accent, #009688);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.pb-gallery--load-more:hover {
    opacity: 0.85;
}

.pb-gallery--load-more.pb-loading {
    opacity: 0.6;
    pointer-events: none;
}

.pb-gallery--load-more.pb-gallery--load-more-hidden {
    display: none;
}

/* ── Slick overrides ── */
.pb-gallery .slick-slide img {
    width: 100%;
    height: auto;
    display: block;
}

.pb-gallery .slick-prev,
.pb-gallery .slick-next {
    z-index: 10;
    width: 36px;
    height: 36px;
}

.pb-gallery .slick-prev { left: 10px; }
.pb-gallery .slick-next { right: 10px; }

.pb-gallery .slick-prev:before,
.pb-gallery .slick-next:before {
    font-size: 28px;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ── Lightbox ── */
.pb-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.pb-lightbox.pb-lightbox--open {
    opacity: 1;
    visibility: visible;
}

.pb-lightbox--inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pb-lightbox--img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    border-radius: 2px;
}

.pb-lightbox--title {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    margin-top: 10px;
    text-align: center;
}

.pb-lightbox--close {
    position: absolute;
    top: -40px;
    right: -10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    transition: color 0.2s;
}

.pb-lightbox--close:hover { color: var(--accent, #009688); }

.pb-lightbox--prev,
.pb-lightbox--next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 24px;
    width: 48px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    z-index: 100000;
}

.pb-lightbox--prev { left: 10px; }
.pb-lightbox--next { right: 10px; }

.pb-lightbox--prev:hover,
.pb-lightbox--next:hover {
    background: rgba(255,255,255,0.2);
}

.pb-lightbox--counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    z-index: 100000;
}

/* ── Preview (admin) ── */
.pb-preview-gallery {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    align-items: center;
}

.pb-preview-gallery--thumb {
    width: 30px;
    height: 30px;
    background-size: cover;
    background-position: center;
    border-radius: 2px;
    flex-shrink: 0;
}

.pb-preview-gallery--empty {
    color: #aaa;
    font-size: 11px;
}

.pb-preview-gallery--more {
    font-size: 11px;
    color: #888;
    padding-left: 2px;
}

/* ── Mobile responsive ── */
@media (max-width: 768px) {
    .pb-gallery--grid .pb-gallery--items {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .pb-gallery--grid-no-gap .pb-gallery--items {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .pb-gallery--masonry .pb-gallery--items {
        column-count: 2 !important;
    }
}

@media (max-width: 480px) {
    .pb-gallery--grid .pb-gallery--items,
    .pb-gallery--grid-no-gap .pb-gallery--items {
        grid-template-columns: repeat(1, 1fr) !important;
    }

    .pb-gallery--masonry .pb-gallery--items {
        column-count: 1 !important;
    }
}
