/* ===== GALLERY ===== */
.gallery-section {
    padding-bottom: 40px;
    margin-right: 60px;
    margin-left: 60px;
}

.gallery-title {
    margin-bottom: 20px;
}

.gallery-filter {
    display: flex;
    justify-content: space-between;
    gap: 0px;
    margin-left: 5vw;
    margin-right: 5vw;
    margin-bottom: 40px;
}

.gallery-pill {
    background: #e0e0e0;
    border: none;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    width: 15vw;
}

.gallery-pill:hover,
.gallery-pill.active {
    background: #7f7f7f;
    color: #fff;
    /* border: 1.5px solid rgba(0, 0, 0); */
}

.gallery-spinner {
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
    fill: #7e7e7e;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.gallery-loading {
    width: 100%;
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #7e7e7e;
    min-height: 300px;

    font-size: 21px;
}

.img-skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            #f0f0f0 25%,
            #e0e0e0 37%,
            #f0f0f0 63%);
    background-size: 400% 100%;
    animation: shimmer 1.2s infinite;
}

.gallery-item img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:not(.loading) img {
    opacity: 1;
}

.gallery-item:not(.loading) .img-skeleton {
    display: none;
}

@keyframes shimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

.gallery-track {
    /* display: flex; */
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    overflow-x: auto;
    /* overflow: visible; */
    padding-bottom: 20px;
    scroll-behavior: smooth;
}

.gallery-track::-webkit-scrollbar {
    height: 8px;
}

.gallery-track::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}

.gallery-item {
    position: relative;
    flex: 0 0 auto;
    /* width: 292px;
    height: 400px; */
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hover overlay */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    color: white;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    opacity: 0;
    transition: opacity 0.25s ease;

    cursor: pointer;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay .icon-eye {
    font-size: 22px;
    margin-bottom: 8px;
}

.icon-eye {
    width: 22px;
    height: 22px;
    fill: currentColor;
    margin-bottom: 6px;
}

.gallery-overlay .preview {
    font-size: 14px;
    letter-spacing: 1px;
}

/* ===== LIGHTBOX ===== */
.lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 200;
}

.lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 201;

    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 70vw;
    max-height: 70vh;
    transition: transform 0.25s ease;
}

.lightbox-close {
    position: absolute;
    top: 32px;
    right: 32px;
    width: 42px;
    height: 42px;
    font-size: 28px;
    color: rgba(255, 255, 255, 0.65);
    background-color: rgba(0, 0, 0, 0.2);
    /* border: 1px solid rgba(255, 255, 255, 0.4); */
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-close-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.lightbox-nav {
    position: absolute;
    top: 45%;
    width: 70px;
    height: 70px;
    color: rgba(255, 255, 255, 0.65);
    background-color: rgba(0, 0, 0, 0.2);
    /* border: 1px solid rgba(255, 255, 255, 0.4); */
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-nav-icon {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.lightbox-prev {
    left: 15px;
}

.lightbox-next {
    right: 15px;
}

.lightbox-controls {
    width: 26rem;
    height: 44px;
    position: absolute;
    bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.2);
    /* border: 1px solid rgba(255, 255, 255, 0.4); */
    border-radius: 100px;
    padding: 0 24px;
    color: white;
    font-size: 14px;
}

.lightbox-controls a {
    text-decoration: none;
    color: white;
}

.lightbox-counter {
    position: absolute;
    bottom: 85px;
    color: white;
    font-size: 13px;
}

.lightbox-controls-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    cursor: pointer;
}

#flipY {
    transform: rotate(90deg);
}

@media (min-width: 2000px) {
    .gallery-track {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .gallery-track {
        padding-bottom: 0;
        display: flex;
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .gallery-filter {
        margin-left: 2vw;
        margin-right: 2vw;
    }

    .gallery-pill {
        width: 30vw;
    }

    .gallery-item {
        width: 100%;
        height: auto;
        aspect-ratio: auto;
    }

    .gallery-item img {
        height: auto;
    }

    .gallery-section {
        padding-bottom: 0;
        margin-right: 10px;
        margin-left: 10px;
    }

    .lightbox-image {
        max-width: 95vw;
        max-height: 95vh;
        transition: transform 0.25s ease;
    }

    .lightbox-counter {
        bottom: 120px;
    }

    .lightbox-controls {
        width: 22rem;
    }
}