.fm-gallery-carousel,
.fm-gallery-grid,
.fm-all-galleries {
    --fm-img-height: 370px;
    --fm-columns: 4;
    --fm-gap: 0px;
    --fm-blue: #5ea0ea;
    --fm-blue-dark: #3f8fe8;
}

.fm-gallery-item {
    overflow: hidden;
    position: relative;
    display: block;
    text-decoration: none !important;
    background: #f3f6f9;
}

.fm-gallery-item img {
    display: block;
    width: 100% !important;
    height: var(--fm-img-height) !important;
    object-fit: cover !important;
    object-position: center center !important;
    transition: transform 0.7s ease, filter 0.7s ease;
}

.fm-gallery-item:hover img {
    transform: scale(1.08);
    filter: brightness(0.8);
}

.fm-gallery-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
    pointer-events: none;
}
.fm-gallery-item:hover::before { opacity: 1; }

.fm-gallery-item::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0;
    transition: all 0.5s ease;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M10 2a8 8 0 105.293 14.293l4.707 4.707 1.414-1.414-4.707-4.707A8 8 0 0010 2zm0 2a6 6 0 110 12 6 6 0 010-12z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    z-index: 2;
    pointer-events: none;
}
.fm-gallery-item:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* CAROUSEL */
.fm-gallery-carousel {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
}
.fm-gallery-carousel.fm-carousel-fullwidth {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}
.fm-carousel-track-wrap {
    overflow: hidden;
    width: 100%;
}
.fm-carousel-track {
    display: flex;
    gap: var(--fm-gap);
    transition: transform 0.35s ease;
    will-change: transform;
}
.fm-carousel-slide {
    flex: 0 0 calc((100% - (var(--fm-gap) * (var(--fm-columns) - 1))) / var(--fm-columns));
}
.fm-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 92px;
    height: 92px;
    border: 0 !important;
    border-radius: 0;
    cursor: pointer;
    background: transparent !important;
    color: rgba(255,255,255,.92) !important;
    font-size: 112px;
    font-weight: 300;
    line-height: .7;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    padding: 0 !important;
    box-shadow: none !important;
    text-shadow: 0 3px 14px rgba(0,0,0,.42);
}
.fm-carousel-btn:hover,
.fm-carousel-btn:focus {
    color: #fff !important;
    background: transparent !important;
    outline: none;
}
.fm-carousel-btn.fm-prev { left: 18px; }
.fm-carousel-btn.fm-next { right: 18px; }

/* STRANKA FOTOGALERIA */
.fm-all-galleries {
    --fm-img-height: 240px;
}
.fm-gallery-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px 30px;
    margin: 0 auto 42px;
}
.fm-gallery-tab {
    min-width: 150px;
    min-height: 56px;
    border: 1px solid #dfe5ec !important;
    background: #fff !important;
    color: #151515 !important;
    padding: 14px 24px !important;
    cursor: pointer;
    border-radius: 8px !important;
    font: inherit;
    font-weight: 800;
    font-size: 14px;
    line-height: 1;
    letter-spacing: .02em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all .22s ease;
    box-shadow: 0 8px 24px rgba(20, 35, 60, .04);
}
.fm-gallery-tab::before {
    content: "";
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    background: currentColor;
    opacity: .9;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h7v7H4V4zm9 0h7v7h-7V4zM4 13h7v7H4v-7zm9 0h7v7h-7v-7z'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h7v7H4V4zm9 0h7v7h-7V4zM4 13h7v7H4v-7zm9 0h7v7h-7v-7z'/%3E%3C/svg%3E") center/contain no-repeat;
    color: var(--fm-blue);
}
.fm-gallery-tab:hover {
    border-color: var(--fm-blue) !important;
    color: var(--fm-blue-dark) !important;
    transform: translateY(-1px);
}
.fm-gallery-tab.is-active {
    background: var(--fm-blue-dark) !important;
    border-color: var(--fm-blue-dark) !important;
    color: #fff !important;
    box-shadow: 0 12px 28px rgba(94,160,234,.28);
}
.fm-gallery-tab.is-active::before { color: #fff; }
.fm-gallery-panel { display: none; }
.fm-gallery-panel.is-active { display: block; }
.fm-gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--fm-columns), minmax(0, 1fr));
    gap: 18px;
}
.fm-gallery-grid .fm-gallery-item {
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(20, 35, 60, .14);
}
.fm-gallery-grid .fm-gallery-item img {
    height: var(--fm-img-height) !important;
    object-fit: cover !important;
    object-position: center center !important;
}

