/* assets/css/picture-slider.css - the picture slider of the project pages (includes/picture-slider.php,
   assets/js/picture-slider.js): swipe, arrows, thumbnails, a new picture every few seconds */

.pg {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    width: 100%;
}

.pg-stage {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius, 20px);
    overflow: hidden;
    background: #0b1f1a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    outline: none;
}

.pg-stage:focus-visible {
    box-shadow: 0 0 0 3px var(--secondary, #ffd700), 0 20px 60px rgba(0, 0, 0, 0.35);
}

.pg-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
}

.pg-track.dragging {
    transition: none;
}

.pg-slide {
    position: relative;
    flex: 0 0 100%;
    width: 100%;
    min-width: 0; /* a large picture must not widen its slide */
    height: 100%;
    margin: 0;
    overflow: hidden;
    cursor: zoom-in;
}

/* the same picture, blurred, fills the frame behind it: tall phone screens and wide pictures both show whole */
.pg-backdrop {
    position: absolute;
    inset: -24px;
    width: calc(100% + 48px);
    height: calc(100% + 48px);
    object-fit: cover;
    filter: blur(24px) brightness(0.5) saturate(1.2);
    pointer-events: none;
}

.pg-img {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    height: 100%;
    color: transparent; /* no alt text over the frame if a picture is missing */
    object-fit: contain;
    pointer-events: none;
    -webkit-user-drag: none;
}

.pg-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 46px;
    height: 46px;
    margin-top: -23px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(10, 25, 20, 0.55);
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.25s ease, background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.pg-prev { left: 14px; }
.pg-next { right: 14px; }

.pg-stage:hover .pg-nav,
.pg-stage:focus-within .pg-nav {
    opacity: 1;
}

.pg-nav:hover {
    background: var(--secondary, #ffd700);
    border-color: var(--secondary, #ffd700);
    color: var(--primary, #1a3c34);
    transform: scale(1.06);
}

.pg-counter {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    padding: 4px 11px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.pg-expand {
    position: absolute;
    bottom: 16px;
    right: 14px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.25s ease, background 0.25s ease;
}

.pg-stage:hover .pg-expand,
.pg-expand:focus-visible {
    opacity: 1;
}

.pg-expand:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* the time until the next picture */
.pg-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    height: 3px;
    background: rgba(255, 255, 255, 0.12);
}

.pg-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--secondary, #ffd700);
}

.pg-thumbs {
    position: relative;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.4) transparent;
}

.pg-thumb {
    flex: 0 0 auto;
    width: 88px;
    aspect-ratio: 16 / 10;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    background: #0b1f1a;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.pg-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pg-thumb:hover {
    opacity: 0.85;
}

.pg-thumb.active {
    opacity: 1;
    border-color: var(--secondary, #ffd700);
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.25);
}

/* touch screens have no hover: show the arrows, smaller */
@media (hover: none) {
    .pg-nav {
        opacity: 1;
        width: 38px;
        height: 38px;
        margin-top: -19px;
        font-size: 0.85rem;
    }

    .pg-expand {
        opacity: 1;
        padding: 6px 9px;
    }
}

@media (max-width: 768px) {
    .pg-stage {
        border-radius: 14px;
    }

    .pg-prev { left: 8px; }
    .pg-next { right: 8px; }

    .pg-thumb {
        width: 66px;
        border-radius: 8px;
    }
}

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