/* GALLERY: a scroll-snap slider (swipe on touch, arrows and thumbnails
   with gallery.js) that opens PhotoSwipe. Without JS it is still a
   scrollable row of links to the full-size photos. */
.gallery{
    min-width: 0;
}

.gallery-stage{
    position: relative;
}

.gallery-track{
    display: flex;
    aspect-ratio: 1 / 1;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    background-color: #f4f4f4;
}

.gallery-track::-webkit-scrollbar{
    display: none;
}

.gallery-track:focus-visible{
    outline: 2px solid #0678b8;
    outline-offset: 2px;
}

.gallery-slide{
    position: relative;
    flex: 0 0 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    cursor: zoom-in;
}

.gallery-arrow{
    position: absolute;
    top: 50%;
    width: 2.75rem;
    height: 2.75rem;
    margin-top: -1.375rem;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gallery-arrow::before{
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.6rem;
    height: 0.6rem;
    border-top: 2px solid #343434;
    border-right: 2px solid #343434;
}

.gallery-prev{
    left: 0.75rem;
}

.gallery-prev::before{
    transform: translate(-30%, -50%) rotate(-135deg);
}

.gallery-next{
    right: 0.75rem;
}

.gallery-next::before{
    transform: translate(-70%, -50%) rotate(45deg);
}

.gallery-arrow:disabled{
    visibility: hidden;
}

.gallery-stage:hover .gallery-arrow,
.gallery-arrow:focus-visible{
    opacity: 1;
}

.gallery-arrow:focus-visible{
    outline: 2px solid #0678b8;
    outline-offset: 2px;
}

/* touch screens swipe; arrows are for a mouse */
@media (hover: none){
    .gallery-arrow{
        display: none;
    }
}

.gallery-counter{
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.8rem;
    line-height: 1.4;
    pointer-events: none;
}

.gallery-thumbs{
    display: flex;
    gap: 0.35rem;
    margin-top: 0.35rem;
    overflow-x: auto;
    scrollbar-width: none;
}

/* shown by gallery.js; without JS the photos still scroll */
.gallery-thumbs[hidden]{
    display: none;
}

.gallery-thumbs::-webkit-scrollbar{
    display: none;
}

.gallery-thumb{
    flex: 0 0 calc((100% - 4 * 0.35rem) / 5);
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 0;
    background: #f4f4f4;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.gallery-thumb:hover, .gallery-thumb.is-active{
    opacity: 1;
}

.gallery-thumb.is-active{
    outline: 2px solid #0678b8;
    outline-offset: -2px;
}

.gallery-thumb:focus-visible{
    outline: 2px solid #0678b8;
    outline-offset: 2px;
}

.gallery-thumb-image{
    display: block;
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
       object-fit: cover;
}

/* PhotoSwipe caption (aksesore names) */
.pswp__caption{
    position: absolute;
    left: 50%;
    bottom: 1rem;
    max-width: calc(100% - 2rem);
    transform: translateX(-50%);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
}

/* "Rreth nesh": a row of several photos with the same arrows */
.gallery-strip{
    position: relative;
}

.gallery-strip:hover .gallery-arrow,
.gallery-strip .gallery-arrow:focus-visible{
    opacity: 1;
}