.fm-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 32px;
}
.fm-lightbox.is-open { display: flex; }
.fm-lightbox img {
    max-width: 92vw;
    max-height: 86vh;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0,0,0,.45);
}
.fm-lightbox button {
    position: absolute;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 56px;
    line-height: 1;
}
.fm-lightbox-close { top: 20px; right: 26px; }
.fm-lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.fm-lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }

@media (max-width: 1024px) {
    .fm-gallery-carousel,
    .fm-gallery-grid,
    .fm-all-galleries { --fm-img-height: 260px; --fm-columns: 2; }
    .fm-gallery-tabs { gap: 14px; }
    .fm-gallery-tab { min-width: 140px; min-height: 52px; padding: 12px 18px !important; }
}
@media (max-width: 767px) {
    .fm-gallery-carousel,
    .fm-gallery-grid,
    .fm-all-galleries { --fm-img-height: 220px; --fm-columns: 1; }
    .fm-carousel-btn { width: 78px; height: 78px; font-size: 96px; }
    .fm-carousel-btn.fm-prev { left: 4px; }
    .fm-carousel-btn.fm-next { right: 4px; }
    .fm-gallery-tabs { gap: 10px; justify-content: flex-start; }
    .fm-gallery-tab { min-width: calc(50% - 5px); font-size: 12px; padding: 12px 10px !important; }
}

