/* W_Gallery front - design system spójny z w_socialfloat
   (karty: #fff / border #d9dee1 / radius 6px, akcent teal #17a2a0) */

/* ---------- Blok wprowadzający (kategoria) ---------- */

.w-gallery-intro {
    margin: 35px 0;
}

.w-gallery-intro__title {
    margin: 0 0 15px;
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

/* ---------- Siatka ---------- */

.w-gallery-grid {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.w-gallery-grid--intro {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.w-gallery-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #d9dee1;
    padding: 10px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    transition: box-shadow .2s ease, border-color .2s ease;
}

.w-gallery-item:hover,
.w-gallery-item:focus {
    box-shadow: 0 0 8px rgba(0, 0, 0, .15);
    border-color: #c3cbd0;
    text-decoration: none;
}

.w-gallery-item picture {
    display: contents;
}

.w-gallery-item img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform .25s ease;
}

.w-gallery-item:hover img {
    transform: scale(1.03);
}

/* ---------- Przycisk "Pokaż więcej zdjęć" ---------- */

.w-gallery-intro__more {
    margin-top: 18px;
    text-align: center;
}

.w-gallery-more-btn,
.w-gallery-more-btn:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    background: #17a2a0;
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    transition: box-shadow .2s ease;
}

.w-gallery-more-btn:hover,
.w-gallery-more-btn:focus {
    box-shadow: 0 0 8px rgba(0, 0, 0, .2);
    color: #fff !important;
    text-decoration: none;
}

/* ---------- Podstrona galerii ---------- */

.w-gallery-description {
    margin-bottom: 22px;
    color: #333;
    line-height: 1.6;
}

.w-gallery-description p:last-child {
    margin-bottom: 0;
}

.w-gallery-back {
    margin-top: 28px;
}

.w-gallery-back-btn,
.w-gallery-back-btn:visited {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: #fff;
    color: #17a2a0 !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #17a2a0;
    transition: box-shadow .2s ease, background .2s ease;
}

.w-gallery-back-btn:hover,
.w-gallery-back-btn:focus {
    background: #eef8f8;
    box-shadow: 0 0 8px rgba(0, 0, 0, .15);
    color: #17a2a0 !important;
    text-decoration: none;
}

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

.w-gallery-no-scroll {
    overflow: hidden;
}

.w-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, .92);
    display: none;
    align-items: center;
    justify-content: center;
    /* horizontal swipe handled in JS, vertical/pinch left to the browser */
    touch-action: pan-y pinch-zoom;
    user-select: none;
    -webkit-user-select: none;
}

.w-gallery-lightbox.is-open {
    display: flex;
}

.w-gallery-lightbox__figure {
    position: relative;
    z-index: 1;
    margin: 0;
    /* leave room for the arrows so they never cover the photo on desktop */
    max-width: calc(100vw - 150px);
    max-height: 90vh;
    text-align: center;
}

.w-gallery-lightbox__figure img {
    display: block;
    margin: 0 auto;
    max-width: calc(100vw - 150px);
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
    background: #fff;
    -webkit-user-drag: none;
}

.w-gallery-lightbox__figure figcaption {
    display: flex;
    justify-content: center;
    gap: 12px;
    color: #fff;
    padding: 10px 0;
    font-size: 13px;
}

.w-gallery-lightbox__counter {
    opacity: .7;
    white-space: nowrap;
}

/* buttons: reset theme styles so they always stay visible */
.w-gallery-lightbox .w-gallery-lightbox__btn {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .25);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    opacity: 1;
    visibility: visible;
    cursor: pointer;
    transition: background .2s ease;
}

.w-gallery-lightbox .w-gallery-lightbox__btn:hover,
.w-gallery-lightbox .w-gallery-lightbox__btn:focus {
    background: #17a2a0;
    color: #fff;
    opacity: 1;
    outline: none;
}

.w-gallery-lightbox .w-gallery-lightbox__btn:focus-visible {
    box-shadow: 0 0 0 2px #fff;
}

.w-gallery-lightbox .w-gallery-lightbox__close {
    top: 15px;
    right: 15px;
    font-size: 30px;
}

.w-gallery-lightbox .w-gallery-lightbox__prev,
.w-gallery-lightbox .w-gallery-lightbox__next {
    top: 50%;
    transform: translateY(-50%);
}

.w-gallery-lightbox .w-gallery-lightbox__prev {
    left: 15px;
}

.w-gallery-lightbox .w-gallery-lightbox__next {
    right: 15px;
}

.w-gallery-lightbox.is-single .w-gallery-lightbox__prev,
.w-gallery-lightbox.is-single .w-gallery-lightbox__next {
    display: none;
}

@media (max-width: 767px) {
    .w-gallery-lightbox__figure,
    .w-gallery-lightbox__figure img {
        max-width: 100vw;
    }

    .w-gallery-lightbox__figure figcaption {
        padding: 10px 15px;
    }

    /* on phones arrows sit over the photo - dark circle keeps them readable */
    .w-gallery-lightbox .w-gallery-lightbox__btn {
        width: 42px;
        height: 42px;
        font-size: 18px;
        background: rgba(0, 0, 0, .6);
    }

    .w-gallery-lightbox .w-gallery-lightbox__prev {
        left: 8px;
    }

    .w-gallery-lightbox .w-gallery-lightbox__next {
        right: 8px;
    }

    .w-gallery-lightbox .w-gallery-lightbox__close {
        top: 10px;
        right: 10px;
        font-size: 26px;
    }
}

/* ---------- RWD ---------- */

@media (max-width: 767px) {
    .w-gallery-grid,
    .w-gallery-grid--intro {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .w-gallery-intro__title {
        font-size: 17px;
    }
}
#module-w_gallery-gallery section#main {
    padding: 15px;
    background-color: #fff;
}
.post-nav-back p {
    color: #000;
    font-size: 12pt;
    text-align: justify;
    line-height: 1.5;
    margin-bottom: 5px;
}
#module-w_gallery-gallery #center-column {
  background-color: #fff;
  padding: 15px;
}