/* Content photo gallery + lightbox (sgLister / rel=example_group) */

.event-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 4px 0 28px;
}

.event-gallery > .bft-service-anchor {
    display: contents;
}

.bft-service-anchor.event-gallery:has(.bft-ev),
.event-gallery:has(.bft-ev),
.event-gallery:has(> .bft-ore-gallery),
.event-gallery:has(> .bft-alye-shots),
.event-gallery:has(> .bft-alye-gallery) {
    display: block;
    width: 100%;
}

.event-gallery > .bft-ore-gallery,
.event-gallery > .bft-alye-shots,
.event-gallery > .bft-alye-gallery {
    width: 100% !important;
    max-width: none !important;
}

.bft-service-anchor:has(> div > a[rel="example_group"]) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 4px 0 28px;
}

.event-gallery__item,
.event-gallery > div,
.bft-service-anchor:has(> div > a[rel="example_group"]) > div {
    float: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0;
}

.event-gallery > div[style*="clear"],
.bft-service-anchor > div[style*="clear"] {
    display: none !important;
}

/* Loose sgLister items (no .event-gallery wrapper yet).
   Do not use nth-of-type: it counts ALL sibling divs (.order, etc.). */
.main-content__text > div:has(> a[rel="example_group"]):not(.bft-ore-gallery):not(.bft-alye-shots):not(.bft-alye-gallery):not(.event-gallery) {
    float: left !important;
    display: block !important;
    box-sizing: border-box !important;
    width: 33.3333% !important;
    max-width: 33.3333% !important;
    margin: 0 !important;
    padding: 0 16px 16px 0 !important;
    min-width: 0;
    vertical-align: top;
}

.main-content__text > .bft-ore-gallery,
.main-content__text > .bft-alye-shots,
.main-content__text > .bft-alye-gallery {
    float: none !important;
    display: grid !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
}

.main-content__text > .bft-ore-gallery > a,
.main-content__text > .bft-ore-gallery > div,
.main-content__text > .bft-alye-shots > a,
.main-content__text > .bft-alye-shots > div,
.main-content__text > .bft-alye-gallery > a,
.main-content__text > .bft-alye-gallery > div {
    float: none !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.event-gallery a[rel="example_group"],
.main-content__text a[rel="example_group"] {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 16px;
    background: #eef3f8;
    box-shadow: 0 8px 24px rgba(15, 40, 70, 0.08);
    text-decoration: none !important;
    color: inherit;
}

.event-gallery a[rel="example_group"]::after,
.main-content__text a[rel="example_group"]::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(9, 28, 52, 0) 46%, rgba(9, 28, 52, 0.38) 100%),
        radial-gradient(circle at 50% 50%, rgba(9, 28, 52, 0.08), transparent 58%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.event-gallery a[rel="example_group"]::before,
.main-content__text a[rel="example_group"]::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 46px;
    height: 46px;
    margin: -23px 0 0 -23px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(9, 28, 52, 0.25);
    background:
        linear-gradient(#fff, #fff) center / 16px 2px no-repeat,
        linear-gradient(#fff, #fff) center / 2px 16px no-repeat,
        rgba(15, 58, 110, 0.55);
    opacity: 0;
    transform: scale(0.86);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 1;
    pointer-events: none;
}

.event-gallery a[rel="example_group"]:hover::after,
.event-gallery a[rel="example_group"]:focus-visible::after,
.main-content__text a[rel="example_group"]:hover::after,
.main-content__text a[rel="example_group"]:focus-visible::after {
    opacity: 1;
}

.event-gallery a[rel="example_group"]:hover::before,
.event-gallery a[rel="example_group"]:focus-visible::before,
.main-content__text a[rel="example_group"]:hover::before,
.main-content__text a[rel="example_group"]:focus-visible::before {
    opacity: 1;
    transform: scale(1);
}

.event-gallery img,
.main-content__text a[rel="example_group"] img,
.event-gallery__img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border: 0;
    border-radius: 16px;
    transition: transform 0.35s ease;
}

.event-gallery a[rel="example_group"]:hover img,
.main-content__text a[rel="example_group"]:hover img {
    transform: scale(1.04);
}

.bft-v2-page .content-left > h1 {
    margin-bottom: 18px;
}

.bft-lb {
    position: fixed;
    inset: 0;
    z-index: 40050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(8, 18, 32, 0.82);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.16s ease;
}

.bft-lb.is-open {
    opacity: 1;
    visibility: visible;
}

.bft-lb__stage {
    position: relative;
    max-width: min(1100px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    transform-origin: center center;
}

.bft-lb__img {
    display: block;
    max-width: min(1100px, calc(100vw - 48px));
    max-height: calc(100vh - 96px);
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    background: #111;
    vertical-align: top;
    cursor: zoom-in;
    touch-action: none;
    user-select: none;
}

.bft-lb.is-zoomed .bft-lb__img {
    cursor: grab;
}

.bft-lb__img.is-dragging {
    cursor: grabbing;
    transition: none;
}

.bft-lb__counter {
    position: absolute;
    left: 14px;
    bottom: 14px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(8, 18, 32, 0.72);
    color: #fff;
    font: 600 13px/1.2 Inter, "Open Sans", Arial, sans-serif;
}

.bft-lb__btn {
    position: absolute;
    top: 50%;
    width: 46px;
    height: 46px;
    margin-top: -23px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    color: #0f3a6e;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.bft-lb__btn:hover,
.bft-lb__btn:focus-visible {
    background: #ffcc00;
}

.bft-lb__prev {
    left: -18px;
}

.bft-lb__next {
    right: -18px;
}

.bft-lb__close {
    top: -12px;
    right: -12px;
    margin-top: 0;
    font-size: 24px;
}

.bft-lb[hidden] {
    display: none !important;
}

body.bft-lb-open {
    overflow: hidden;
}

#txt_3 > .event-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    max-width: none;
}

#txt_3 > .event-gallery .gallery_mob {
    width: auto;
    max-width: none;
    padding: 0;
}

#txt_3 > .event-gallery img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 16px;
}

@media (max-width: 900px) {
    .event-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    #txt_3 > .event-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .main-content__text > div:has(> a[rel="example_group"]):not(.bft-ore-gallery):not(.bft-alye-shots):not(.bft-alye-gallery):not(.event-gallery) {
        width: 50% !important;
        max-width: 50% !important;
        padding: 0 12px 12px 0 !important;
    }

    .bft-lb__prev {
        left: 8px;
    }

    .bft-lb__next {
        right: 8px;
    }
}

@media (max-width: 560px) {
    .event-gallery,
    #txt_3 > .event-gallery {
        grid-template-columns: 1fr;
    }

    .main-content__text > div:has(> a[rel="example_group"]):not(.bft-ore-gallery):not(.bft-alye-shots):not(.bft-alye-gallery):not(.event-gallery) {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 0 12px !important;
    }
}
