/* ============================================================
   Flowing River Gallery 63 — Frontend Styles
   ============================================================ */

/* ── Scene Container ── */
.frg63-scene {
    position: relative;
    width: 100%;
    overflow: hidden;
    min-height: 340px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ── River Track ── */
.frg63-river {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px;
    padding: 80px 40px;
    width: max-content;
    will-change: transform;
    touch-action: pan-y;
    cursor: grab;
}

.frg63-river:active {
    cursor: grabbing;
}

/* ── Individual Image Wrapper ── */
.frg63-img-wrap {
    position: relative;
    flex: 0 0 auto;
    width: 220px;
    will-change: transform, opacity;
    transition: opacity 0.35s ease;
    cursor: pointer;
    outline: none;
}

.frg63-img-wrap img {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
    pointer-events: none;
    will-change: transform;
    transition: box-shadow 0.3s ease;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.frg63-img-wrap:hover img {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

/* ── Title label under each image ── */
.frg63-img-title {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    color: #444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.04em;
    transition: color 0.3s ease;
}

/* ── Dimmed state for non-hovered images ── */
.frg63-river.has-hover .frg63-img-wrap:not(.is-hovered) {
    opacity: 0.55;
}

/* ── Scale-up for hovered image ── */
.frg63-img-wrap.is-hovered {
    z-index: 10;
}

/* ── Lightbox Overlay ── */
.frg63-lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.frg63-lightbox-overlay.frg63-lb-open {
    display: flex;
}

.frg63-lightbox-overlay.frg63-lb-visible {
    opacity: 1;
}

.frg63-lightbox-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.8) translateY(30px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.frg63-lightbox-overlay.frg63-lb-visible .frg63-lightbox-inner {
    transform: scale(1) translateY(0);
}

.frg63-lightbox-img {
    max-width: 85vw;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    cursor: zoom-out;
}

.frg63-lightbox-caption {
    text-align: center;
    color: #fff;
    max-width: 600px;
}

.frg63-lightbox-title {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.frg63-lightbox-desc {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.6;
}

.frg63-lightbox-close {
    position: fixed;
    top: 20px;
    right: 24px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 100000;
    line-height: 1;
    padding: 0;
}

.frg63-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
}

/* ── iOS Gyro Permission Button ── */
.frg63-gyro-btn {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    z-index: 100;
    backdrop-filter: blur(8px);
    transition: background 0.2s ease;
}

.frg63-gyro-btn:hover {
    background: rgba(0, 0, 0, 0.75);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .frg63-img-wrap {
        width: 160px;
    }

    .frg63-img-wrap img {
        height: 120px;
    }

    .frg63-river {
        gap: 16px;
        padding: 60px 20px;
    }
}

@media (max-width: 480px) {
    .frg63-img-wrap {
        width: 130px;
    }

    .frg63-img-wrap img {
        height: 100px;
    }

    .frg63-river {
        gap: 12px;
        padding: 50px 14px;
    }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .frg63-img-wrap,
    .frg63-lightbox-inner,
    .frg63-lightbox-overlay {
        transition: none !important;
        animation: none !important;
    }
}
