/* Grid View Styles */
body.grid-active .home-gallery {
    pointer-events: none !important;
}

body.grid-active .single-photo-container {
    pointer-events: none !important;
}

body.grid-active .right-text-box {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

body.grid-active .text-box {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

body.grid-active .text-box.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    background: #ececec !important;
}

body.grid-active .squares-container {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

body.grid-active .footer-title,
body.grid-active .footer-subtitle,
body.grid-active .footer-menu,
body.grid-active .footer-menu-bottom {
    z-index: 300 !important;
}

.grid-shield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: transparent;
    pointer-events: auto;
}

.grid-view {
    position: fixed;
    top: 50%;
    right: 5%;
    left: auto;
    width: 60vw;
    max-width: 900px;
    height: 75vh;
    z-index: 200;
    padding: 2vh 1.5vw;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    
    /* RIMOSSI backdrop-filter E AGGIUNTO LO SFONDO SOLIDO */
    background: #ececec; 
    
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%) scale(0.98);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.grid-view.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
    pointer-events: auto;
}

.sqs-gallery-design-autocolumns {
    display: block !important;
    column-count: 4;
    column-gap: 10px;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
}

.grid-item {
    position: relative;
    break-inside: avoid;
    margin-bottom: 10px !important;
    opacity: 0;
    transform: translateY(20px);
    animation: gridItemAppear 0.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    width: 100%;
    display: inline-block;
    vertical-align: top;
}

.grid-photo {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #171717;
}

.grid-item:hover .grid-photo {
    transform: scale(1.03);
    opacity: 0.85;
}

.grid-item:nth-child(1) { animation-delay: 0.03s; }
.grid-item:nth-child(2) { animation-delay: 0.06s; }
.grid-item:nth-child(3) { animation-delay: 0.09s; }
.grid-item:nth-child(4) { animation-delay: 0.12s; }
.grid-item:nth-child(5) { animation-delay: 0.15s; }
.grid-item:nth-child(6) { animation-delay: 0.18s; }
.grid-item:nth-child(7) { animation-delay: 0.21s; }
.grid-item:nth-child(8) { animation-delay: 0.24s; }
.grid-item:nth-child(9) { animation-delay: 0.27s; }
.grid-item:nth-child(n+10) { animation-delay: 0.30s; }

.sqs-gallery-design-autocolumns .grid-photo {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
}

@keyframes gridItemAppear {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.grid-view::-webkit-scrollbar {
    width: 4px;
}

.grid-view::-webkit-scrollbar-track {
    background: transparent;
}

.grid-view::-webkit-scrollbar-thumb {
    background: rgba(23, 23, 23, 0.2);
    border-radius: 4px;
}

.grid-view::-webkit-scrollbar-thumb:hover {
    background: rgba(23, 23, 23, 0.5);
}

body.grid-active .filename-display {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
