/* ==============================
   SQUARE IMAGE GALLERY
   Add AFTER Bootstrap
   ============================== */

/* ---------- GRID VIEW ---------- */
.art-gallery {
    width: 100%;
}

.art-gallery .grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Desktop: 3 per row */
    gap: 15px;
    padding: 15px;
}

.art-gallery .item {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    /* 🔥 Perfect square */
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
    background: #f2f2f2;
}

.art-gallery .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Fill square without distortion */
    transition: transform 0.3s ease;
}



/* ---------- LIGHTBOX ---------- */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 85%;
    max-width: 1200px;
    height: 80vh;
    position: relative;
}

.lightbox-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.lightbox-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.lightbox-image-wrapper img.show {
    opacity: 1;
}

/* Navigation arrows */
.lightbox .nav {
    font-size: 48px;
    color: #fff;
    cursor: pointer;
    user-select: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px;
    z-index: 10;
}

.lightbox .prev {
    left: -60px;
}

.lightbox .next {
    right: -60px;
}

/* Close button */
.lightbox .close {
    position: fixed;
    top: 20px;
    right: 35px;
    font-size: 45px;
    color: white;
    cursor: pointer;
}

/* Slide number */
.slide-number {
    position: absolute;
    bottom: 12px;
    right: 15px;
    color: white;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 10px;
    border-radius: 4px;
}

/* ---------- THUMBNAILS ---------- */
.thumb-row {
    display: flex;
    gap: 8px;
    padding: 15px;
    overflow-x: auto;
    justify-content: center;
}

.thumb-row img {
    width: 80px;
    height: 80px;
    aspect-ratio: 1 / 1;
    /* 🔥 Square thumbnails */
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.2s;
}

.thumb-row img.active {
    opacity: 1;
    border: 3px solid #ff4e3b;
}


/* ---------- RESPONSIVE ---------- */

/* Tablets */
@media (max-width: 1024px) {
    .art-gallery .grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .lightbox-content {
        width: 90%;
        height: 70vh;
    }

    .lightbox .nav {
        font-size: 40px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .art-gallery .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .thumb-row img {
        width: 60px;
        height: 60px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .art-gallery .grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .thumb-row img {
        width: 50px;
        height: 50px;
    }
}


/* ==============================
   MOBILE / TOUCH DEVICES
   ============================== */
@media (hover: none) and (pointer: coarse) {

    /* Remove hover zoom */
    .art-gallery .item img {
        transform: none !important;
    }

    /* Tap feedback */
    .art-gallery .item:active {
        opacity: 0.85;
    }

    .thumb-row img:active {
        opacity: 1;
        border: 3px solid #ff4e3b;
    }
}

/* =====================================
   FORCE DISABLE HOVER ON MOBILE (FINAL)
   ===================================== */
@media (hover: none),
(pointer: coarse) {

    /* Override hover with higher specificity */
    .art-gallery .item:hover img {
        transform: none !important;
    }

    .thumb-row img:hover {
        opacity: 0.6 !important;
        border: none !important;
    }

    /* Kill transitions that fake hover */
    .art-gallery .item img,
    .thumb-row img {
        transition: none !important;
    }
}