
/* GALLERY SECTION */
.tx-gallery {
    padding: 75px 0 80px;
    background: #ffffff;
}

.tx-gallery__heading {
    text-align: center;
    margin-bottom: 35px;
}

.tx-gallery__heading h2 {
    margin: 0;
    font-size: clamp(27px, 3vw, 38px);
    line-height: 1.3;
    font-weight: 800;
    color: #222;
}

.tx-gallery__line {
    display: block;
    width: 65px;
    height: 4px;
    margin: 16px auto;
    border-radius: 10px;
    background: #9e1828;
}

.tx-gallery__heading p {
    margin: 0 auto;
    max-width: 700px;
    color: #666;
    font-size: 16px;
    line-height: 1.7;
}

.tx-gallery__slider {
    position: relative;
}

.tx-gallery__track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    padding: 2px;
}

.tx-gallery__track::-webkit-scrollbar {
    display: none;
}

.tx-gallery__item {
    flex: 0 0 calc((100% - 56px) / 5);
    aspect-ratio: 3 / 4;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 15px;
    background: #f1eded;
    overflow: hidden;
    cursor: zoom-in;
    scroll-snap-align: start;
}

.tx-gallery__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.tx-gallery__item:hover .tx-gallery__image {
    transform: scale(1.04);
}

.tx-gallery__item:focus-visible,
.tx-gallery__arrow:focus-visible {
    outline: 3px solid #9e1828;
    outline-offset: 3px;
}

.tx-gallery__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(158,24,40,.92);
    color: white;
    font-size: 21px;
    cursor: pointer;
}

.tx-gallery__prev {
    left: -18px;
}

.tx-gallery__next {
    right: -18px;
}

.tx-gallery__arrow:disabled {
    opacity: .35;
    cursor: default;
}

.tx-gallery__dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
}

.tx-gallery__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #d4d4d4;
    cursor: pointer;
}

.tx-gallery__dot.is-active {
    background: #9e1828;
    width: 10px;
    height: 10px;
}

/* LIGHTBOX */
.tx-lightbox[hidden] {
    display: none !important;
}

.tx-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 65px 24px 28px;
    background: rgba(0,0,0,.94);
}

.tx-lightbox__figure {
    min-width: 0;
    margin: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.tx-lightbox__image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100dvh - 150px);
    object-fit: contain;
    border-radius: 6px;
}

.tx-lightbox__caption {
    color: #fff;
    font-size: 14px;
    text-align: center;
}

.tx-lightbox__close,
.tx-lightbox__prev,
.tx-lightbox__next {
    border: 0;
    color: #fff;
    background: rgba(255,255,255,.14);
    cursor: pointer;
    flex-shrink: 0;
}

.tx-lightbox__close {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 32px;
}

.tx-lightbox__prev,
.tx-lightbox__next {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 20px;
}

/* TABLET */
@media (max-width: 1024px) {
    .tx-gallery__item {
        flex-basis: calc((100% - 28px) / 3);
    }
}

/* MOBILE */
@media (max-width: 767px) {
    .tx-gallery {
        padding: 45px 0 50px;
    }

    .tx-gallery__heading {
        margin-bottom: 25px;
    }

    .tx-gallery__heading p {
        font-size: 14px;
    }

    .tx-gallery__item {
        flex-basis: 72%;
        border-radius: 12px;
    }

    .tx-gallery__arrow {
        width: 32px;
        height: 32px;
        font-size: 15px;
    }

    .tx-gallery__prev {
        left: 0;
    }

    .tx-gallery__next {
        right: 0;
    }

    .tx-lightbox {
        padding: 65px 8px 22px;
        gap: 4px;
    }

    .tx-lightbox__prev,
    .tx-lightbox__next {
        width: 32px;
        height: 38px;
    }

    .tx-lightbox__image {
        max-height: calc(100dvh - 165px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tx-gallery__track {
        scroll-behavior: auto;
    }

    .tx-gallery__image {
        transition: none;
    }
}
