.galleries {
    color: var(--color-light);
    text-align: center;
    
    & h2 {
        display: inline-block;
        font-size: clamp(32px, 6vw, 400%);
        font-weight: bold;
        scroll-margin-top:5rem;
        text-align: center;
        background-color: var(--color-light);
        color: var(--color-dark);
        padding: 0.5em 1em;
        transform: skewX(-10deg);
    }

    & h3 {
        display: block;
        position: relative;
        justify-content: center;
        scroll-margin-top:3.5rem;
        font-size: clamp(24px, 4vw, 200%);
        font-weight: bold;
        text-align: center;
        padding: 1rem;
        margin-top: 1em;
        
        & a {
            position:absolute;
            top: 50%;
            translate: 0 -50%;
            left: 0.5rem;
            border-radius: 999px;
            width: 3rem;
            height: 3rem;
            background: rgba(0,0,0,.45);
            display: flex;
            align-items: center;
            justify-content: center;
            &:hover {
                background: rgb(40,40,40);
            }
            & svg {
                width:2.5rem;
                height:2.5rem;
                fill: white;
            }
        }
    }
}

.gallery {
    position: relative;
    & .nav {
        position: absolute;
        top: 50%;
        translate: 0 -50%;
        border: 0;
        border-radius: 999px;
        width: 3rem;
        height: 3rem;
        background: rgba(0,0,0,.50);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index:99;
        &:hover {
            background: rgb(40,40,40);
        }
        & svg {
            fill: white;
            width:2.5rem;
            height:2.5rem;
        }
    }
    & .prev { left: 0.5rem; } 
    & .next { right: 0.5rem; }

    & .track {
        display: flex;
        gap: calc(0.5 * var(--gap-standard));
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scrollbar-color: gray transparent;
        > * {
            scroll-snap-align: start;
        }
        & figure {
            flex: 1 0 calc(50% - (0.25 * var(--gap-standard)));
            overflow: hidden;
            position: relative;
            max-height: 80vh;
            
            @media (max-width: 800px) {
                flex: 1 0 100%;
            }    

            & img {
                max-width:100%;
                width:100%;
                height: 100%;
                object-fit: cover;
                object-position: 50% 50%;
            }
            
            & figcaption {
                position:absolute;
                bottom: 1em;
                left: 1em;
                padding:1em;
                border-radius: 0.5em;
                border: 1px solid color-mix(in srgb, white, transparent 70%);
                width: calc(100% - 2em);
                display: block;
                background-color: color-mix(in srgb, black, transparent 40%);
                text-align: center;
                color: white;
            }
        }
    }
}

.unsnap {
    scroll-snap-type: unset !important; 
}

