/* =========================================================
   NBG M THUMBNAIL SLIDER (REVISED — iOS SAFE)
========================================================= */

/* =========================================================
   GALLERY TITLE
========================================================= */

.gallery-title {
    font-family: 'Uncial Antiqua', serif;
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    color: #3b2617;
}

/* =========================================================
   SLIDER WRAPPER
========================================================= */

.nbgm-thumb-slider {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 100%;
}

/* =========================================================
   TRACK (DESKTOP DEFAULT)
========================================================= */

.nbgm-thumb-track {
    display: flex;
    gap: 1rem;
    overflow: hidden;           /* desktop controlled by arrows */
    scroll-behavior: smooth;
    padding: 0.5rem;
}

/* =========================================================
   THUMBNAILS (DESKTOP)
========================================================= */

.nbgm-thumb {
    width: 250px;
    height: 250px;
    flex: 0 0 250px;

    border-radius: 16px;
    overflow: hidden;

    border: 3px solid #b49a71;
    background: #000;
    box-shadow: 0 8px 22px rgba(0,0,0,0.35);

    cursor: pointer;
}

.nbgm-thumb img {
    width: 250px !important;
    height: 250px !important;
    object-fit: cover !important;
    display: block;
    border-radius: 16px;
    max-width: none;
}

/* Hover zoom (desktop only) */
.nbgm-thumb:hover img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* =========================================================
   NAVIGATION ARROWS (DESKTOP)
========================================================= */

.nbgm-thumb-nav {
    background: #3d2415;
    color: #f9e4c9;
    border: 2px solid #b5926b;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 1.5rem;
    cursor: pointer;
    flex-shrink: 0;
}

.nbgm-thumb-nav:hover {
    background: #5a3720;
}

/* =========================================================
   MOBILE — TOUCH / SWIPE MODE
========================================================= */

@media (max-width: 768px) {

    /* Hide arrows */
    .nbgm-thumb-nav {
        display: none;
        pointer-events: none;
    }

    /* Allow nested scroll on iOS */
    .nbgm-thumb-slider {
        overflow: visible;
    }

    /* Make track swipeable */
    .nbgm-thumb-track {
        overflow-x: auto;
        overflow-y: hidden;

        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        touch-action: pan-x;

        gap: 0.75rem;
        padding: 0.5rem 0.25rem 1rem;
    }

    /* IMPORTANT: < 100% width to force overflow */
    .nbgm-thumb {
        width: 80vw;
        height: auto;
        aspect-ratio: 1 / 1;   /* change to 4 / 3 if desired */
        flex: 0 0 80vw;

        scroll-snap-align: center;
        border-radius: 14px;
    }

    .nbgm-thumb img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 14px;
    }
}

/* =========================================================
   TOUCH DEVICES — DISABLE HOVER EFFECTS
========================================================= */

@media (hover: none) {
    .nbgm-thumb:hover img {
        transform: none;
    }
}

/* =========================================================
   LIGHTBOX
========================================================= */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10,10,20,0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    font-size: 2.6rem;
    color: #f7e7c1;
    cursor: pointer;
}
