/**
 * Tacticalia Business Directory
 *
 * Public Business Profile Gallery.
 */

.tbd-public-gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 17px;
}

.tbd-public-gallery-header h2 {
    margin: 0;
}

.tbd-public-gallery-count {
    color: var(--tbd-profile-muted);
    font-size: 12px;
    font-weight: 600;
}

.tbd-public-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.tbd-public-gallery__item {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--tbd-profile-border);
    border-radius: 10px;
    background: #fff;
}

.tbd-public-gallery__button {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: #eee;
    cursor: zoom-in;
}

.tbd-public-gallery__button img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition:
        transform .3s ease,
        filter .3s ease;
}

.tbd-public-gallery__button:hover img {
    transform: scale(1.035);
    filter: brightness(.88);
}

.tbd-public-gallery__zoom {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    color: #fff;
    transition: opacity .2s ease;
}

.tbd-public-gallery__button:hover .tbd-public-gallery__zoom {
    opacity: 1;
}

.tbd-public-gallery__zoom .dashicons {
    width: 36px;
    height: 36px;
    font-size: 36px;
}

.tbd-public-gallery__item figcaption {
    padding: 10px 12px;
    border-top: 1px solid var(--tbd-profile-border);
    color: var(--tbd-profile-muted);
    font-size: 11px;
    line-height: 1.45;
}


/* =========================================================
 * LIGHTBOX
 * ========================================================= */

.tbd-gallery-lightbox {
    position: fixed;
    z-index: 999999;
    inset: 0;
}

.tbd-gallery-lightbox[hidden] {
    display: none;
}

.tbd-gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 9, 8, .94);
    backdrop-filter: blur(4px);
}

.tbd-gallery-lightbox__dialog {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 70px 85px 55px;
}

.tbd-gallery-lightbox__topbar {
    position: absolute;
    z-index: 4;
    top: 20px;
    right: 24px;
    left: 24px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    color: #fff;
}

.tbd-gallery-lightbox__counter {
    font-size: 13px;
    font-weight: 600;
}

.tbd-gallery-lightbox__close,
.tbd-gallery-lightbox__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
}

.tbd-gallery-lightbox__close {
    width: 42px;
    height: 42px;
}

.tbd-gallery-lightbox__nav {
    position: absolute;
    z-index: 4;
    top: 50%;
    width: 48px;
    height: 48px;
    transform: translateY(-50%);
}

.tbd-gallery-lightbox__close:hover,
.tbd-gallery-lightbox__nav:hover {
    background: rgba(255, 255, 255, .2);
}

.tbd-gallery-lightbox__nav--prev {
    left: 22px;
}

.tbd-gallery-lightbox__nav--next {
    right: 22px;
}

.tbd-gallery-lightbox__figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    max-height: 100%;
    margin: 0;
}

.tbd-gallery-lightbox__figure img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 150px);
    object-fit: contain;
}

.tbd-gallery-lightbox__caption {
    max-width: 850px;
    margin-top: 15px;
    color: rgba(255, 255, 255, .82);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

.tbd-gallery-lightbox__caption:empty {
    display: none;
}

body.tbd-gallery-lightbox-open {
    overflow: hidden;
}


@media (max-width: 650px) {

    .tbd-public-gallery {
        grid-template-columns: 1fr;
    }

    .tbd-gallery-lightbox__dialog {
        padding: 65px 14px 85px;
    }

    .tbd-gallery-lightbox__figure img {
        max-height: calc(100vh - 180px);
    }

    .tbd-gallery-lightbox__nav {
        top: auto;
        bottom: 20px;
        transform: none;
    }

    .tbd-gallery-lightbox__nav--prev {
        left: calc(50% - 58px);
    }

    .tbd-gallery-lightbox__nav--next {
        right: calc(50% - 58px);
    }

}