.fm-all-galleries {
    --fm-img-height: 210px;
}
.fm-all-galleries .fm-gallery-tabs {
    gap: 10px 14px;
    margin-bottom: 30px;
}
.fm-all-galleries .fm-gallery-tab {
    min-width: auto;
    min-height: 40px;
    padding: 10px 16px !important;
    border-radius: 7px !important;
    font-size: 12px;
    line-height: 1.1;
    gap: 8px;
    box-shadow: 0 5px 16px rgba(20, 35, 60, .035);
}
.fm-all-galleries .fm-gallery-tab::before {
    width: 15px;
    height: 15px;
    flex-basis: 15px;
}
.fm-all-galleries .fm-gallery-grid {
    gap: 16px;
}
.fm-all-galleries .fm-gallery-grid .fm-gallery-item {
    border-radius: 10px;
    box-shadow: 0 7px 18px rgba(20, 35, 60, .12);
}
.fm-all-galleries .fm-gallery-hidden {
    display: none !important;
}
.fm-gallery-more-wrap {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 18px;
}
.fm-gallery-load-more {
    border: 0 !important;
    border-radius: 8px !important;
    background: var(--fm-blue-dark) !important;
    color: #fff !important;
    cursor: pointer;
    font-weight: 800;
    font-size: 13px;
    line-height: 1;
    letter-spacing: .02em;
    text-transform: uppercase;
    padding: 15px 28px !important;
    min-height: 46px;
    box-shadow: 0 12px 24px rgba(94,160,234,.26);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.fm-gallery-load-more:hover,
.fm-gallery-load-more:focus {
    background: #2f7edb !important;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(94,160,234,.32);
    outline: none;
}

@media (max-width: 767px) {
    .fm-all-galleries { --fm-img-height: 190px; }
    .fm-all-galleries .fm-gallery-tab {
        min-width: auto;
        width: auto;
        font-size: 11px;
        padding: 9px 12px !important;
    }
}


.fm-lightbox {
    background: rgba(8, 15, 26, .90);
    backdrop-filter: blur(4px);
}
.fm-lightbox img {
    border-radius: 8px;
    box-shadow: 0 18px 55px rgba(0,0,0,.42);
}
.fm-lightbox button,
.fm-lightbox button:hover,
.fm-lightbox button:focus,
.fm-lightbox button:active {
    border: 1px solid rgba(255,255,255,.18) !important;
    background: rgba(255,255,255,.10) !important;
    color: #fff !important;
    box-shadow: 0 10px 28px rgba(0,0,0,.22) !important;
    outline: none !important;
    text-decoration: none !important;
    -webkit-appearance: none;
    appearance: none;
}
.fm-lightbox button {
    width: 46px;
    height: 46px;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    font-size: 34px;
    font-weight: 300;
    line-height: 1;
    transition: background .2s ease, border-color .2s ease, transform .2s ease, color .2s ease;
}
.fm-lightbox button:hover,
.fm-lightbox button:focus {
    background: rgba(94,160,234,.92) !important;
    border-color: rgba(94,160,234,.95) !important;
    transform: translateY(-50%) scale(1.04);
}
.fm-lightbox-close {
    top: 22px;
    right: 24px;
    font-size: 28px !important;
}
.fm-lightbox-close:hover,
.fm-lightbox-close:focus {
    transform: scale(1.04) !important;
}
.fm-lightbox-prev { left: 26px; }
.fm-lightbox-next { right: 26px; }

@media (max-width: 767px) {
    .fm-lightbox { padding: 18px; }
    .fm-lightbox img { max-width: 94vw; max-height: 78vh; }
    .fm-lightbox button { width: 40px; height: 40px; font-size: 29px; }
    .fm-lightbox-close { top: 14px; right: 14px; font-size: 24px !important; }
    .fm-lightbox-prev { left: 10px; }
    .fm-lightbox-next { right: 10px; }
}


@media (max-width: 1024px) {
    .fm-gallery-carousel {
        --fm-columns: 2 !important;
        --fm-img-height: 260px !important;
    }
}
@media (max-width: 767px) {
    .fm-gallery-carousel {
        --fm-columns: 1 !important;
        --fm-img-height: 220px !important;
    }
    .fm-gallery-carousel .fm-carousel-slide {
        flex-basis: calc((100% - (var(--fm-gap) * (var(--fm-columns) - 1))) / var(--fm-columns)) !important;
    }
}
@media (max-width: 480px) {
    .fm-gallery-carousel {
        --fm-img-height: 200px !important;
    }
}


@media (max-width: 1024px) {
    .fm-gallery-carousel {
        --fm-columns: 2 !important;
        --fm-img-height: clamp(300px, 36vw, 360px) !important;
    }
    .fm-all-galleries,
    .fm-gallery-grid {
        --fm-img-height: clamp(260px, 34vw, 320px) !important;
    }
}

@media (max-width: 767px) {
    .fm-gallery-carousel {
        --fm-columns: 1 !important;
        --fm-img-height: clamp(290px, 76vw, 380px) !important;
    }
    .fm-gallery-carousel .fm-carousel-slide {
        flex-basis: 100% !important;
    }
    .fm-all-galleries,
    .fm-gallery-grid {
        --fm-columns: 1 !important;
        --fm-img-height: clamp(270px, 72vw, 360px) !important;
    }
    .fm-gallery-grid .fm-gallery-item img,
    .fm-gallery-carousel .fm-gallery-item img {
        height: var(--fm-img-height) !important;
        object-fit: cover !important;
        object-position: center center !important;
    }
}

@media (max-width: 480px) {
    .fm-gallery-carousel {
        --fm-img-height: clamp(280px, 78vw, 340px) !important;
    }
    .fm-all-galleries,
    .fm-gallery-grid {
        --fm-img-height: clamp(260px, 74vw, 330px) !important;
    }
}
