/* pjvapourblasting.com - Work gallery slideshow */

/* MARK: Gallery Section */
.gallery {
    padding: var(--section-space) 0;
    background:
        linear-gradient(180deg, var(--background-soft) 0%, var(--text-light) 100%);
}

.gallery .section-heading {
    margin-bottom: 1.5rem;
}

.gallery-intro {
    text-align: center;
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto 2rem;
    font-size: 1.08rem;
}

.gallery-carousel {
    max-width: 1040px;
    margin: 0 auto;
    outline: none;
}

.gallery-carousel:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 6px;
    border-radius: var(--border-radius);
}

.gallery-shell {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.75rem;
}

.gallery-viewport {
    overflow: hidden;
    width: 100%;
    touch-action: pan-y;
    min-width: 0;
}

.gallery-track {
    display: flex;
    align-items: center;
    gap: 1rem;
    transform: translateX(0);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.gallery-track.is-resetting {
    transition: none;
}

.gallery-track.is-resetting .gallery-slide {
    transition: none;
}

.gallery-slide {
    flex: 0 0 min(72%, 640px);
    aspect-ratio: 4 / 3;
    border: none;
    padding: 0;
    border-radius: var(--border-radius-large);
    overflow: hidden;
    background: var(--background-light);
    cursor: pointer;
    opacity: 0.5;
    box-shadow: var(--shadow-small);
    transition: opacity 0.6s ease, box-shadow 0.6s ease;
}

.gallery-slide.is-active {
    opacity: 1;
    box-shadow: var(--shadow-large);
    cursor: default;
}

.gallery-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* MARK: Gallery Nav */
.gallery-nav {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(44, 82, 130, 0.18);
    border-radius: 50%;
    background: var(--text-light);
    color: var(--primary-color);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-small);
    transition: var(--transition);
    flex-shrink: 0;
}

.gallery-nav:hover {
    background: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

.gallery-nav:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 3px;
}

.gallery-nav svg {
    display: block;
}

/* MARK: Mobile */
@media (max-width: 768px) {
    .gallery {
        padding: var(--section-space-mobile) 0;
    }

    .gallery-shell {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .gallery-nav {
        display: none;
    }

    .gallery-slide {
        flex-basis: min(78%, 520px);
        cursor: default;
        pointer-events: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-track,
    .gallery-slide {
        transition: none;
    }
}
