/* Scoped styles with the 'gallert' prefix */
.gallert-section {
    width: 100%;
    margin: 20px 0;
    overflow: hidden;
}

/* The Horizontal Scroll Container */
.gallert-row {
    display: flex;
    gap: 10px;
    overflow-x: auto; /* Horizontal scrolling */
    padding-bottom: 15px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

/* Image sizing logic */
.gallert-item {
    cursor: pointer;
    object-fit: cover;
    border-radius: 4px;
    scroll-snap-align: start;
    /* Desktop Calculation: 6 images visible */
    flex: 0 0 calc((100% / 6) - (50px / 6));
    aspect-ratio: 1 / 1;
    transition: opacity 0.2s;
    width: 20%;
}

.gallert-item:hover {
    opacity: 0.9;
}

/* Responsive Logic: Mobile View (2 images visible) */
@media (max-width: 600px) {
    .gallert-item {
        /* Mobile Calculation: 2 images visible */
        flex: 0 0 calc((100% / 2) - (10px / 2));
    }
}

/* Lightbox (Enlarge view) */
#gallert-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.gallert-lightbox-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 2px;
}

.gallert-close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 50px;
    font-weight: 200;
    cursor: pointer;
    line-height: 1;
}

/* Scrollbar styling */
.gallert-row::-webkit-scrollbar {
    height: 6px;
}
.gallert-row::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}
.gallert-row::-webkit-scrollbar-track {
    background: #eee;
}
