* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
/* Change background back to white to match the target */
body {
    background-color: #000000; 
}

/* Masonry Gallery Container */
.gallery-container {
    column-count: 2; /* Forces a 2-column layout even in narrow spaces */
    column-gap: 15px;
    padding: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Automatically expands to 3 columns on larger screens */
@media (min-width: 768px) {
    .gallery-container {
        column-count: 3;
    }
}

/* Masonry Items */
.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 8px;
    margin-bottom: 15px; /* Creates the vertical gap between images */
    break-inside: avoid; /* Crucial: Prevents images from splitting across columns */
    display: inline-block; 
    width: 100%;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.hover-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hover-overlay h3 {
    font-size: 1.5rem;
    text-align: center;
    padding: 10px;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item:hover .hover-overlay {
    opacity: 1;
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 1001;
}

.modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: 80vh;
    max-width: 800px;
}

.modal-content img {
    max-height: 70vh;
    object-fit: contain;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 50px;
    cursor: pointer;
    padding: 20px;
    transition: color 0.3s;
}

.nav-arrow:hover { color: #aaa; }
.prev-arrow { left: 20px; }
.next-arrow { right: 20px; }

/* Thumbnail Strip */
.thumbnail-strip {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    overflow-x: auto;
    padding-bottom: 10px;
    max-width: 90vw;
}

.thumb-img {
    height: 60px;
    width: 60px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s, border 0.3s;
    border: 2px solid transparent;
}

.thumb-img.active, .thumb-img:hover {
    opacity: 1;
    border: 2px solid rgb(0, 0, 0);
}